Image generation methods, apparatus, electronic devices and media
By fusing image and temporal feature vectors and using a diffusion model for denoising, the problems of long inference time and information loss in existing technologies are solved, achieving efficient and accurate image style transfer and synthesis.
Patent Information
- Application Number
- CN202411658187.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-11-19
AI Technical Summary
Existing image generation methods have long inference times and may lose important information during feature extraction.
By acquiring the image to be identified, the prompt text, and the prompt style image, the image feature vector and the temporal feature vector are fused and processed, and a diffusion model is used for denoising to generate the target image.
It improves the accuracy and consistency of style transfer, reduces inference time, is suitable for real-time image style transfer, and supports image-driven and text-driven stylized compositing.
Smart Images

Figure CN119600139B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image generation technology, and in particular to an image generation method, apparatus, electronic device and medium. Background Technology
[0002] With the rapid development of internet technology, diffusion models have made significant progress in image generation, reigniting interest in image style transfer technology. To address this issue, researchers have proposed an end-to-end trained style transfer model. This model explicitly distinguishes between content and style features through an independent feature injection mechanism, thereby achieving more efficient style transfer. This unified framework not only supports image-driven style transfer but also extends to text-driven and text-editing-driven stylized synthesis, demonstrating its diverse application potential. However, existing methods, such as DDIM-based inversion or adjustment of pre-trained IP-Adapter feature injection layers, and inversion of content and style images, while effectively extracting features and injecting them into specific layers, often lead to increased inference time and may lose important information during feature extraction.
[0003] Therefore, an image generation method is provided to address these shortcomings. Summary of the Invention
[0004] In view of this, the present disclosure provides an image generation method, apparatus, electronic device, and computer-readable storage medium to solve the technical problems of long inference time and potential loss of important information during feature extraction in existing image generation methods.
[0005] A first aspect of this disclosure provides an image generation method, comprising: acquiring an image to be recognized, prompt text, and a prompt style image; fusing the image feature vector of the prompt style image and the temporal feature vector of a preset time step to obtain a temporal style fusion feature vector of the prompt style image; determining a style fusion feature vector of the prompt style image based on the image feature vector of the prompt style image; fusing the image feature vectors of the image to be recognized and the prompt style image to obtain an initial style feature vector of the image to be recognized; determining a target feature vector of the image to be recognized based on the image feature vector of the image to be recognized; and performing denoising processing on a noise map using a diffusion model based on the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be recognized, and the target feature vector of the image to be recognized to obtain a target image.
[0006] A second aspect of this disclosure provides an image generation apparatus, comprising: an acquisition module for acquiring an image to be recognized, a prompt text, and a prompt style image; a first fusion module for fusing the image feature vector of the prompt style image and the temporal feature vector of a preset time step to obtain a temporal style fusion feature vector of the prompt style image; a first determination module for determining a style fusion feature vector of the prompt style image based on the image feature vector of the prompt style image; a second fusion module for fusing the image feature vectors of the image to be recognized and the prompt style image to obtain an initial style feature vector of the image to be recognized; a second determination module for determining a target feature vector of the image to be recognized based on the image feature vector of the image to be recognized; and a generation module for denoising a noisy image using a diffusion model based on the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be recognized, and the target feature vector of the image to be recognized to obtain a target image.
[0007] A third aspect of this disclosure provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method described above.
[0008] A fourth aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above-described method.
[0009] The beneficial effects of this disclosure compared to existing technologies are as follows: This disclosure can effectively capture style information in the time dimension by fusing the image feature vector of the prompt style image with the time feature vector of a preset time step, thereby improving the diversity and flexibility of style conversion. By independently determining the style fusion feature vector of the prompt style image, the extraction of style information is clearer, thus improving the accuracy and consistency of style conversion. The initial style feature vector obtained by fusing the image feature vectors of the image to be recognized and the prompt style image can better reflect the style requirements of the image to be recognized, enhancing the quality of the generated results. By using a diffusion model to denoise the noise map and combining it with the semantic feature vector of the prompt text, the content information of the image can be effectively preserved, while stylized synthesis is achieved, ensuring that the generated target image not only meets the style requirements but also has good visual effects. This method optimizes the computation process in the feature injection and fusion process, reduces inference time, and is more practical than traditional methods. It is suitable for real-time image style conversion scenarios. In addition, this method not only supports image-driven style conversion but also can handle text-driven and text-editing-driven stylized synthesis, further expanding the application scope and meeting the needs of different users. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of embodiments of the present invention can be applied is shown;
[0012] Figure 2 This is a schematic flowchart of an image generation method provided in an embodiment of this disclosure;
[0013] Figure 3 This is a schematic diagram of the application framework of the image generation method provided in the embodiments of this disclosure;
[0014] Figure 4 This is a schematic diagram of the framework of the first half of the sub-modules in the diffusion module provided in the embodiments of this disclosure;
[0015] Figure 5 This is a schematic diagram of the framework of the latter half of the sub-module in the diffusion module provided in the embodiments of this disclosure;
[0016] Figure 6 This is a block diagram of an image generation apparatus provided in an embodiment of this disclosure;
[0017] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0018] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, so as to provide a thorough understanding of the embodiments of this disclosure. However, those skilled in the art will understand that this disclosure may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this disclosure with unnecessary detail.
[0019] It should be noted that the user information (including but not limited to terminal device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0020] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of embodiments of the present invention can be applied is shown.
[0021] like Figure 1 As shown, the system architecture 100 may include one or more of a first terminal device 101, a second terminal device 102, and a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0022] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, there can be any number of terminal devices, networks, and servers. For example, server 105 could be a server cluster composed of multiple servers.
[0023] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send data, etc. The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays, including but not limited to smartphones, tablets, laptops, and desktop computers, etc.
[0024] Server 105 can be a server providing various services. For example, server 105 can acquire the image to be recognized, the prompt text, and the prompt style image from the first terminal device 103 (or the second terminal device 102 or the third terminal device 103); it can fuse the image feature vector of the prompt style image and the temporal feature vector of a preset time step to obtain the temporal style fusion feature vector of the prompt style image; it can determine the style fusion feature vector of the prompt style image based on the image feature vector of the prompt style image; it can fuse the image feature vectors of the image to be recognized and the prompt style image to obtain the initial style feature vector of the image to be recognized; it can determine the target feature vector of the image to be recognized based on the image feature vector of the image to be recognized; and it can perform denoising processing on the noise map using a diffusion model based on the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be recognized, and the target feature vector of the image to be recognized to obtain the target image.
[0025] In some embodiments, the image generation method provided by the present invention is generally executed by server 105, and correspondingly, the image generation device is generally disposed in server 105. In other embodiments, certain terminal devices may have functions similar to those of the server to execute this method. Therefore, the image generation method provided by the present invention is not limited to execution on the server side.
[0026] The image generation method and apparatus according to embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings.
[0027] Figure 2 This is a schematic flowchart of an image generation method provided in an embodiment of this disclosure. The method provided in this embodiment can be executed by any electronic device with computer processing capabilities, such as an electronic device that can be... Figure 1 The server shown.
[0028] like Figure 2 As shown, the image generation method includes steps S210 to S260.
[0029] In step S210, the image to be recognized, the prompt text, and the prompt style image are acquired.
[0030] Step S220: The image feature vector of the prompt style image and the temporal feature vector of the preset time step are fused to obtain the temporal style fused feature vector of the prompt style image.
[0031] In step S230, the style fusion feature vector of the cue style image is determined based on the image feature vector of the cue style image.
[0032] In step S240, the image feature vectors of the image to be recognized and the prompt style image are fused to obtain the initial style feature vector of the image to be recognized.
[0033] In step S250, the target feature vector of the image to be identified is determined based on the image feature vector of the image to be identified.
[0034] In step S260, the noise map is denoised using a diffusion model based on the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be identified, and the target feature vector of the image to be identified, to obtain the target image.
[0035] This method effectively captures style information over time by fusing the image feature vector of the cue style image with the temporal feature vector at a preset time step, enhancing the diversity and flexibility of style transfer. By independently determining the style fusion feature vector of the cue style image, the extraction of style information becomes clearer, thereby improving the accuracy and consistency of style transfer. The initial style feature vector obtained by fusing the image feature vectors of the image to be recognized and the cue style image better reflects the style requirements of the image to be recognized, enhancing the quality of the generated results. Denoising the noise map using a diffusion model, combined with the semantic feature vector of the cue text, effectively preserves the image's content information while achieving stylized synthesis, ensuring that the generated target image meets both style requirements and has good visual effects. This method optimizes the computation process during feature injection and fusion, reducing inference time and making it more practical than traditional methods. It is suitable for real-time image style transfer scenarios. Furthermore, this method not only supports image-driven style transfer but also handles text-driven and text-editing-driven stylized synthesis, further expanding its application scope and meeting the needs of different users.
[0036] In some embodiments of this disclosure, the image to be identified is the original image that requires style transfer, and it can be any type of entity reference image. This image typically contains content information that is desired to be retained in the final generated image. For example, a landscape photo, a portrait, or a still life image. The content features of the image to be identified serve as a basis to help the generated image maintain consistency with the original image in terms of form and structure. The cue text is textual information used to describe the form, posture, and other content of entity objects in the final generated image. It provides semantic guidance to the generation model, helping to define the features that the generated image should possess. For example, the cue text could be "A girl in a red dress is dancing on the beach" or "A lonely tree in a sunny valley." These descriptions provide a specific semantic framework for the generation process, enabling the model to understand and generate image content that meets expectations. The cue style image is a style reference image used to replace the style in the image to be identified. It provides the required visual style features to help the generated image distinguish itself stylistically from the image to be identified. For example, an Impressionist painting, a modern artwork, or an image of a specific art style (such as a watercolor painting, an oil painting, etc.). Features from the cue style image are extracted and applied to the image to be recognized, thereby achieving style transfer and ensuring that the final generated image visually conforms to the selected style. Through the combination of these three elements—the image to be recognized providing the content foundation, the cue text providing semantic guidance, and the cue style image providing a style reference—efficient and accurate image style transfer is achieved. This multimodal input method allows the generated image to retain the structure of the original image while possessing a new artistic style, meeting the user's personalized needs.
[0037] refer to Figure 3The prompt text is a user-provided text description that guides the generation of the image's content and features. These descriptions can include information such as the object's shape, color, action, and environment. A text encoder (such as BERT or GPT, a natural language processing model) processes the prompt text. The text encoder transforms natural language text into high-dimensional feature vectors, capturing semantic information. After encoding, the prompt text's feature vector (i.e., text features) contains semantic features related to the text content. These feature vectors are used in the generation model to ensure the final image matches the user's description. The preset time step (usually denoted as time step t) is a key parameter in the generation process, representing a specific stage or state of the model when generating the image. Features are extracted from the preset time step using a multilayer perceptron (MLP). MLPs extract features from the input data through multilayer nonlinear transformations. After MLP processing, the resulting feature vector for the preset time step contains dynamic feature information related to that time step. These feature vectors help the model consider the impact of time variations on image style during generation. The prompt style image is an image used to provide style references, typically an image with a specific artistic style (such as Impressionist paintings or modern artworks). Image encoders (such as convolutional neural networks, CNNs) are used to process cue-style images. Image encoders extract visual features from images, including color, texture, and shape. After encoding, the resulting cue-style image feature vector contains style-related visual features. These features are used to introduce the target style during generation, ensuring the final generated image reflects the artistic characteristics of the cue-style image. By extracting features from the cue text, preset time steps, and cue-style images, information from different modalities can be effectively integrated. This integration not only enhances the generative model's understanding of user needs but also improves the expressiveness of the generated image in terms of content and style, ensuring the final result both matches the user's description and possesses the desired artistic style.
[0038] In some embodiments of this disclosure, fusing the image feature vector of the prompt style image and the temporal feature vector of a preset time step to obtain the temporal style fusion feature vector of the prompt style image includes: processing the image feature vector of the prompt style image through a first multilayer perceptron to obtain an adapted style image feature vector; and adding the temporal feature vector of the preset time step and the adapted style image feature vector to obtain the temporal style fusion feature vector of the prompt style image.
[0039] refer to Figure 3The cue style image feature vector, typically a high-dimensional feature vector extracted by an image encoder, contains information such as color, texture, and shape of the style image. The first multilayer perceptron (MLP1) processes the cue style image feature vector to adapt it to the desired style image feature vector. For example, MLP1 learns a deeper representation of style features through multilayer nonlinear transformations. This process includes scaling, translation, and nonlinear activation of the features to make the feature vector more suitable for subsequent fusion operations. The temporal feature vector at a preset time step is typically a dynamic feature related to the time step extracted by the MLP. This feature vector contains time-related change information, reflecting the dynamic characteristics the image should possess at a specific time step. The adapted style image feature vector is added to the temporal feature vector at the preset time step. This process can be seen as a weighted combination of two different features, aiming to effectively combine style and temporal features. Through the addition operation, the resulting temporal style fusion feature vector of the cue style image will simultaneously contain the visual features of the style image and the dynamic features of the time step. This fusion of feature vectors provides rich information for subsequent image generation, ensuring that the generated images meet expectations in both style and dynamics. By fusing the image feature vectors of the cue-style image with the temporal feature vectors at a preset time step, images with rich style and dynamic features can be generated. This process not only improves the quality and expressiveness of the generated images but also enhances the model's adaptability to user needs, ensuring that the generated results better meet the user's personalized expectations.
[0040] In some embodiments of this disclosure, determining the style fusion feature vector of the prompt style image based on the image feature vector of the prompt style image includes: processing the image feature vector of the prompt style image through a first multilayer perceptron to obtain an adapted style image feature vector; and performing cross-attention processing on the adapted style image feature vector to obtain the style fusion feature vector of the prompt style image.
[0041] refer to Figure 3The image feature vector of the cue style image is processed by MLP1 to obtain the adapted style image feature vector. The adapted style image feature vector is then processed by the learnable style cross-attention module 2 to obtain the style fusion feature vector of the cue style image. For example, the image feature vector of the cue style image is extracted by the image encoder and contains visual information such as color, texture, and shape. MLP1 can consist of multiple fully connected layers, each typically containing an activation function (such as ReLU or Leaky ReLU) to introduce non-linearity. MLP1 transforms and adapts the input image feature vector. This process includes: adjusting the scale of the features to make them more suitable for subsequent processing; highlighting important features and suppressing irrelevant features through weight learning; and introducing non-linearity to enable the model to capture more complex feature relationships. After processing by MLP1, the resulting adapted style image feature vector will better meet the needs of subsequent fusion operations. The learnable style cross-attention module (Style Cross-Attention Module 2) is a network structure based on an attention mechanism, designed to enhance feature representation by focusing on the relationships between different features. This module incorporates information from other features (such as textual or temporal features) into the adapted style image feature vector, enabling feature interaction and fusion. By calculating the similarity between features, the module dynamically adjusts feature importance, highlighting features relevant to the current task. The calculation process involves: calculating the similarity between input features, typically using dot product or cosine similarity; generating attention weights based on the similarity to represent the importance of different features; applying these attention weights to the input features to generate a weighted feature representation; and finally, after processing by the cross-attention module, the resulting style fusion feature vector of the cue-style image contains rich style information and contextual relevance, better reflecting the target style. By adapting the image feature vector of the cue-style image using MLP1 and further processing it through a learnable style cross-attention module, the final style fusion feature vector effectively integrates information from different features. This process not only enhances the style expressiveness of the image but also improves the model's understanding of complex relationships, providing strong feature support for subsequent image generation.
[0042] In some embodiments of this disclosure, fusing the image feature vectors of the image to be identified and the cue style image to obtain an initial style feature vector of the image to be identified includes: extracting style semantics from the image feature vector of the cue style image to obtain a style semantic feature vector of the cue style image; processing the image feature vector of the cue style image through a first multilayer perceptron to obtain an adapted style image feature vector; and processing the style semantic feature vector of the cue style image, the adapted style image feature vector, and the image to be identified through a control network to obtain an initial style feature vector of the image to be identified.
[0043] refer to Figure 3The BLIP-Qformer extracts style semantics from the image feature vectors of the cue-style image, resulting in a style semantic feature vector. MLP1 processes this feature vector to obtain an adapted style image feature vector. A learnable style cross-attention module 1 then processes the adapted feature vector to obtain a cross-attention vector. The entity reference image, the style semantic feature vector of the cue-style image, and the cross-attention vector are then input into a control network for processing, yielding the initial style feature vector of the image to be recognized. For example, the BLIP-Qformer is a model that combines visual and linguistic features, enabling the extraction of semantic information from images through multimodal learning. The image feature vector of the cue-style image is typically a high-dimensional feature representation obtained through an image encoder. The BLIP-Qformer analyzes these image features to identify style-related semantic information. This process involves understanding the image content, such as object recognition, scene analysis, and style feature induction. After processing by the BLIP-Qformer, the resulting style semantic feature vector of the cue-style image will contain rich style semantic information, reflecting the image's style characteristics and context. The MLP1 algorithm processes the image feature vector of the cue style image, transforming the input features through multiple fully connected layers to adapt to subsequent processing requirements. Features are adjusted to achieve greater numerical balance and highlight important features. Non-linearity is introduced through activation functions to enhance the model's expressive power. The resulting adapted style image feature vector is ready for further processing. The learnable style cross-attention module 1, based on an attention mechanism, aims to enhance feature representation by modeling the relationships between different features. This module processes the adapted style image feature vector. The processing steps include: calculating the similarity between the input features and other relevant features (such as style semantic features); generating attention weights based on similarity to represent the importance of different features; applying these attention weights to the adapted style image feature vector to generate a cross-attention vector; and fusing style image features with information from other modalities to enhance the contextual relevance of the features. The network's processing is controlled by input features including an entity reference image, the style semantic feature vector of the cue style image, and the cross-attention vector. The entity reference image is a user-provided reference image containing the desired style or content features. The style semantic feature vector of the style image is extracted from the style semantic features of the BLIP-Qformer. The cross-attention vector is a feature obtained from the learnable style cross-attention module 1. The control network is a network structure used to integrate and regulate input features, aiming to generate feature representations that meet specific needs. Specifically, the input entity reference map, style semantic feature vector, and cross-attention vector are processed together.The network's learning capabilities are leveraged to adjust the features, ensuring that the generated feature vectors accurately reflect the style requirements of the image to be recognized. After processing by the control network, an initial style feature vector for the image to be recognized is obtained, which will serve as the basis for subsequent generation processes.
[0044] Style semantic features are extracted using BLIP-Qformer, style image features are adapted using MLP1, and cross-attention vectors are generated through a learnable style cross-attention module 1. Finally, these features are input into the control network for processing, resulting in the initial style feature vector of the image to be recognized. This series of steps ensures the effective fusion of different features, enabling the generated feature vector to accurately reflect the user's style requirements and image content, providing strong support for subsequent image generation.
[0045] In some embodiments of this disclosure, determining the target feature vector of the image to be identified based on the image feature vector of the image to be identified includes: processing the image feature vector of the image to be identified through a second multilayer perceptron to obtain an adapted entity image feature vector; and performing cross-attention processing on the adapted entity image feature vector to obtain the target feature vector of the image to be identified.
[0046] refer to Figure 3The process begins by encoding the entity reference image using an image encoder to obtain the image feature vector of the image to be recognized. A second multilayer perceptron (MLP2) then processes this image feature vector to obtain a adapted entity image feature vector. A learnable content cross-attention module then performs cross-attention processing on the adapted entity image feature vector to obtain the target features of the image to be recognized. For example, an image encoder is a neural network model designed to convert an input image into a high-dimensional feature vector, capturing the visual information of the image. The entity reference image, typically a user-provided image, contains the content features that the image to be recognized should possess. The image encoder processes the input image using structures such as convolutional layers and pooling layers to extract information such as color, texture, and shape. After encoding, the resulting image feature vector of the image to be recognized is obtained; it is usually a high-dimensional vector that effectively represents the main visual features of the image. The MLP2 then processes this image feature vector. For example, MLP2 consists of multiple fully connected layers and includes activation functions (such as ReLU or Sigmoid) to introduce non-linearity. Specifically, the input feature vector is transformed to better adapt to subsequent processing requirements. The learned weights highlight important features and suppress redundant information. After MLP2 processing, an adapted entity image feature vector is obtained, which prepares for subsequent cross-attention processing. The learnable content cross-processing module is a network structure that utilizes an attention mechanism to enhance feature representation by focusing on the relationships between different features. This module calculates the similarity between the adapted entity image features and other relevant features (such as style features or contextual information). Attention weights are generated based on the similarity to represent the importance of different features. The attention weights are applied to the adapted entity image feature vector to generate a weighted feature representation. After processing by the content cross-processing module, the target features of the image to be recognized will integrate multiple information and effectively reflect the content features of the image to be recognized.
[0047] The entity reference image is encoded using an image encoder to generate an image feature vector for the image to be recognized. Next, a second multilayer perceptron (MLP2) is used to adapt this feature vector, resulting in an adapted entity image feature vector. Finally, a learnable content cross-attention module is used to generate the target features of the image to be recognized. This series of steps ensures effective feature extraction and fusion, providing strong support for subsequent image generation or recognition processes.
[0048] In some embodiments of this disclosure, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be identified, and the target feature vector of the image to be identified, obtained by the above method, are input into the diffusion model.
[0049] refer to Figure 3 The diffusion model can contain at least two sub-modules, such as a first-part module and a second-part module, where one or more sub-modules can be configured within each module. Taking a single sub-module as an example, the input to the first-part module is a noise map, the semantic feature vector of the cue text, the temporal style fusion feature vector of the cue-style image, and the target feature vector of the image to be recognized. The input to the second-part module is a first fusion feature vector, the semantic feature vector of the cue text, the temporal style fusion feature vector of the cue-style image, the style fusion feature vector of the cue-style image, and the initial style feature vector of the image to be recognized.
[0050] Based on the aforementioned embodiments, the target image is obtained by denoising the noise map using a diffusion model based on the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be identified, and the target feature vector of the image to be identified. This process includes: fusing the noise map, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, and the target feature vector of the image to be identified to obtain a first fused feature vector; fusing the first fused feature vector, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, and the initial style feature vector of the image to be identified to obtain a second fused feature vector; and generating the target image based on the second fused feature vector.
[0051] In some embodiments of this disclosure, the first fused feature vector is obtained by fusing the noise map, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, and the target feature vector of the image to be identified. This process includes: performing self-attention processing on the noise map to obtain a self-attention feature vector; performing text cross-attention processing on the self-attention feature vector and the semantic feature vector of the prompt text to obtain a text cross-attention vector; performing content cross-attention processing on the text cross-attention vector and the target feature vector of the image to be identified to obtain a content cross-attention vector; performing adaptive normalization processing on the temporal style fusion feature vector of the prompt style image and the content cross-attention vector to obtain a first normalized vector; performing residual processing on the normalized vector and the noise map to obtain a residual vector; processing the residual vector through a feedforward network to obtain a feedforward vector; performing adaptive normalization processing on the feedforward vector and the temporal style fusion feature vector of the prompt style image to obtain a second normalized vector; and performing residual processing on the second normalized vector and the residual vector to obtain the first fused feature vector.
[0052] refer to Figure 4 and Figure 5The architecture is the same in the first half and the second half of the sub-modules, which respectively include a self-attention layer, a text cross-attention layer, a style cross-attention layer, an adaptive normalization layer (AdaLN), and a feedforward network.
[0053] Specifically, refer to Figure 4 The process involves several steps: First, a self-attention feature vector is obtained by performing self-attention processing on the noise map using a self-attention layer. Then, a text cross-attention vector is obtained by performing text cross-attention processing on the self-attention feature vector and the semantic feature vector of the prompt text using a text cross-attention layer. Next, a content cross-attention vector is obtained by performing content cross-attention processing on the text cross-attention vector and the target feature vector of the image to be identified using a style cross-attention layer. Finally, an adaptive normalization layer (AdaLN) is used to adaptively normalize the temporal style fusion feature vector of the prompt style image and the content cross-attention vector to obtain a first normalized vector. The normalized vector and the noise map are then processed with residuals to obtain a residual vector. A feedforward network is used to process the residual vector to obtain a feedforward vector. The feedforward vector and the temporal style fusion feature vector of the prompt style image are then adaptively normalized using an adaptive normalization layer (AdaLN) to obtain a second normalized vector. Finally, the second normalized vector and the residual vector are processed with residuals to obtain a first fusion feature vector. This first fusion feature vector is the output of the first sub-module.
[0054] Based on the aforementioned embodiments, the noise map serves as the initial input, typically a randomly generated image. The self-attention layer contains a query, key, and value. The noise map is transformed linearly to generate query, key, and value vectors. The dot product of the query and key is calculated to obtain attention weights, and the value vectors are then weighted and summed. This yields a self-attention feature vector that captures important information and long-range dependencies in the noise map. The text cross-attention layer contains a query, key, and value: the self-attention feature vector is used as the query, and the semantic feature vector of the prompt text is used as the key and value. Attention weights are calculated between the self-attention features and text features to emphasize text-related information. This yields a text cross-attention vector that integrates self-attention features and text semantic features. The style cross-attention layer contains a query, key, and value: the text cross-attention vector is used as the query, and the target feature vector of the image to be recognized is used as the key and value. Attention weights are calculated between text features and target features to extract information related to the target features. This yields a content cross-attention vector that combines text features and target image features. Adaptive Normalization Layer (AdaLN): Normalizes the content cross-attention vector. Adjusts the normalized features based on the temporal style fusion feature vector of the cue style image. This results in a first normalized vector, enhancing the feature's adaptability. The first normalized vector is added to the noise map to form a residual connection, preserving the original information. This yields a residual vector, which combines the normalized features with noise map information. Feedforward Network: Processes the residual vector through a series of fully connected layers, typically including activation functions (such as ReLU) to increase non-linearity. This yields a feedforward vector, which undergoes a non-linear transformation to further extract features. A second adaptive normalization process normalizes the feedforward vector. This is adjusted based on the temporal style fusion feature vector of the cue style image. This yields a second normalized vector, enhancing the feedforward vector's adaptability. Finally, residual processing adds the second normalized vector to the residual vector, forming the final feature fusion. This yields the first fused feature vector, the final output of the first sub-module, containing feature information processed through multiple layers. Through the above steps, the first-part submodule effectively transforms the noise map into a first fusion feature vector with rich features, ready for subsequent processing and target image generation. Each level of processing emphasizes different features, ensuring that the generated image accurately reflects the prompt text and style requirements. In this example, if the number of first-part submodules is greater than or equal to two, the input to the first submodule can be the noise map and other feature vectors. From the second submodule onwards, the input is the output of the previous module and other feature vectors. These other feature vectors can be the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, and the target feature vector of the image to be recognized.
[0055] In some embodiments of this disclosure, fusing the first fused feature vector, the semantic feature vector of the prompt text, the temporal style fused feature vector of the prompt style image, the style fused feature vector of the prompt style image, and the initial style feature vector of the image to be identified to obtain the second fused feature vector includes: performing self-attention processing on the first fused feature vector to obtain a self-attention feature vector; performing text cross-attention processing on the self-attention feature vector and the semantic feature vector of the prompt text to obtain a text cross-attention vector; performing style cross-attention processing on the text cross-attention vector and the initial style feature vector of the image to be identified to obtain a style cross-attention vector; performing adaptive normalization processing on the temporal style fused feature vector and the style cross-attention vector of the prompt style image to obtain a first normalized vector; performing residual processing on the normalized vector and the first fused feature vector to obtain a residual vector; processing the residual vector through a feedforward network to obtain a feedforward vector; performing adaptive normalization processing on the feedforward vector and the temporal style fused feature vector of the prompt style image to obtain a second normalized vector; and performing residual processing on the second normalized vector, the residual vector, and the initial style feature vector of the image to be identified to obtain the second fused feature vector.
[0056] Specifically, refer to Figure 5 The self-attention feature vector is obtained by performing self-attention processing on the first fused feature vector through a self-attention layer. A text cross-attention vector is obtained by performing text cross-attention processing on the self-attention feature vector and the semantic feature vector of the prompt text through a text cross-attention layer. A style cross-attention vector is obtained by performing style cross-attention processing on the text cross-attention vector and the initial style feature vector of the image to be identified through a style cross-attention layer. A first normalized vector is obtained by performing adaptive normalization processing on the temporal style fusion feature vector and the style cross-attention vector of the prompt style image through an adaptive normalization layer. A residual vector is obtained by performing residual processing on the normalized vector and the first fused feature vector. A feedforward vector is obtained by processing the residual vector through a feedforward network. A second normalized vector is obtained by performing adaptive normalization processing on the feedforward vector and the temporal style fusion feature vector of the prompt style image through an adaptive normalization layer. A second fused feature vector is obtained by performing residual processing on the second normalized vector, the residual vector, and the initial style feature vector of the image to be identified.
[0057] Based on the aforementioned embodiments, the first fused feature vector comes from the output of the first half of the sub-module and contains feature information processed through multiple layers. The self-attention layer contains query, key, and value: the first fused feature vector is transformed linearly to generate query, key, and value vectors. The dot product of the query and key is calculated to obtain attention weights, and the value vectors are weighted and summed. This yields a self-attention feature vector that emphasizes important information and long-distance dependencies in the first fused feature vector. The text cross-attention layer contains query, key, and value: the self-attention feature vector is used as the query, and the semantic feature vector of the prompt text is used as the key and value. The attention weights between the self-attention features and text features are calculated to emphasize text-related information. This yields a text cross-attention vector that fuses the self-attention features and text semantic features. The style cross-attention layer contains query, key, and value: the text cross-attention vector is used as the query, and the initial style feature vector of the image to be recognized is used as the key and value. The attention weights between the text features and the initial style features are calculated to extract style-related information. This yields a style cross-attention vector that combines the text features and the initial style features. **Adaptive Normalization Layer (AdaLN):** Normalizes the style cross-attention vector. Adjusts the normalized features based on the temporal style fusion feature vector of the cue style image. This yields the first normalized vector, enhancing the adaptability of the style features. The first normalized vector is added to the first fusion feature vector, forming a residual connection to preserve the original information. This results in a residual vector that combines information from the normalized features and the first fusion feature. **Feedforward Network:** Processes the residual vector through a series of fully connected layers, typically including activation functions (such as ReLU) to increase non-linearity. This yields a feedforward vector, which undergoes a non-linear transformation to further extract features. The second adaptive normalization process inputs the feedforward vector: the output of the feedforward network. The temporal style fusion feature vector of the cue style image is also used for adjustment. The feedforward vector is normalized. Adjusted based on the temporal style fusion feature vector of the cue style image. This yields the second normalized vector, enhancing the adaptability of the feedforward vector. Finally, the input to the residual processing is the second normalized vector: the output of the second adaptive normalization process. Residual vector: from the previous residual processing. Initial style feature vector of the image to be recognized: represents the initial style features of the target image to be generated. The second normalized vector, the residual vector, and the initial style feature vector of the image to be recognized are added together to form the final feature fusion. The second fused feature vector is obtained, which is the final output of the latter submodule, containing feature information processed through multiple layers. Through the above steps, the latter submodule effectively transforms the first fused feature vector into the second fused feature vector, ready for use in the subsequent generation of the target image.Each level of processing emphasizes different features to ensure that the generated image accurately reflects the prompt text and style requirements. In this example, if the number of sub-modules in the latter half is greater than or equal to 2, the input to the first sub-module can be the output of the last sub-module in the first half and other feature vectors. Starting from the second sub-module, the input is the output of the previous sub-module and other feature vectors. The other feature vectors can be the first fusion feature vector, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, and the initial style feature vector of the image to be recognized.
[0058] Figure 6 This is a block diagram of an image generation apparatus provided in an embodiment of the present disclosure.
[0059] like Figure 6 As shown, the image generation device 600 includes an acquisition module 610, a first fusion module 620, a first determination module 630, a second fusion module 640, a second determination module 660, and a generation module 660.
[0060] Specifically, the acquisition module 610 is used to acquire the image to be recognized, the prompt text, and the prompt style image.
[0061] The first fusion module 620 is used to fuse the image feature vector of the prompt style image and the temporal feature vector of the preset time step to obtain the temporal style fusion feature vector of the prompt style image.
[0062] The first determining module 630 is used to determine the style fusion feature vector of the prompt style image based on the image feature vector of the prompt style image.
[0063] The second fusion module 640 is used to fuse the image feature vectors of the image to be recognized and the prompt style image to obtain the initial style feature vector of the image to be recognized.
[0064] The second determining module 650 is used to determine the target feature vector of the image to be identified based on the image feature vector of the image to be identified.
[0065] The generation module 660 is used to denoise the noise map based on the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be identified, and the target feature vector of the image to be identified, so as to obtain the target image.
[0066] The image generation device 600 can effectively capture style information in the time dimension by fusing the image feature vector of the cue style image with the temporal feature vector of a preset time step, thus improving the diversity and flexibility of style conversion. By independently determining the style fusion feature vector of the cue style image, the extraction of style information is clearer, thereby improving the accuracy and consistency of style conversion. The initial style feature vector obtained by fusing the image feature vectors of the image to be recognized and the cue style image can better reflect the style requirements of the image to be recognized, enhancing the quality of the generated result. By using a diffusion model to denoise the noise map and combining it with the semantic feature vector of the cue text, the content information of the image can be effectively preserved, while stylized synthesis is achieved, ensuring that the generated target image not only meets the style requirements but also has good visual effects. This method optimizes the computation process in the feature injection and fusion process, reduces inference time, and is more practical than traditional methods. It is suitable for real-time image style conversion scenarios. In addition, this method not only supports image-driven style conversion but also handles text-driven and text-editing-driven stylized synthesis, further expanding the application scope and meeting the needs of different users.
[0067] In some embodiments of this disclosure, the first fusion module 620 is configured to: process the image feature vector of the prompt style image through a first multilayer perceptron to obtain the adapted style image feature vector; and add the time feature vector of the preset time step and the adapted style image feature vector to obtain the time style fusion feature vector of the prompt style image.
[0068] In some embodiments of this disclosure, the first determining module 630 is configured to: process the image feature vector of the prompt style image through a first multilayer perceptron to obtain the adapted style image feature vector; and perform cross-attention processing on the adapted style image feature vector to obtain the style fusion feature vector of the prompt style image.
[0069] In some embodiments of this disclosure, the second fusion module 640 is configured to: extract style semantics from the image feature vector of the prompt style image to obtain the style semantic feature vector of the prompt style image; process the image feature vector of the prompt style image through a first multilayer perceptron to obtain the adapted style image feature vector; and process the style semantic feature vector of the prompt style image, the adapted style image feature vector, and the image to be identified through a control network to obtain the initial style feature vector of the image to be identified.
[0070] In some embodiments of this disclosure, the second determining module 650 is configured to: process the image feature vector of the image to be identified through a second multilayer perceptron to obtain an adapted entity image feature vector; and perform cross-attention processing on the adapted entity image feature vector to obtain the target feature vector of the image to be identified.
[0071] In some embodiments of this disclosure, the generation module 660 is configured to: perform fusion processing on the noise map, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, and the target feature vector of the image to be identified to obtain a first fusion feature vector; perform fusion processing on the first fusion feature vector, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, and the initial style feature vector of the image to be identified to obtain a second fusion feature vector; and generate a target image based on the second fusion feature vector.
[0072] In some embodiments of this disclosure, the first fused feature vector is obtained by fusing the noise map, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, and the target feature vector of the image to be identified. This fusion process includes: performing self-attention processing on the noise map to obtain a self-attention feature vector; performing text cross-attention processing on the self-attention feature vector and the semantic feature vector of the prompt text to obtain a text cross-attention vector; performing content cross-attention processing on the text cross-attention vector and the target feature vector of the image to be identified to obtain a content cross-attention vector; performing adaptive normalization processing on the temporal style fusion feature vector and the content cross-attention vector of the prompt style image to obtain a first normalized vector; performing residual processing on the normalized vector and the noise map to obtain a residual vector; processing the residual vector through a feedforward network to obtain a feedforward vector; performing adaptive normalization processing on the feedforward vector and the temporal style fusion feature vector of the prompt style image to obtain a second normalized vector; and performing residual processing on the second normalized vector and the residual vector to obtain the first fused feature vector. The process of fusing the first fusion feature vector, the temporal style fusion feature vector of the cue style image, the style fusion feature vector of the cue style image, and the initial style feature vector of the image to be identified to obtain the second fusion feature vector includes: performing self-attention processing on the first fusion feature vector to obtain a self-attention feature vector; performing text cross-attention processing on the self-attention feature vector and the semantic feature vector of the cue text to obtain a text cross-attention vector; performing style cross-attention processing on the text cross-attention vector and the initial style feature vector of the image to be identified to obtain a style cross-attention vector; performing adaptive normalization processing on the temporal style fusion feature vector and the style cross-attention vector of the cue style image to obtain a first normalized vector; performing residual processing on the normalized vector and the first fusion feature vector to obtain a residual vector; processing the residual vector through a feedforward network to obtain a feedforward vector; performing adaptive normalization processing on the feedforward vector and the temporal style fusion feature vector of the cue style image to obtain a second normalized vector; and performing residual processing on the second normalized vector, the residual vector, and the initial style feature vector of the image to be identified to obtain the second fusion feature vector.
[0073] Figure 7 This is a schematic diagram of the electronic device 7 provided in an embodiment of this disclosure. Figure 7 As shown, the electronic device 7 of this embodiment includes a processor 701, a memory 702, and a computer program 703 stored in the memory 702 and executable on the processor 701. When the processor 701 executes the computer program 703, it implements the steps in the various method embodiments described above. Alternatively, when the processor 701 executes the computer program 703, it implements the functions of each module in the various device embodiments described above.
[0074] Electronic device 7 can be a desktop computer, laptop, handheld computer, cloud server, or other electronic device. Electronic device 7 may include, but is not limited to, processor 701 and memory 702. Those skilled in the art will understand that... Figure 7 This is merely an example of electronic device 7 and does not constitute a limitation on electronic device 7. It may include more or fewer components than shown, or different components.
[0075] The processor 701 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0076] The memory 702 can be an internal storage unit of the electronic device 7, such as a hard disk or RAM of the electronic device 7. The memory 702 can also be an external storage device of the electronic device 7, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., equipped on the electronic device 7. The memory 702 can also include both internal and external storage units of the electronic device 7. The memory 702 is used to store computer programs and other programs and data required by the electronic device.
[0077] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0078] If the integrated module is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program may include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0079] The above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit it. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be included within the protection scope of this disclosure.
Claims
1. An image generation method, characterized in that, include: Acquire the image to be recognized, the prompt text, and the prompt style image; The image feature vector of the prompt style image and the temporal feature vector of the preset time step are fused to obtain the temporal style fused feature vector of the prompt style image; Based on the image feature vector of the prompt style image, determine the style fusion feature vector of the prompt style image; The image feature vectors of the image to be identified and the prompt style image are fused to obtain the initial style feature vector of the image to be identified; Based on the image feature vector of the image to be identified, determine the target feature vector of the image to be identified; The target image is obtained by denoising the noise map using a diffusion model based on the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be identified, and the target feature vector of the image to be identified.
2. The method according to claim 1, characterized in that, The image feature vector of the prompt-style image and the temporal feature vector at a preset time step are fused to obtain the temporal style fused feature vector of the prompt-style image, including: The image feature vector of the prompt style image is processed by the first multilayer perceptron to obtain the adapted style image feature vector; The temporal feature vector of the preset time step and the adapted style image feature vector are added together to obtain the temporal style fusion feature vector of the prompt style image.
3. The method according to claim 1, characterized in that, Determining the style fusion feature vector of the prompt style image based on the image feature vector of the prompt style image includes: The image feature vector of the prompt style image is processed by the first multilayer perceptron to obtain the adapted style image feature vector; Cross-attention processing is performed on the feature vector of the adapted style image to obtain the style fusion feature vector of the prompt style image.
4. The method according to claim 1, characterized in that, The image feature vectors of the image to be identified and the prompt style image are fused to obtain the initial style feature vector of the image to be identified, including: Style semantics are extracted from the image feature vector of the prompt style image to obtain the style semantic feature vector of the prompt style image; The image feature vector of the prompt style image is processed by the first multilayer perceptron to obtain the adapted style image feature vector; By controlling the network to process the style semantic feature vector of the prompt style image, the adapted style image feature vector, and the image to be identified, the initial style feature vector of the image to be identified is obtained.
5. The method according to claim 1, characterized in that, Determining the target feature vector of the image to be identified based on its image feature vector includes: The image feature vector of the image to be identified is processed by a second multilayer perceptron to obtain the adapted entity image feature vector; Cross-attention processing is performed on the adapted entity image feature vector to obtain the target feature vector of the image to be identified.
6. The method according to claim 1, characterized in that, The noise map is denoised using a diffusion model based on the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be identified, and the target feature vector of the image to be identified, to obtain the target image, which includes: The noise map, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, and the target feature vector of the image to be identified are fused to obtain a first fused feature vector; The first fused feature vector, the semantic feature vector of the prompt text, the temporal style fused feature vector of the prompt style image, the style fused feature vector of the prompt style image, and the initial style feature vector of the image to be identified are fused to obtain the second fused feature vector. The target image is generated based on the second fused feature vector.
7. The method according to claim 6, characterized in that, The first fused feature vector is obtained by fusing the noise map, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, and the target feature vector of the image to be identified, including: The noise map is processed by self-attention to obtain a self-attention feature vector. The self-attention feature vector and the semantic feature vector of the prompt text are processed by text cross-attention to obtain a text cross-attention vector. The text cross-attention vector and the target feature vector of the image to be identified are processed by content cross-attention to obtain a content cross-attention vector. The temporal style fusion feature vector of the prompt style image and the content cross-attention vector are processed by adaptive normalization to obtain a first normalized vector. The normalized vector and the noise map are processed by residual processing to obtain a residual vector. The residual vector is processed by a feedforward network to obtain a feedforward vector. The feedforward vector and the temporal style fusion feature vector of the prompt style image are processed by adaptive normalization to obtain a second normalized vector. The second normalized vector and the residual vector are processed by residual processing to obtain the first fusion feature vector. The first fused feature vector, the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, and the initial style feature vector of the image to be identified are fused to obtain the second fused feature vector, which includes: The first fused feature vector is subjected to self-attention processing to obtain a self-attention feature vector. The self-attention feature vector and the semantic feature vector of the prompt text are subjected to text cross-attention processing to obtain a text cross-attention vector. The text cross-attention vector and the initial style feature vector of the image to be identified are subjected to style cross-attention processing to obtain a style cross-attention vector. The temporal style fusion feature vector of the prompt style image and the style cross-attention vector are subjected to adaptive normalization processing to obtain a first normalized vector. The normalized vector and the first fused feature vector are subjected to residual processing to obtain a residual vector. The residual vector is processed through a feedforward network to obtain a feedforward vector. The feedforward vector and the temporal style fusion feature vector of the prompt style image are subjected to adaptive normalization processing to obtain a second normalized vector. The second normalized vector, the residual vector, and the initial style feature vector of the image to be identified are subjected to residual processing to obtain a second fused feature vector.
8. An image generation apparatus, characterized in that, include: The acquisition module is used to acquire the image to be recognized, the prompt text, and the prompt style image; The first fusion module is used to fuse the image feature vector of the prompt style image and the time feature vector of the preset time step to obtain the time style fusion feature vector of the prompt style image; The first determining module is used to determine the style fusion feature vector of the prompt style image based on the image feature vector of the prompt style image; The second fusion module is used to fuse the image feature vectors of the image to be identified and the prompt style image to obtain the initial style feature vector of the image to be identified. The second determining module is used to determine the target feature vector of the image to be identified based on the image feature vector of the image to be identified; The generation module is used to perform denoising on the noise map using a diffusion model based on the semantic feature vector of the prompt text, the temporal style fusion feature vector of the prompt style image, the style fusion feature vector of the prompt style image, the initial style feature vector of the image to be identified, and the target feature vector of the image to be identified, to obtain the target image.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Video generation method and device, electronic equipment and readable storage medium
CN118042246A
Single sample font generation method based on multi-scale style fusion and font control
CN118365744A