US20260065525A1
IMAGE PROCESSING
Publication
Application
Classifications
IPC Classifications
CPC Classifications
Applicants
Beijing Zitiao Network Technology Co., Ltd., Lemon Inc.
Inventors
Xin Gu, Sijie Zhu, Fan Chen, Longyin Wen
Abstract
A method, apparatus, device, and computer-readable storage medium for image processing are provided. The method includes receiving a text input for an initial image, the text input describing a visual effect for the initial image. A fusion feature for the text input and the initial image is generated based on the text input and the initial image. A target image corresponding to the initial image is generated based on a first image feature of the initial image and the fusion feature, the target image having a visual element related to the visual effect. The fusion of text and image can better express the desired visual effect.
Figures
Description
CROSS REFERENCE
[0001]This application claims priority to Chinese Patent Application No. 202411216220.8, filed on Aug. 30, 2024, and entitled “METHOD, APPARATUS, DEVICE, AND STORAGE MEDIUM FOR IMAGE PROCESSING”, the entirety of which is incorporated herein by reference.
FIELD
[0002]Example embodiments of the present disclosure generally relate to the field of computer, and in particular, to image processing.
BACKGROUND
[0003]In the field of computer vision (CV), various image processing techniques based on machine learning have been developed significantly and have wide applications. For example, images with some visual effect (e.g., effect, filter) are desired to be generated and used in many application scenarios such as social, gaming, image edit, and the like. Image processing techniques based on machine learning may be used in such application scenarios to improve user experience. In some example application scenarios, it is desirable to generate an image that matches the user input based on input information of the user, such as text description information.
SUMMARY
[0004]In a first aspect of the present disclosure, there is provided an image processing method. The method comprises: receiving a text input for an initial image, the text input describing a visual effect for the initial image; generating, based on the text input and the initial image, a fusion feature for the text input and the initial image; and generating, based on a first image feature of the initial image and the fusion feature, a target image corresponding to the initial image, the target image having a visual element related to the visual effect.
[0005]In a second aspect of the present disclosure, an apparatus for image processing is provided. The apparatus comprises: a receiving module configured to receive a text input for an initial image, the text input describing a visual effect for the initial image; a first generating module configured to generate, based on the text input and the initial image, a fusion feature for the text input and the initial image; and a second generating module configured to generate, based on a first image feature of the initial image and the fusion feature, a target image corresponding to the initial image, the target image having a visual element related to the visual effect.
[0006]In a third aspect of the present disclosure, an electronic device is provided. The electronic device comprises at least one processor; and at least one memory, the at least one memory being coupled to the at least one processor and storing instructions for execution by the at least one processor. When executed by the at least one processor, the instructions cause the electronic device to perform the method of the first aspect.
[0007]In a fourth aspect of the present disclosure, a computer-readable storage medium is provided. The computer-readable storage medium has a computer program stored thereon, the computer program being executable by a processor to implement the method of the first aspect.
[0008]It should be understood that the content described in this content section is not intended to limit the key features or important features of embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easy to understood from the following description.
BRIEF DESCRIPTION OF DRAWINGS
[0009]The above and other features, advantages and aspects of the various embodiments of the present disclosure will become more apparent in combination with the accompanying drawings and with reference to the following detailed description. In the accompanying drawings, the same or similar reference symbols refer to the same or similar elements, wherein:
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
DETAILED DESCRIPTION
[0018]It may be understood that, before the technical solutions disclosed in the embodiments of the present disclosure are used, the types, the usage scope, the usage scenario of personal information involved in the present disclosure, and the like should be notified to the user to obtain the authorization of the user in an appropriate manner according to the relevant laws and regulations.
[0019]For example, in response to receiving an active request from a user, a prompt message is sent to the user to explicitly prompt the user that the operation requested operation by the user will need to obtain and use the user's personal information, so that users may select whether to provide personal information to the software or the hardware such as an electronic device, an application, a server or a storage medium that perform the operation of the technical solution of the present disclosure according to the prompt information.
[0020]As an optional but non-restrictive implementation, in response to receiving the user's active request, the method of sending prompt information to the user may be, for example, a pop-up window in which prompt information may be presented in text. In addition, pop-up windows may also contain selection controls for users to choose “agree” or “disagree” to provide personal information to electronic devices.
[0021]It may be understood that the above notification and acquisition of user authorization process are only schematic and do not limit the implementations of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0022]It may be understood that the data involved in the technical solution (including but not limited to the data itself, the acquisition or use of the data) should follow the requirements of the corresponding laws and regulations and related rules.
[0023]Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the drawings, it would be appreciated that the present disclosure can be implemented in various forms and should not be interpreted as limited to the embodiments described herein. On the contrary, these embodiments are provided for a more thorough and complete understanding of the present disclosure. It would be appreciated that the accompanying drawings and embodiments of the present disclosure are only for the purpose of illustration and are not intended to limit the scope of protection of the present disclosure.
[0024]It should be noted that the title of any section/subsection provided herein is not limited. Various embodiments are described throughout and any type of embodiments may be included in any section/subsection. Furthermore, embodiments described in any one section/subsection may be combined in any manner with any other embodiments described in the same section/subsection and/or different sections/subsections.
[0025]Unless explicitly stated, performing one step “in response to A” does not mean performing the step immediately after “A”, but may include one or more intermediate steps.
[0026]In the description of embodiments of the present disclosure, the term “including” and similar terms may be understood as open inclusion, that is, “including but not limited to”. The term “based on” may be understood as “at least partly based on”. The term “one embodiment” or “the embodiment” may be understood as “at least one embodiment”. The term “some embodiments” may be understood as “at least some embodiments”. Other explicit and implicit definitions may also be included below. The terms “first,” “second,” and the like may refer to different or same objects. Other explicit and implicit definitions may also be included below.
[0027]As used herein, the term “model” may learn an association between respective input and output from training data such, thereby a corresponding output may be generated for a given input after training is complete. The generation of the model may be based on machine learning techniques. Deep learning is a kind of machine learning algorithm that processes inputs and provides corresponding outputs by using a multi-layer processing unit. “Model” may also be referred to as “machine learning model,” “machine learning network,” or “network” herein, and these terms may be used interchangeably herein. One model may further include different types of processing units or networks.
[0028]As used herein, “unit,” “operating unit,” or a “subunit” may be composed of a machine learning model or network of any suitable structure. As used herein, a set of elements or similar expressions may include one or more such elements. For example, “a set of convolution units” may include one or more convolution units.
[0029]
[0030]The electronic device 130 may perform an image edit operation on an initial image 120 according to a text input 110 provided by the user, so as to generate a target image 150 satisfying user requirement. In some embodiments, the initial image 120 may be an image input by the user, or may be an image provided for the user by the electronic device 130. In some embodiments, the initial image 120 may be any one or more frames in the video. The electronic device 130 may adjust image attributes (e.g., contrast, brightness) of the initial image 120 or add, remove, modify image elements, or the like according to user requirement. In some embodiments, in a process of editing the initial image 120, the electronic device 130 first determines an element in the initial image 120 indicated by the text input 110, and then changes the corresponding element in the initial image 120 according to the indication of the text input 110. For example, for the initial image 120 input by the user, if the text input 110 is changing the background of the initial image 120, the background in the initial image 120 is replaced with the background corresponding to the text input 110. If the text input 110 is adding an element in the image, the element that needs to be added is first obtained, and then the element is added to the specified position in the initial image 120.
[0031]In some embodiments, the electronic device 130 may utilize the trained machine learning model 140 to perform image processing tasks. For example, the machine learning model 140 may include, but is not limited to, any suitable model such as a Transformer model, a convolutional neural network (CNN), a recurrent neural network (RNN), and a deep neural network (DNN). The machine learning model 140 may be a local model in the electronic device 130, or may be a model installed on other electronic devices 130 (for example, installed in a remote device).
[0032]The electronic device 130 may include any computing system having computing capabilities, such as various computing devices/systems, terminal devices, server devices, and the like. The terminal device may be any type of mobile terminal, fixed terminal, or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a palmtop computer, a portable game terminal, a VR/AR device, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio/video player, a digital camera/video camera, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a gaming device, or any combination of the foregoing, including accessories and peripherals of these devices, or any combination thereof. The server device may be an independent physical server, or may be a server cluster composed of multiple physical servers, or a distributed system, or may be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks, big data and artificial intelligence platforms and the like. The server device may include, for example, a computing system/server, such as a mainframe, an edge computing node, a computing device in a cloud environment, or the like.
[0033]It should be understood that the structures and functions of the various elements in the environment 100 are described for example purposes only and do not imply any limitation to the scope of the present disclosure.
[0034]As briefly mentioned above, image processing techniques have been applied to various image processing tasks. With the development of image processing techniques, there is a wide demand for image processing tasks in various fields. The user may obtain an image in a content sharing type of application and input the corresponding text to provide an instruction to process the image. For example, changing the hue of the image or replacing any object in the image. Such image may be generated by a terminal device (e.g., a mobile device) installed with a content sharing type of application.
[0035]As an example of image edit, most currently used image edit technologies are implemented based on a diffusion model, and a target image corresponding to a user instruction is obtained by processing a text input and an initial image with a codec. However, the target image may not be accurately edited due to more elements in the initial image. For example, if there is a face element in the initial image, the text input indicate to add the sunglasses to the face element in the initial image. Due to the target to be edited may not be accurately determined in the image edit process, the situation of image information in the initial image being lost may be caused.
[0036]Embodiments of the present disclosure provide a solution for processing image. According to various embodiments of the present disclosure, a text input for an initial image is received, the text input describing a visual effect for the initial image. A fusion feature for the text input and the initial image is generated based on the text input and the initial image. A target image corresponding to the initial image is generated based on a first image feature of the initial image and the fusion feature, the target image having a visual element related to the visual effect.
[0037]In embodiments of the present disclosure, the text input and the initial image are fused, and then the target image matching the text input is generated based on the image feature of the initial image itself and the fusion feature. The desired visual effect can be expressed better with the fused features of text and images. In this way, the accuracy and reliability of image edit can be improved, the loss of information in the initial image can be prevented, and the quality of the generated image can be improved.
[0038]
[0039]In some embodiments, the electronic device 130 may receive the text input 110 for the initial image 120. The text input 110 describes the visual effect for the initial image 120.
[0040]For example, the initial image 120 may be an image provided by a user. The initial image 120 may also be an image provided by the electronic device 130 for the user. For example, in the case of a sharing type of application running in the electronic device 130, the user may select an image posted, shared, or created in the application as the initial image 120.
[0041]With the continue reference to
[0042]In some embodiments, a user may provide the text input 110 to electronic device 130 in the form of text instructions or speech. For example, the text input 110 may be “replacing the black part in the image background with white”. In some embodiments, a user may provide the text input 110 to the electronic device 130 via an interaction icon provided by electronic device 130. The interaction icon indicates different edit operations for the image, and the different edit operations may include, but is not limited to, an “insert” icon configured to add an element to the image and an “insert element” corresponding to the insertion icon, or a “contrast adjustment” icon configured to change image contrast. For example, if the user triggers an “insert” icon and a corresponding “inserting element A” provided by the electronic device 130, the electronic device 130 generates a text input 110 for “inserting the inserting element A into the original image” in response to the user's operation.
[0043]As shown in
[0044]The multimodal model 230 may be any model with text and image representation capabilities, and may be implemented using any suitable network structure. In some embodiments, the image processing system 200 may provide the text input 110 and the initial image 120 as input to the multimodal model 230 to obtain the output of a predetermined intermediate layer of the multimodal model 230. The image processing system 200 may determine an initial feature 241 based on the output of the predetermined intermediate layer. For example, the predetermined intermediate layer may be the second to the last layer of the multimodal model 230.
[0045]
[0046]In some embodiments, the fusion feature 241 may be determined directly with the multimodal model 230. Such obtained fusion feature 241 may be provided into a subsequent diffusion model 270.
[0047]In some embodiments, in order to further ensure that the generated target image satisfies the text input, both the fusion feature and the text feature of the text input may need to participate in the process of generating the target image. In this case, it is necessary to match the feature space of the generated fusion feature with the encoded feature space of the text input, e.g., having the same distribution feature. To this end, in some embodiments, the image processing system 200 may determine an initial feature for fusing the text input 110 and the initial image 120 based on the text input 110 and the initial image 120. The image processing system 200 may then determine the fusion feature 241 by converting the initial feature into an initial feature that has a dimension matching the text encoding.
[0048]As shown in
[0049]Any suitable network structure may be employed to implement the feature conversion model 240. In some embodiments, an attention mechanism may be utilized to convert the initial features output by the multimodal model 230 to determine the fusion feature 241. That is, the feature conversion model 240 may be a model based on the attention mechanism. For example, the feature conversion model 240 may determine a key feature and a value feature for the attention mechanism based on the initial feature. Subsequently, the feature conversion model 240 may determine the fusion feature 241 with the attention mechanism based on the key feature, the value feature, and a predetermined query features. For example, the query feature may be determined in a training process.
[0050]Example implementations of text and image fusion branches are described above. At the image branch, the initial image 120 may be encoded or feature extracted to obtain a first image feature 222 of the initial image 120. In some embodiments, as shown in
[0051]In some embodiments, the image processing system 200 may generate the target image 150 corresponding to the initial image 120 based on the first image feature 222 of the initial image 120 and the fusion feature 241. The target image 150 has a visual element related to visual effect. The visual element in the target image 150 corresponds to the text input 110.
[0052]As mentioned above, in some embodiments, the text feature of the text input and the fusion feature may both participate in the process of generating the target image. In this case, the image processing system 200 may include a branch for text processing. The text feature obtained by the text branch may further be combined or merged with the fusion feature 241. As shown in
[0053]In some embodiments, as shown in
[0054]The fusion feature 241 or the updated fusion feature 251 may be used by the diffusion model 270 in any suitable way. In some embodiments, the fusion feature 241 or the updated fusion feature 251 may be injected into each layer of the diffusion model 270 through an attention mechanism.
[0055]In some embodiments, as much image information as possible in the initial image 120 needs to be input into the diffusion model 270, to prevent the loss of image information that affects the quality of the generated target image 150. Accordingly, the process of generating the target image 150 may be controlled with the initial image 120. As shown in
[0056]In some embodiments, the diffusion model 270 may generate the target image 150 by using the fusion feature 241 (or the updated fused feature 251) and the second image feature 261 as a control condition. As shown in
[0057]An example implementation of the image processing system 200 is described above with reference to
[0058]One example scenario is described below with continued reference to
[0059]For example, the second image feature 261 and the updated fusion feature 251 may be used as a control condition to generate image encoding based on the first image feature 222 with the diffusion model 270. Subsequently, the target image 150 is generated from the image encoding with the image decoder 280.
[0060]Example embodiments of the image processing system 200 generating the target image are described above. An example embodiment of training the image processing system 200 is described below. To train the image processing system 200, a corresponding training data set may be constructed. As an example, a plurality of initial images may be obtained, for example, obtained from any existing training image set. In addition, an element with some visual effect may be added to the initial image with the rendering effect included in the image rendering tool (e.g., adding a firework effect) or some elements in the initial image are modified to another visual effect (e.g., modifying the color of the flower from red to yellow). Thus, an updated image corresponding to the initial image may be obtained, and a corresponding text description may be generated according to the used rendering effect. In this way, a training sample as following may be obtained, the training sample includes an initial image, a text description, and an updated image as a label or a ground truth.
[0061]During the training process, the image processing system 200 may generate a corresponding image based on the initial image and the text description in the training sample. According to on the difference between the generated image and the updated image in the training sample, a loss may be determined, thereby updating parameters of at least a part of the models in the image processing system 200.
[0062]It can be seen that, in embodiments of the present disclosure, in one aspect, a target image having a related visual element corresponding to the initial image is generated based on the first image feature of the initial image and the fusion feature for the text input and the initial image. In this way, the elements related to the text input in the initial image can be more accurately expressed by fusing the text and the image, thereby improving the accuracy and reliability of the image edit. In another aspect, the second image feature and the fusion feature generated by the control model are used as the condition control to generate the target image, to prevent the loss of information in the initial image, thereby further improving the quality of the edited target image. In a further aspect, the initial image and the random noise signal are input into the image encoder, so that the diversity of the input image is improved, and the quality of the target image is improved.
[0063]
[0064]At block 610, a text input for an initial image is received, the text input describing a visual effect for the initial image.
[0065]At block 620, a fusion feature for the text input and the initial image are generated based on the text input and the initial image.
[0066]In some embodiments, generating the fusion feature for the text input and the initial image comprises: determining, based on the text input and the initial image, an initial feature for fusing the text input and the initial image; and determining the fusion feature by converting the initial feature into an initial feature that has a dimension matching the text encoding.
[0067]At block 630, a target image corresponding to the initial image is generated based on a first image feature of the initial image and the fusion feature, the target image having a visual element related to the visual effect.
[0068]In some embodiments, determining the fusion feature by converting the initial feature into the initial feature that has the dimension matching the text encoding comprises: determining, based on the initial feature, a key feature and a value feature for an attention mechanism; and determining, based on the key feature, the value feature, and a predetermined query feature, the fusion feature with the attention mechanism.
[0069]In some embodiments, the first image feature of the initial image is determined by: generating, based on the initial image and a noise signal, the first image feature with an image encoder.
[0070]In some embodiments, generating the target image corresponding to the initial image comprises: generating, based on the initial image, a second image feature of the initial image with a control model; and generating the target image based on the first image feature, the second image feature, and the fusion feature.
[0071]In some embodiments, generating the target image based on the first image feature, the second image feature, and the fusion feature comprises: generating, based on the first image feature, the target image by using the second image feature and the fusion feature as a control condition.
[0072]In some embodiments, the process 600 further includes, before generating the target image based on the first image feature and the fusion feature, generating, based on the text input, a text encoding corresponding to the text input with a text encoder; and updating the fusion feature with the text encoding.
[0073]
[0074]As shown in the figure, the apparatus 700 includes a receiving module 710 configured to receive a text input for an initial image, the text input describing a visual effect for the initial image. The apparatus 700 further includes a first generating module 720 configured to generate, based on the text input and the initial image, a fusion feature for the text input and the initial image. The apparatus 700 further includes a second generating module 730 configured to generate, based on a first image feature of the initial image and the fusion feature, a target image corresponding to the initial image, the target image having a visual element related to the visual effect.
[0075]In some embodiments, the second generating module 730 is further configured to generate, based on the text input, a text encoding corresponding to the text input with a text encoder; obtain an updated fusion feature by performing a feature fusion operation on the text encoding and the fusion feature; and generate a target image based on the updated fusion feature and the initial image.
[0076]In some embodiments, the second generating module 730 is further configured to determine, based on the initial feature, a key feature and a value feature for an attention mechanism; and determine, based on the key feature, the value feature, and a predetermined query feature, the fusion feature with the attention mechanism.
[0077]In some embodiments, the second generating module 730 is further configured to generate, based on the initial image and a noise signal, the first image feature with an image encoder.
[0078]In some embodiments, the second generation module 730 is further configured to generate, based on the initial image, a second image feature of the initial image with a control model; and generate the target image based on the first image feature, the second image feature, and the fusion feature.
[0079]In some embodiments, the second generating module 730 is further configured to generate, based on the first image feature, the target image by using the second image feature and the fusion feature as a control condition.
[0080]In some embodiments, the apparatus 700 further includes an updating module configured to before generating the target image based on the first image feature and the fusion feature, generate, based on the text input, a text encoding corresponding to the text input with a text encoder; and update the fusion feature with the text encoding.
[0081]
[0082]As shown in
[0083]The electronic device 800 typically includes a plurality of computer storage media. Such media can be any available media that is accessible to the electronic device 800, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 820 can be volatile memory (such as registers, caches, random access memory (RAM)), nonvolatile memory (such as a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory), or some combination thereof. The storage device 830 can be any removable or non-removable medium, and can include machine-readable medium, such as a flash drive, a disk, or any other medium which can be used to store information and/or data and can be accessed within the electronic device 800.
[0084]The electronic device 800 may further include additional removable/non-removable, volatile/non-volatile storage medium. Although not shown in
[0085]The communication unit 840 implements communication with other electronic devices via a communication medium. In addition, functions of components in the electronic device 800 may be implemented by a single computing cluster or multiple computing machines, and these computing machines can communicate through a communication connection. Therefore, the electronic device 800 may be operated in a networking environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0086]The input device 850 may be one or more input devices, such as a mouse, a keyboard, a trackball, etc. The output device 860 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 800 may also communicate with one or more external devices (not shown) through the communication unit 840 as required. The external device, such as a storage device, a display device, etc., communicate with one or more devices that enable users to interact with the electronic device 800, or communicate with any device (for example, a network card, a modem, etc.) that enables the electronic device 800 communicate with one or more other electronic devices. Such communication may be executed via an input/output (I/O) interface (not shown).
[0087]According to example implements of the present disclosure, there is provided a computer-readable storage medium having computer-executable instructions stored thereon, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to example implements of the present disclosure, a computer program product is further provided, the computer program product being tangibly stored on a non-transitory computer-readable medium and including computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.
[0088]Various aspects of the present disclosure are described herein with reference to flowcharts and/or block diagrams of the method, the device, the apparatus and the computer program product implemented in accordance with the present disclosure. It should be understood that each block of the flowchart and/or the block diagram, and the combinations of each blocks in the flowcharts and/or block diagrams may be implemented by computer readable program instructions.
[0089]These computer-readable program instructions may be provided to the processing units of general-purpose computers, special computers or other programmable data processing devices to produce a machine that generates a device to implement the functions/acts specified in one or more blocks in the flow chart and/or the block diagram when these instructions are executed through the processing units of the computer or other programmable data processing devices. These computer-readable program instructions may also be stored in a computer-readable storage medium. These instructions enable a computer, a programmable data processing device and/or other devices to work in a specific way. Therefore, the computer-readable medium containing the instructions includes a product, which includes instructions to implement various aspects of the functions/acts specified in one or more blocks in the flowchart and/or the block diagram.
[0090]The computer-readable program instructions may be loaded onto a computer, other programmable data processing apparatus, or other devices, so that a series of operational steps can be performed on a computer, other programmable data processing apparatus, or other devices, to generate a computer-implemented process, such that the instructions which execute on a computer, other programmable data processing apparatus, or other devices implement the functions/acts specified in one or more blocks in the flowchart and/or the block diagram.
[0091]The flowchart and the block diagram in the drawings show the possible architecture, functions and operations of the system, the method and the computer program product implemented in accordance with the present disclosure. In this regard, each block in the flowchart or the block diagram may represent a part of a module, a program segment or instructions, which contains one or more executable instructions for implementing the specified logic function. In some alternative implementations, the functions marked in the block may also occur in a different order from those marked in the drawings. For example, two consecutive blocks may actually be executed in parallel, and sometimes can also be executed in a reverse order, depending on the function involved. It should also be noted that each block in the block diagram and/or the flowchart, and combinations of blocks in the block diagram and/or the flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or acts, or by the combination of dedicated hardware and computer instructions.
[0092]Various implementations of the present disclosure has been described above. The above description is example, not exhaustive, and is not limited to the disclosed implementations. Without departing from the scope and spirit of the described implementations, many modifications and changes are obvious to ordinary skilled in the art. The selection of terms used in this article aims to best explain the principles, practical application or improvement of technology in the market of each implementation, or to enable other ordinary skilled in the art to understand the various embodiments disclosed herein.
Claims
What is claimed is:
1. An image processing method, comprising:
receiving a text input for an initial image, the text input describing a visual effect for the initial image;
generating, based on the text input and the initial image, a fusion feature for the text input and the initial image; and
generating, based on a first image feature of the initial image and the fusion feature, a target image corresponding to the initial image, the target image having a visual element related to the visual effect.
2. The method of
before generating the target image based on the first image feature and the fusion feature,
generating, based on the text input, a text encoding corresponding to the text input with a text encoder; and
updating the fusion feature with the text encoding.
3. The method of
determining, based on the text input and the initial image, an initial feature for fusing the text input and the initial image; and
determining the fusion feature by converting the initial feature into an initial feature that has a dimension matching the text encoding.
4. The method of
determining, based on the initial feature, a key feature and a value feature for an attention mechanism; and
determining, based on the key feature, the value feature, and a predetermined query feature, the fusion feature with the attention mechanism.
5. The method of
providing the text input and the initial image as input to a multimodal model to obtain an output of a predetermined intermediate layer of the multimodal model; and
determining the initial feature based on the output of the predetermined intermediate layer.
6. The method of
generating, based on the initial image, a second image feature of the initial image with a control model; and
generating the target image based on the first image feature, the second image feature, and the fusion feature.
7. The method of
generating, based on the first image feature, the target image by using the second image feature and the fusion feature as a control condition.
8. The method of
generating, based on the initial image and a noise signal, the first image feature with an image encoder.
9. An electronic device, comprising:
at least one processor; and
at least one memory, the at least one memory being coupled to the at least one processor and storing instructions for execution by the at least one processor, the instructions, when executed by the at least one processor, causing the electronic device to perform acts comprising:
receiving a text input for an initial image, the text input describing a visual effect for the initial image;
generating, based on the text input and the initial image, a fusion feature for the text input and the initial image; and
generating, based on a first image feature of the initial image and the fusion feature, a target image corresponding to the initial image, the target image having a visual element related to the visual effect.
10. The electronic device of
before generating the target image based on the first image feature and the fusion feature,
generating, based on the text input, a text encoding corresponding to the text input with a text encoder; and
updating the fusion feature with the text encoding.
11. The electronic device of
determining, based on the text input and the initial image, an initial feature for fusing the text input and the initial image; and
determining the fusion feature by converting the initial feature into an initial feature that has a dimension matching the text encoding.
12. The electronic device of
determining, based on the initial feature, a key feature and a value feature for an attention mechanism; and
determining, based on the key feature, the value feature, and a predetermined query feature, the fusion feature with the attention mechanism.
13. The electronic device of
providing the text input and the initial image as input to a multimodal model to obtain an output of a predetermined intermediate layer of the multimodal model; and
determining the initial feature based on the output of the predetermined intermediate layer.
14. The electronic device of
generating, based on the initial image, a second image feature of the initial image with a control model; and
generating the target image based on the first image feature, the second image feature, and the fusion feature.
15. The electronic device of
generating, based on the first image feature, the target image by using the second image feature and the fusion feature as a control condition.
16. The electronic device of
generating, based on the initial image and a noise signal, the first image feature with an image encoder.
17. A non-transitory computer-readable storage medium having a computer program stored thereon, the computer program being executable by a processor to perform acts comprising:
receiving a text input for an initial image, the text input describing a visual effect for the initial image;
generating, based on the text input and the initial image, a fusion feature for the text input and the initial image; and
generating, based on a first image feature of the initial image and the fusion feature, a target image corresponding to the initial image, the target image having a visual element related to the visual effect.
18. The non-transitory computer-readable storage medium of
before generating the target image based on the first image feature and the fusion feature,
generating, based on the text input, a text encoding corresponding to the text input with a text encoder; and
updating the fusion feature with the text encoding.
19. The non-transitory computer-readable storage medium of
determining, based on the text input and the initial image, an initial feature for fusing the text input and the initial image; and
determining the fusion feature by converting the initial feature into an initial feature that has a dimension matching the text encoding.
20. The non-transitory computer-readable storage medium of
determining, based on the initial feature, a key feature and a value feature for an attention mechanism; and
determining, based on the key feature, the value feature, and a predetermined query feature, the fusion feature with the attention mechanism.