Data processing method, device, equipment and readable storage medium

Through the combination of text encoding and diffusion network layers, a parallel upsampling processing path is constructed to generate consistent images, which solves the problem of frequent manual operations in the existing technology and improves efficiency and cost-effectiveness.

CN118505842BActive Publication Date: 2024-10-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410956972.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-10-25
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

The existing technology requires a lot of manual operations when generating multiple consistent images, resulting in high technical costs and low efficiency.

Method used

By text encoding the main text information, the first encoding vector is generated, and the second encoding vector is generated by combining the secondary text information, which is input to the forward diffusion network layer and the backward diffusion network layer in the target image generation model to construct a parallel Upsampling the processing path, injecting encoding vectors to generate consistent business images.

Benefits of technology

It reduces the technical cost of generating multiple consistent images, improves the generation efficiency, realizes the consistency of semantic information of main objects and the difference of secondary objects, and avoids manual operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118505842B_ABST
    Figure CN118505842B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method, device, equipment and readable storage medium, the method comprising: performing text encoding on primary text information and secondary text information respectively to obtain a first encoding vector and a second encoding vector; wherein the primary text information is a text prompt describing the primary object in the image, and the secondary text information is a text prompt describing the secondary object in the image; when the forward noise vector obtained by forward diffusion is diffused backward, the first encoding vector is injected in the first sampling stage, and a second encoding vector is injected into each upsampling processing path in the second sampling stage through M parallel upsampling processing paths, thereby generating business images corresponding to the M upsampling processing paths respectively; the primary objects in the M business images are the same, and the secondary objects in the M business images are different from each other. By adopting the present application, the technical cost of generating multiple consistent images can be reduced and the generation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, equipment and readable storage medium. Background Art

[0002] In the field of images, such as games and comics, the subjects in multiple images often need to be consistent. For example, in the comic pictures of scene dramas, the scene environment in the entire picture needs to be consistent from beginning to end. In the original pictures of game levels, the images of game characters in different level environments need to be highly consistent.

[0003] The traditional solution is to manually extract the main image that needs to remain consistent, map the main image onto the content that needs to change, such as extracting a game character, and then pasting it onto different background environment pictures, so as to generate a batch of consistent pictures of the characters, and then redraw the light and shadow details and edge transitions. This requires a lot of manual operations to complete, and the technical cost of generating multiple consistent images is high and the generation efficiency is low. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, apparatus, device and readable storage medium, which can reduce the technical cost of generating multiple consistent images and improve generation efficiency.

[0005] On the one hand, an embodiment of the present application provides a data processing method, including:

[0006] Performing text encoding on the primary text information to obtain a first encoding vector, generating M second encoding vectors based on the first encoding vector and M secondary text information; M is a positive integer, the primary text information is a text prompt describing a primary object in the image, the secondary text information is a text prompt describing a secondary object in the image, and the secondary objects described by the M secondary text information are different from each other; a second encoding vector is generated by the first encoding vector and one secondary text information;

[0007] Obtaining a potential noise vector, inputting the potential noise vector into a forward diffusion network layer in a target image generation model, and outputting a forward noise vector through the forward diffusion network layer;

[0008] Inputting the forward noise vector into a backward diffusion network layer in the target image generation model, creating M parallel upsampling processing paths through the backward diffusion network layer; the backward diffusion network layer is used to inject a first encoding vector in a first sampling stage, and is used to inject a second encoding vector into each upsampling processing path in a second sampling stage; the input of the second sampling stage includes the output of the first sampling stage;

[0009] According to the forward noise vector, the first coding vector injected in the first sampling stage and the M second coding vectors injected in the second sampling stage, business images corresponding to the M upsampling processing paths are generated; the main objects in the M business images are the same, and the secondary objects in the M business images are different from each other.

[0010] The process of generating service images corresponding to the M upsampling processing paths respectively according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage includes:

[0011] Injecting a first coding vector in the first sampling stage through a backward diffusion network layer, downsampling the forward noise vector and the first coding vector injected in the first sampling stage to obtain a first concept vector output in the first sampling stage, and respectively allocating the first concept vector to M upsampling processing paths;

[0012] In the second sampling stage, a second coding vector is injected into each upsampling processing path respectively, and the first concept vector and the second coding vector injected in the second sampling stage are upsampled in each upsampling processing path respectively to obtain M second concept vectors outputted in the second sampling stage, and business images corresponding to the M upsampling processing paths are generated based on the M second concept vectors.

[0013] The forward noise vector and the first coding vector injected in the first sampling stage are downsampled to obtain the first concept vector output in the first sampling stage, including:

[0014] The forward noise vector is input into the backward diffusion network layer; the backward diffusion network layer includes a noise prediction network; the noise prediction network includes a downsampling network layer, an intermediate sampling network layer and an upsampling network layer, the input of the intermediate sampling network layer is the output of the downsampling network layer, and the input of the upsampling network layer is the output of the intermediate sampling network layer; the downsampling network layer includes a first self-attention layer and a first cross-attention layer;

[0015] In the first self-attention layer, the forward noise vector is self-attention processed to obtain a first self-attention result vector. In the first cross-attention layer, the first self-attention result vector and the injected first encoding vector are cross-attention processed to obtain a first concept vector output in the first sampling stage. The feature dimension of the first concept vector is smaller than the feature dimension of the forward noise vector.

[0016] The method also includes:

[0017] The first concept vectors are replicated based on the intermediate sampling network layer, and the replicated M first concept vectors are sent to an up-sampling network layer for outputting M second concept vectors in a second sampling stage.

[0018] Among them, in the first cross attention layer, the first self-attention result vector and the injected first encoding vector are cross-attention processed to obtain the first concept vector output in the first sampling stage, including:

[0019] Perform a dot multiplication operation on the first self-attention result vector and the query parameter matrix to obtain a query vector, perform a dot multiplication operation on the first self-attention result vector and the key parameter matrix to obtain a key vector, and perform a dot multiplication operation on the first encoding vector and the value parameter matrix to obtain a value vector;

[0020] An attention score vector is generated based on the query vector and the key vector. The attention score vector is reduced in dimension based on the dimension of the key vector. The reduced-dimensional attention score vector is normalized to obtain a normalized vector. The normalized vector is point-multiplied with the value vector to obtain the first concept vector.

[0021] The M upsampling processing paths include a target upsampling processing path; in each upsampling processing path, the first concept vector and the second encoding vector injected in the second sampling stage are upsampled to obtain M second concept vectors output in the second sampling stage, including:

[0022] Inputting the first concept vector into an upsampling network layer; the upsampling network layer includes a second self-attention layer and a second cross-attention layer corresponding to the target upsampling processing path;

[0023] In the second self-attention layer, the first concept vector is self-attention processed to obtain a second self-attention result vector;

[0024] In the second cross-attention layer, cross-attention processing is performed on the second self-attention result vector and the second encoding vector assigned to the target upsampling processing path to obtain a cross-attention result vector, and a second concept vector output by the target upsampling processing path is generated based on the cross-attention result vector; the feature dimension of the second concept vector is equal to the feature dimension of the forward noise vector.

[0025] The back-diffusion network layer includes T noise prediction networks, where T is a positive integer; each noise prediction network is used to inject a first encoding vector in the first sampling stage, and to inject a second encoding vector into each upsampling processing path in the second sampling stage; the T noise prediction networks include a noise prediction network , i is a positive integer less than or equal to T; generating business images corresponding to the M upsampling processing paths respectively according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, including:

[0026] Feed the input vector into the noise prediction network , through the noise prediction network The input vector and the first encoding vector injected in the first sampling stage are downsampled to obtain a noise prediction network The output of the M first concept vectors will be the noise prediction network The output M first concept vectors are respectively assigned to the noise prediction network The output of M upsampling processing paths; a first concept vector is assigned to an upsampling processing path; if i is 1, the input vector is a forward noise vector, and the M first concept vectors are the same; if i is greater than 1, the input vector includes the noise prediction network The output of M second concept vectors and one first concept vector are generated by the noise prediction network The noise prediction network is determined by a second concept vector outputted from the first encoding vector is the noise prediction network among T noise prediction networks The previous noise prediction network, noise prediction network The output of the noise prediction network Input;

[0027] In the second sampling stage, the noise prediction network Each upsampling processing path of is respectively injected with a second encoding vector, and the noise prediction network is respectively The output first concept vector and the injected second encoding vector are upsampled to obtain the noise prediction network Output M second concept vectors;

[0028] If i is T, then based on the noise prediction network Output of M second concept vector generation and noise prediction network The M upsampling processing paths respectively correspond to the business images.

[0029] The process of generating service images corresponding to the M upsampling processing paths respectively based on the M second concept vectors includes:

[0030] The M second concept vectors are input into the image decoding layer of the target image generation model. In the image decoding layer, the potential noise vectors are denoised based on the M second concept vectors to obtain M denoised image vectors, and M business images are generated based on the M denoised image vectors.

[0031] The first coding vector is obtained by text coding the main text information, including:

[0032] Inputting main text information into a target image generation model; the target image generation model includes a text encoding layer;

[0033] Based on the text encoding layer, the main text information is split to obtain a word unit sequence corresponding to the main text information; a word unit in the word unit sequence refers to the smallest basic unit obtained after the text information is split;

[0034] Each word in the word sequence is encoded separately to obtain a first encoding vector.

[0035] Among them, obtaining the potential noise vector includes:

[0036] Obtain a Gaussian noise image, input the Gaussian noise image into an image coding layer in a target image generation model, perform feature extraction on the Gaussian noise image based on the image coding layer, and obtain a mean vector and a variance vector of the Gaussian noise image;

[0037] Random sampling is performed in the mean vector and variance vector of the Gaussian noise image to obtain a potential mean vector and a potential variance vector, and a potential noise vector is generated based on the potential mean vector and the potential variance vector.

[0038] Among them, the potential noise vector is input into the forward diffusion network layer in the target image generation model, and the forward noise vector is output through the forward diffusion network layer, including:

[0039] In the forward diffusion network layer, the latent variable distribution is obtained. Based on the forward diffusion network layer, random noise vectors are added to the latent noise vector in T time steps to obtain the forward noise vector. T is a positive integer, the latent variable distribution is the conceptual distribution of the added noise, the random noise vector is obtained by random sampling based on the latent variable distribution, the random noise vectors added in T time steps are different, and the time step is used to indicate the amplitude of the added noise.

[0040] Among them, it also includes:

[0041] M object text information is obtained, word frequency statistics are performed on the M object text information, text information that appears in all the M object text information is determined as primary text information, and text information other than the primary text information in the object text information is determined as secondary text information.

[0042] Among them, it also includes:

[0043] Obtaining M object text information, performing text segmentation on the M object text information, and obtaining M word-unit sequences; a word-unit in the word-unit sequence refers to the smallest basic unit obtained after performing text segmentation on the object text information;

[0044] Perform feature extraction on M word-unit sequences to obtain M object feature vectors, perform self-attention processing on the M object feature vectors to obtain M context semantic sequences;

[0045] Based on the attention score corresponding to each word in the M context semantic sequences, the primary object probability and the secondary object probability corresponding to each word in the M word sequences are generated respectively. Based on the primary object probability corresponding to each word in the M word sequences, the primary text information is determined. Based on the secondary object probability corresponding to each word in the M word sequences, the secondary text information is determined.

[0046] An embodiment of the present application provides a data processing device, including:

[0047] A text encoding module, used for performing text encoding on the primary text information to obtain a first encoding vector, and generating M second encoding vectors based on the first encoding vector and M secondary text information; M is a positive integer, the primary text information is a text prompt describing a primary object in the image, the secondary text information is a text prompt describing a secondary object in the image, and the secondary objects described by the M secondary text information are different from each other; one second encoding vector is generated by the first encoding vector and one secondary text information;

[0048] A forward diffusion module is used to obtain a potential noise vector, input the potential noise vector into a forward diffusion network layer in a target image generation model, and output a forward noise vector through the forward diffusion network layer;

[0049] A path processing module, used for inputting the forward noise vector into a backward diffusion network layer in the target image generation model, and creating M parallel upsampling processing paths through the backward diffusion network layer; the backward diffusion network layer is used for injecting a first encoding vector in a first sampling stage, and for injecting a second encoding vector into each upsampling processing path in a second sampling stage; the input of the second sampling stage includes the output of the first sampling stage;

[0050] An image generation module is used to generate business images corresponding to M upsampling processing paths respectively according to a forward noise vector, a first coding vector injected in a first sampling stage, and M second coding vectors injected in a second sampling stage; the main objects in the M business images are the same, and the secondary objects in the M business images are different from each other.

[0051] In a possible implementation, the image generation module is used to generate business images corresponding to M upsampling processing paths respectively according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, and is specifically used to perform the following operations:

[0052] Injecting a first coding vector in the first sampling stage through a backward diffusion network layer, downsampling the forward noise vector and the first coding vector injected in the first sampling stage to obtain a first concept vector output in the first sampling stage, and respectively allocating the first concept vector to M upsampling processing paths;

[0053] In the second sampling stage, a second coding vector is injected into each upsampling processing path respectively, and the first concept vector and the second coding vector injected in the second sampling stage are upsampled in each upsampling processing path respectively to obtain M second concept vectors outputted in the second sampling stage, and business images corresponding to the M upsampling processing paths are generated based on the M second concept vectors.

[0054] In a possible implementation, the image generation module is used to perform downsampling processing on the forward noise vector and the first encoding vector injected in the first sampling stage to obtain the first concept vector output in the first sampling stage, and specifically to perform the following operations:

[0055] The forward noise vector is input into the backward diffusion network layer; the backward diffusion network layer includes a noise prediction network; the noise prediction network includes a downsampling network layer, an intermediate sampling network layer and an upsampling network layer, the input of the intermediate sampling network layer is the output of the downsampling network layer, and the input of the upsampling network layer is the output of the intermediate sampling network layer; the downsampling network layer includes a first self-attention layer and a first cross-attention layer;

[0056] In the first self-attention layer, the forward noise vector is self-attention processed to obtain a first self-attention result vector. In the first cross-attention layer, the first self-attention result vector and the injected first encoding vector are cross-attention processed to obtain a first concept vector output in the first sampling stage. The feature dimension of the first concept vector is smaller than the feature dimension of the forward noise vector.

[0057] The image generation module is also used to perform the following operations:

[0058] The first concept vectors are replicated based on the intermediate sampling network layer, and the replicated M first concept vectors are sent to an up-sampling network layer for outputting M second concept vectors in a second sampling stage.

[0059] In a possible implementation, the image generation module is used to perform cross-attention processing on the first self-attention result vector and the injected first encoding vector in the first cross-attention layer to obtain the first concept vector output in the first sampling stage, specifically for performing the following operations:

[0060] Perform a dot multiplication operation on the first self-attention result vector and the query parameter matrix to obtain a query vector, perform a dot multiplication operation on the first self-attention result vector and the key parameter matrix to obtain a key vector, and perform a dot multiplication operation on the first encoding vector and the value parameter matrix to obtain a value vector;

[0061] An attention score vector is generated based on the query vector and the key vector. The attention score vector is reduced in dimension based on the dimension of the key vector. The reduced-dimensional attention score vector is normalized to obtain a normalized vector. The normalized vector is point-multiplied with the value vector to obtain the first concept vector.

[0062] In a possible implementation, the M upsampling processing paths include a target upsampling processing path; the image generation module is used to perform upsampling processing on the first concept vector and the second encoding vector injected in the second sampling stage in each upsampling processing path, and when the M second concept vectors outputted in the second sampling stage are obtained, specifically perform the following operations:

[0063] Inputting the first concept vector into an upsampling network layer; the upsampling network layer includes a second self-attention layer and a second cross-attention layer corresponding to the target upsampling processing path;

[0064] In the second self-attention layer, the first concept vector is self-attention processed to obtain a second self-attention result vector;

[0065] In the second cross-attention layer, cross-attention processing is performed on the second self-attention result vector and the second encoding vector assigned to the target upsampling processing path to obtain a cross-attention result vector, and a second concept vector output by the target upsampling processing path is generated based on the cross-attention result vector; the feature dimension of the second concept vector is equal to the feature dimension of the forward noise vector.

[0066] In a possible implementation, the back-diffusion network layer includes T noise prediction networks, where T is a positive integer; each noise prediction network is used to inject a first encoding vector in a first sampling stage, and to inject a second encoding vector into each upsampling processing path in a second sampling stage; the T noise prediction networks include a noise prediction network , i is a positive integer less than or equal to T; the image generation module is used to generate business images corresponding to M upsampling processing paths according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, and is specifically used to perform the following operations:

[0067] Feed the input vector into the noise prediction network , through the noise prediction network The input vector and the first encoding vector injected in the first sampling stage are downsampled to obtain a noise prediction network The output of the M first concept vectors will be the noise prediction network The output M first concept vectors are respectively assigned to the noise prediction network The output of M upsampling processing paths; a first concept vector is assigned to an upsampling processing path; if i is 1, the input vector is a forward noise vector, and the M first concept vectors are the same; if i is greater than 1, the input vector includes the noise prediction network The output of M second concept vectors and one first concept vector are generated by the noise prediction network The noise prediction network is determined by a second concept vector outputted from the first encoding vector is the noise prediction network among T noise prediction networks The previous noise prediction network, noise prediction network The output of the noise prediction network Input;

[0068] In the second sampling stage, the noise prediction network Each upsampling processing path of is respectively injected with a second encoding vector, and the noise prediction network is respectively The output first concept vector and the injected second encoding vector are upsampled to obtain the noise prediction network Output M second concept vectors;

[0069] If i is T, then based on the noise prediction network Output of M second concept vector generation and noise prediction network The M upsampling processing paths respectively correspond to the business images.

[0070] In a possible implementation, when the image generation module is used to generate the service images corresponding to the M upsampling processing paths respectively based on the M second concept vectors, it is specifically used to perform the following operations:

[0071] The M second concept vectors are input into the image decoding layer of the target image generation model. In the image decoding layer, the potential noise vectors are denoised based on the M second concept vectors to obtain M denoised image vectors, and M business images are generated based on the M denoised image vectors.

[0072] In a possible implementation, when the text encoding module is used to perform text encoding on the main text information to obtain the first encoding vector, it is specifically used to perform the following operations:

[0073] Inputting main text information into a target image generation model; the target image generation model includes a text encoding layer;

[0074] Based on the text encoding layer, the main text information is split to obtain a word unit sequence corresponding to the main text information; a word unit in the word unit sequence refers to the smallest basic unit obtained after the text information is split;

[0075] Each word in the word sequence is encoded separately to obtain a first encoding vector.

[0076] In a possible implementation, when the forward diffusion module is used to obtain the potential noise vector, it is specifically used to perform the following operations:

[0077] Obtain a Gaussian noise image, input the Gaussian noise image into an image coding layer in a target image generation model, perform feature extraction on the Gaussian noise image based on the image coding layer, and obtain a mean vector and a variance vector of the Gaussian noise image;

[0078] Random sampling is performed in the mean vector and variance vector of the Gaussian noise image to obtain a potential mean vector and a potential variance vector, and a potential noise vector is generated based on the potential mean vector and the potential variance vector.

[0079] In one possible implementation, the forward diffusion module is used to input the potential noise vector into the forward diffusion network layer in the target image generation model, and when the forward noise vector is output through the forward diffusion network layer, it is specifically used to perform the following operations:

[0080] In the forward diffusion network layer, the latent variable distribution is obtained. Based on the forward diffusion network layer, random noise vectors are added to the latent noise vector in T time steps to obtain the forward noise vector. T is a positive integer, the latent variable distribution is the conceptual distribution of the added noise, the random noise vector is obtained by random sampling based on the latent variable distribution, the random noise vectors added in T time steps are different, and the time step is used to indicate the amplitude of the added noise.

[0081] In a possible implementation, the text encoding module is further used to perform the following operations:

[0082] M object text information is obtained, word frequency statistics are performed on the M object text information, text information that appears in all the M object text information is determined as primary text information, and text information other than the primary text information in the object text information is determined as secondary text information.

[0083] In a possible implementation, the text encoding module is further used to perform the following operations:

[0084] Obtaining M object text information, performing text segmentation on the M object text information, and obtaining M word-unit sequences; a word-unit in the word-unit sequence refers to the smallest basic unit obtained after performing text segmentation on the object text information;

[0085] Perform feature extraction on M word-unit sequences to obtain M object feature vectors, perform self-attention processing on the M object feature vectors to obtain M context semantic sequences;

[0086] Based on the attention score corresponding to each word in the M context semantic sequences, the primary object probability and the secondary object probability corresponding to each word in the M word sequences are generated respectively. Based on the primary object probability corresponding to each word in the M word sequences, the primary text information is determined. Based on the secondary object probability corresponding to each word in the M word sequences, the secondary text information is determined.

[0087] On the one hand, an embodiment of the present application provides a computer device, including: a processor, a memory, and a network interface;

[0088] The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, and the memory is used to store a computer program. When the computer program is executed by the processor, the computer device executes the method provided in the embodiment of the present application.

[0089] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the method provided by the embodiment of the present application.

[0090] In one aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the method provided in the embodiment of the present application.

[0091] The embodiment of the present application obtains a first encoding vector by text encoding the main text information, generates M second encoding vectors based on the first encoding vector and M secondary text information, wherein the main text information is a text prompt describing the main object in the image, the secondary text information is a text prompt describing the secondary object in the image, the secondary objects described by the M secondary text information are different from each other, and a second encoding vector is generated by the first encoding vector and a secondary text information. Obtain a potential noise vector, input the potential noise vector into the forward diffusion network layer in the target image generation model, output the forward noise vector through the forward diffusion network layer, and ensure the randomness and diversity of the generated image through the random potential noise vector. Input the forward noise vector into the backward diffusion network layer in the target image generation model, create M parallel upsampling processing paths through the backward diffusion network layer, the backward diffusion network layer is used to inject the first encoding vector in the first sampling stage, and is used to inject a second encoding vector into each upsampling processing path in the second sampling stage, and the input of the second sampling stage includes the output of the first sampling stage. According to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, business images corresponding to the M upsampling processing paths are generated. By injecting the first coding vector in the first sampling stage, the semantic information of the main object can be injected into the calculation of the upsampling process, so that the entire model can maintain the consistency and accuracy of the generation of the main object in the early stage of the generation process of multiple images. By constructing M parallel upsampling processing paths, different second coding vectors are injected in the second sampling stage for independent upsampling processing, and the characteristics of each upsampling processing path are differentiated. Since the second coding vector contains both the semantic information of the main object and the semantic information of the secondary object, the consistency of the main object can be further maintained, the accuracy of the consistency of the main objects in multiple images is improved, and the difference of the semantic information of the secondary objects in the upsampling process is guaranteed. Through the parallel processing of the M parallel upsampling processing paths, the generation of multiple business images with the same main object and different secondary objects can be completed at one time. The generation process no longer relies on manual operation, thereby reducing the technical cost of generating multiple consistent images and improving the generation efficiency of business images. BRIEF DESCRIPTION OF THE DRAWINGS

[0092] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0093] Figure 1This is a schematic diagram of a network architecture provided by an embodiment of the present application;

[0094] Figure 2 This is a schematic diagram of a data processing scenario provided by an embodiment of the present application;

[0095] Figure 3 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 1 ;

[0096] Figure 4 This is a schematic diagram of a model structure provided in the embodiment of the present application. Figure 1 ;

[0097] Figure 5 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 2 ;

[0098] Figure 6 This is a schematic diagram of a model structure provided in the embodiment of the present application. Figure 2 ;

[0099] Figure 7 This is a schematic diagram of a model structure provided in the embodiment of the present application. Figure 3 ;

[0100] Figure 8 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0101] Fig. 9 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0102] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0103] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0104] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0105] Machine Learning (ML) is a multi-disciplinary interdisciplinary subject involving many disciplines such as conceptual theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0106] The solution provided in the embodiments of the present application involves machine learning of artificial intelligence, which is specifically illustrated by the following embodiments.

[0107] It can be understood that in the specific implementation of this application, the user (object or player) data involved, when the above and following embodiments of this application are applied to specific products or technologies, needs to obtain user permission or consent, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of the relevant regions.

[0108] Among them, if it is necessary to collect object (such as user, etc.) data in this application, a prompt interface or pop-up window will be displayed before and during the collection. The prompt interface or pop-up window is used to prompt the user that certain data is currently being collected. Only after the user confirms the prompt interface or pop-up window, the relevant steps of data acquisition will be started, otherwise it will end. Moreover, the acquired user data will be used in reasonable and legal scenarios or purposes. Optionally, in some scenarios where user data needs to be used but has not been authorized by the user, authorization can be requested from the user, and the user data can be used when the authorization is passed.

[0109] See also Figure 1 , Figure 1 Schematic diagram of a network architecture provided by an embodiment of the present application. Figure 1As shown, the network architecture may include a business server 100 and a terminal device cluster, and the terminal device cluster may include terminal device 10a, terminal device 10b, ..., terminal device 10n, wherein any terminal device in the terminal device cluster may have a communication connection with the business server 100, for example, there is a communication connection between the terminal device 10a and the business server 100, and there is a communication connection between the terminal device 10b and the business server 100, wherein the above-mentioned communication connection does not limit the connection method, and may be directly or indirectly connected through a wired communication method, or directly or indirectly connected through a wireless communication method, or through other methods, and the present application does not make any restrictions here.

[0110] Each terminal device in the terminal device cluster may include: smart phones, tablet computers, laptop computers, desktop computers, intelligent voice interaction devices, smart home appliances (e.g., smart TVs), wearable devices, vehicle terminals, aircraft, and other smart terminals with data processing functions. The vehicle terminal may be a terminal device in smart transportation scenarios and assisted driving scenarios. It should be understood that Figure 1 Each terminal device in the terminal device cluster shown in the figure can be installed with an application client having a data processing function. When the application client runs in each terminal device, it can be respectively connected to the above Figure 1 The business servers 100 shown perform data interaction.

[0111] The application client may specifically include: an in-vehicle client, a smart home client, an entertainment client (e.g., a game client), a multimedia client (e.g., a video client), a social client, and an information client (e.g., a news client). The application client in the embodiment of the present application may be integrated in a client (e.g., a social client) or may be an independent client (e.g., a news client). The embodiment of the present application does not limit the type of the application client.

[0112] Among them, the business server 100 can be a server corresponding to the application client. The business server 100 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also 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, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0113] like Figure 1As shown, any terminal device in the terminal device cluster can send an image generation request containing object text information to the business server 100. Taking the terminal device 10a as an example, the terminal device 10a can send the object text information to the business server 100 through the image generation request. Among them, the object text information can include primary text information and M secondary text information, M is a positive integer, the primary text information can be a text prompt for describing the main object in the image, and the secondary text information can be a text prompt for describing the secondary object in the image. Both the primary text information and the secondary text information can be written in natural language to instruct and guide the target image generation model to learn and infer according to the text prompt to generate an image that meets the text prompt.

[0114] The service server 100 may input the main text information and the M secondary text information into the target image generation model, perform text encoding on the main text information to obtain a first encoding vector, perform text encoding on the M secondary text information to obtain M secondary encoding vectors, and perform vector concatenation on the first encoding vector and the M secondary encoding vectors to obtain M second encoding vectors. The service server 100 may obtain a potential noise vector, perform forward diffusion on the potential noise vector through the forward diffusion network layer in the target image generation model, and obtain a forward noise vector output by the forward diffusion network layer.

[0115] The business server 100 can input the forward noise vector into the backward diffusion network layer in the target image generation model, and create M parallel upsampling processing paths through the backward diffusion network layer, wherein the backward diffusion network layer is used to inject the first coding vector in the first sampling stage, and to inject a second coding vector into each upsampling processing path corresponding to the second sampling stage, the second coding vectors injected into each upsampling processing path are different from each other, each upsampling processing path can be an independent unit processing space in the backward diffusion network layer, and the M upsampling processing paths can perform backward diffusion processing in parallel.

[0116] The business server 100 can generate M business images corresponding to each upsampling processing path through a forward noise vector, a first coding vector injected in a first sampling stage, and M second coding vectors injected in a second sampling stage, wherein the main objects in the M business images are the same, and the secondary objects in the M business images are different from each other.

[0117] In the embodiment of the present application, a first coding vector is obtained by text encoding the main text information, and M second coding vectors are generated based on the first coding vector and M secondary text information. The first coding vector and the M second coding vectors are used to instruct and guide the target image generation model to learn and infer according to the text information to generate an image that conforms to the text information. That is, multiple business images with the same main object and different secondary objects can be generated, thereby improving the accuracy of the consistency of the main objects in multiple business images.

[0118] See also Figure 2 , Figure 2 Schematic diagram of a data processing scenario provided by an embodiment of the present application. Figure 2 As shown, the service server can obtain the object text information sent by the terminal device, and the object text information can include the main text information and M secondary text information. Among them, the service server can be Figure 1 The service server 100 shown in FIG. 100 and the terminal device 100 may be Figure 1 Any terminal device in the terminal device cluster shown. The primary text information may be a text prompt for describing the primary object in the image, and the secondary text information may be a text prompt for describing the secondary object in the image. Both the primary text information and the secondary text information may be written in natural language, and are used to instruct and guide the target image generation model to learn and infer according to the text prompt to generate an image that conforms to the text prompt. Taking two object text information as an example, object text information 1 may be "animation character + indoor scene", and object text information 2 may be "animation character + outdoor scene", wherein the primary text information may be "animation character", and the secondary text information may include "indoor scene" and "outdoor scene".

[0119] The service server may perform text encoding on the primary text information to obtain a first encoding vector, perform text encoding on the M secondary text information to obtain M secondary encoding vectors, and perform vector concatenation on the first encoding vector and the M secondary encoding vectors to obtain M second encoding vectors. For example, the M secondary encoding vectors include secondary encoding vector 1 and secondary encoding vector 2. The service server may perform vector concatenation on the first encoding vector and the secondary encoding vector 1 to obtain a second encoding vector 1, and perform vector concatenation on the first encoding vector and the secondary encoding vector 2 to obtain a second encoding vector 2.

[0120] The service server can obtain the potential noise vector, and forward diffuse the potential noise vector for T time steps (time step) through the forward diffusion network layer in the target image generation model to obtain the forward noise vector output by the forward diffusion network layer. Among them, forward diffusion can refer to the process of adding noise to the potential noise vector, and backward diffusion can refer to the process of predicting noise on the forward noise vector. The time step is used to indicate the amplitude of adding noise in forward diffusion and the amplitude of predicting noise in backward diffusion.

[0121] The service server may input the forward noise vector into the backward diffusion network layer in the target image generation model. The backward diffusion may include T time steps, each time step may correspond to a noise prediction network, and each noise prediction network may create M parallel upsampling processing paths. Each upsampling processing path may be an independent unit processing space in the noise prediction network, and the M upsampling processing paths may perform upsampling processing in parallel.

[0122] Predicting Networks with Noise For example, the noise prediction network It may include a downsampling network layer, an intermediate sampling network layer and an upsampling network layer. The downsampling network layer and the intermediate sampling network layer may correspond to the first sampling stage, the upsampling network layer may correspond to the second sampling stage, the input of the intermediate sampling network layer is the output of the downsampling network layer, and the input of the upsampling network layer is the output of the intermediate sampling network layer. The noise prediction network may be a network such as U-net (a convolutional neural network with an encoder-decoder architecture of a U-shaped structure), SegNet (a deep fully convolutional neural network with an encoder-decoder architecture), or DeepLab (a hole convolutional network for image semantic segmentation based on deep learning), and the embodiments of the present application are not limited here.

[0123] Predicting Networks with Noise Taking U-net as an example, the upsampling network layer, downsampling network layer and intermediate sampling network layer in the noise prediction network can all perform attention processing, but the feature dimensions corresponding to the attention processing are different. The query vector Q and the key vector K can be generated through the forward noise vector, and the value vector V can be generated through the injected vector. The query vector Q, the key vector K and the value vector V are processed with attention, and the result vector after the attention processing is input into the next noise prediction network connected, for example, the noise prediction network .

[0124] Noise Prediction Network A first coding vector can be injected into the first sampling stage, and a second coding vector can be injected into each upsampling processing path corresponding to the second sampling stage, and the second coding vectors injected into each upsampling processing path are different from each other, so as to obtain a noise prediction network The output result vector is used for the noise prediction network The output result vector continues to diffuse backward for T-1 time steps. Each noise prediction network injects the first encoding vector in the first sampling stage and injects a second encoding vector in each upsampling processing path corresponding to the second sampling stage until the noise prediction network is obtained. The output of M result vectors corresponding to each upsampling processing path is passed through the noise prediction network The output M result vectors generate M business images, wherein the main objects in the M business images are the same, and the secondary objects in the M business images are different from each other.

[0125] For example, the M business images may include a business image 101 corresponding to object text information 1 and a business image 102 corresponding to object text information 2. The relationship between the business image and the text information may be as shown in Table 1:

[0126] Table 1

[0127]

[0128] In the process of creating a text map, the embodiment of the present application can generate multiple consistent business images for a main object, so that the main contents of the multiple business images are consistent and continuous, and can provide efficient technical means for the implementation of multiple text map scenes. Potential application directions may include:

[0129] 1. In terms of personalized AI (Artificial Intelligence) photo generation, users can input the main text information of the user's image, and the system can generate multiple photo images in batches at one time. The multiple photo images maintain the consistency of the main object (user image), and the user does not need to initiate the generation of characters multiple times, which greatly improves the user experience of AI photo generation and increases the playability and user experience of AI photo generation.

[0130] 2. In the production of comics, this solution can keep the main object consistent from beginning to end in the generated picture. For example, in the production of comic pictures of some scene dramas, because the scene environment in the entire picture needs to be consistent from beginning to end, this solution can help this kind of comic production improve the efficiency of the entire production, while also being able to highly maintain the consistency of the main scene. Of course, it can also be applied to comic generation with characters as the main object, so that the characters in different pictures generated remain highly consistent.

[0131] 3. In terms of game original painting generation, this solution can fully improve the efficiency of designers and original painters in the original painting design of game character images in different level environments. Through this solution, a character image can be generated in different level environment pictures at the same time. The game character images in these pictures can be highly consistent, and designers do not need to make secondary character modifications, which reduces technical costs and improves the efficiency of drawing game original paintings.

[0132] See also Figure 3 , Figure 3 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 1 The data processing method can be executed by a computer device, which can be Figure 1 The service server 100 shown in the figure or any terminal device in the terminal device cluster. The following will take the data processing method executed by a computer device as an example for explanation. The data processing method may at least include the following steps S101-S104:

[0133] Step S101, text encoding is performed on the primary text information to obtain a first encoding vector, and M second encoding vectors are generated based on the first encoding vector and M secondary text information; M is a positive integer, the primary text information is a text prompt describing a primary object in the image, the secondary text information is a text prompt describing a secondary object in the image, and the secondary objects described by the M secondary text information are different from each other; one second encoding vector is generated by the first encoding vector and one secondary text information;

[0134] For details, please refer to Figure 4 , Figure 4 This is a schematic diagram of a model structure proposed in the embodiment of the present application. Figure 1 ,like Figure 4 As shown, the computer device can input the main text information and the secondary text information into the target image generation model. The target image generation model can be a diffusion model, such as a latent diffusion model (LDM), a denoising diffusion probabilistic model (DDPM), etc., which is not limited in this embodiment of the present application. The target image generation model includes an image coding layer , text encoding layer , forward diffusion network layer FD, backward diffusion network layer BD and image decoding layer D. Image coding layer It can be the encoder in the variational auto encoder (VAE), the image decoding layer D can be the decoder in the variational auto encoder, the forward diffusion network layer FD and the backward diffusion network layer BD can be multiple noise prediction networks, and the text encoding layer It can be a text encoder, for example, a pre-trained image text encoding model (Contrastive Language-Image Pre-Training, CLIP), a Bayesian bidirectional encoder (Bidirectional Encoder Representations from Transformers, BERT), etc.

[0135] In the text encoding layer of the target image generation model In the main text information Encode the text to get the first encoding vector , for M secondary text information Encode the text to obtain M secondary encoding vectors. Concatenate the M secondary coding vectors with each other to obtain M second coding vectors For example, the M secondary coding vectors include secondary coding vector 1 and secondary coding vector 2. The service server can perform vector concatenation of the first coding vector and the secondary coding vector 1 to obtain the second coding vector 1, and perform vector concatenation of the first coding vector and the secondary coding vector 2 to obtain the second coding vector 2. Among them, the main text information Can be a textual hint describing the main object in the image, secondary textual information Can be a textual hint describing a secondary object in the image. Primary textual information and secondary text information All of them can be written in natural language to instruct and guide the target image generation model to learn and infer according to the text prompts to generate images that meet the text prompts. For example, the main text information can be "animation character", and the M secondary text information can include "indoor scene", "outdoor scene", etc.

[0136] Step S102, obtaining a potential noise vector, inputting the potential noise vector into a forward diffusion network layer in a target image generation model, and outputting a forward noise vector through the forward diffusion network layer;

[0137] For details, please refer to Figure 4 , Figure 4 This is a schematic diagram of a model structure proposed in the embodiment of the present application. Figure 1 ,like Figure 4As shown, the computer device can encode the Gaussian noise image N that satisfies the Gaussian distribution to obtain the potential noise vector Z, and forward diffuse the potential noise vector for T time steps (time step) through the forward diffusion network layer FD in the target image generation model to obtain the forward noise vector output by the forward diffusion network layer FD. . Among them, forward diffusion can refer to the process of adding noise on the potential noise vector Z, backward diffusion can refer to the process of predicting noise on the forward noise vector, and the time step is used to indicate the amplitude of added noise in forward diffusion and the amplitude of predicted noise in backward diffusion.

[0138] Step S103, inputting the forward noise vector into the backward diffusion network layer in the target image generation model, and creating M parallel upsampling processing paths through the backward diffusion network layer; the backward diffusion network layer is used to inject the first encoding vector in the first sampling stage, and is used to inject a second encoding vector into each upsampling processing path in the second sampling stage; the input of the second sampling stage includes the output of the first sampling stage;

[0139] For details, please refer to Figure 4 , Figure 4 This is a schematic diagram of a model structure proposed in the embodiment of the present application. Figure 1 ,like Figure 4 As shown, the computer device can transfer the forward noise vector The back diffusion network layer BD in the target image generation model is input, and M parallel upsampling processing paths are created through the back diffusion network layer BD. Each upsampling processing path can be a mutually independent unit processing space in the back diffusion network layer, and the M upsampling processing paths can perform back diffusion processing in parallel. Among them, the back diffusion network layer BD is used to inject the first encoding vector in the first sampling stage , and for injecting a second encoding vector into each upsampling processing path in the second sampling stage The back diffusion may include T time steps, and the back diffusion network layer BD includes noise prediction networks corresponding to T time steps respectively. , for example, when T is 3, the T noise prediction networks may include the noise prediction network , Noise Prediction Network and noise prediction network Each noise prediction network It may include a downsampling network layer, an intermediate sampling network layer and an upsampling network layer. The downsampling network layer and the intermediate sampling network layer may correspond to the first sampling stage, the upsampling network layer may correspond to the second sampling stage, the input of the intermediate sampling network layer is the output of the downsampling network layer, and the input of the upsampling network layer is the output of the intermediate sampling network layer. Noise prediction network It can be a network such as U-net, SegNet or DeepLab, and the embodiments of the present application are not limited here.

[0140] Predicting Networks with Noise Taking U-net as an example, the upsampling network layer, downsampling network layer and intermediate sampling network layer in the noise prediction network can all perform attention processing, but the feature dimensions corresponding to the attention processing are different. The query vector Q and the key vector K can be generated through the forward noise vector, and the value vector V can be generated through the injected vector. The query vector Q, the key vector K and the value vector V are processed with attention, and the result vector after the attention processing is input into the next noise prediction network connected, for example, the noise prediction network .

[0141] Noise Prediction Network The first encoding vector may be injected in the first sampling phase , a second encoding vector is injected into each upsampling processing path in the second sampling stage , so the forward noise vector In the upsampling process corresponding to the first sampling stage, the semantic information (concept information) of the main object can be kept consistent, and the first concept vector output by the upsampling network layer can be obtained. The intermediate sampling network layer can copy the first concept vector to obtain M identical first concept vectors, and the M first concept vectors are distributed to M parallel upsampling processing paths for upsampling processing. A second encoding vector injected into each upsampling processing path are different from each other, and each upsampling processing path is independent of each other. The second encoding vector is the first encoding vector The vector concatenation obtained by concatenating the secondary coding vector with the primary coding vector can further strengthen the consistency of the semantic information of the primary object in the upsampling process, and differentiate the characteristics of each upsampling process path through different secondary coding vectors to ensure the difference of the semantic information of the secondary object in the upsampling process, thereby ensuring that the M result vectors output by the M upsampling process paths The semantic information of the main objects is the same, while the semantic information of the secondary objects is different.

[0142] Step S104, generating business images corresponding to M upsampling processing paths respectively according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage; the main objects in the M business images are the same, and the secondary objects in the M business images are different from each other.

[0143] For details, please refer to Figure 4 , Figure 4This is a schematic diagram of a model structure proposed in the embodiment of the present application. Figure 1 ,like Figure 4 As shown, the computer equipment can predict the noise network The output result vector Continue with T-1 time steps of backward diffusion, noise prediction network The input to the noise prediction network is The output of each noise prediction network is injected into the first encoding vector in the first sampling stage. , inject M second encoding vectors in the second sampling stage , until the noise prediction network is obtained The output M result vectors , based on the image decoding layer D of the target image generation model, through M result vectors Generate M business images Among them, M business images The main objects in the same business images are the same. For example, the same “cartoon characters” may be included in M ​​business images. The secondary objects in the M business images are different from each other. For example, the environmental scenes of the "cartoon characters" in the M business images are different, for example, they may include "indoor scene", "outdoor scene" and so on.

[0144] The embodiment of the present application obtains a first encoding vector by text encoding the main text information, generates M second encoding vectors based on the first encoding vector and M secondary text information, wherein the main text information is a text prompt describing the main object in the image, the secondary text information is a text prompt describing the secondary object in the image, the secondary objects described by the M secondary text information are different from each other, and a second encoding vector is generated by the first encoding vector and a secondary text information. Obtain a potential noise vector, input the potential noise vector into the forward diffusion network layer in the target image generation model, output the forward noise vector through the forward diffusion network layer, and ensure the randomness and diversity of the generated image through the random potential noise vector. Input the forward noise vector into the backward diffusion network layer in the target image generation model, create M parallel upsampling processing paths through the backward diffusion network layer, the backward diffusion network layer is used to inject the first encoding vector in the first sampling stage, and is used to inject a second encoding vector into each upsampling processing path in the second sampling stage, and the input of the second sampling stage includes the output of the first sampling stage. According to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, business images corresponding to the M upsampling processing paths are generated. By injecting the first coding vector in the first sampling stage, the semantic information of the main object can be injected into the calculation of the upsampling process, so that the entire model can maintain the consistency and accuracy of the generation of the main object in the early stage of the generation process of multiple images. By constructing M parallel upsampling processing paths, different second coding vectors are injected in the second sampling stage for independent upsampling processing, and the characteristics of each upsampling processing path are differentiated. Since the second coding vector contains both the semantic information of the main object and the semantic information of the secondary object, the consistency of the main object can be further maintained, the accuracy of the consistency of the main objects in multiple images is improved, and the difference of the semantic information of the secondary objects in the upsampling process is guaranteed. Through the parallel processing of the M parallel upsampling processing paths, the generation of multiple business images with the same main object and different secondary objects can be completed at one time. The generation process no longer relies on manual operation, thereby reducing the technical cost of generating multiple consistent images and improving the generation efficiency of business images.

[0145] See also Figure 5 , Figure 5 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 2 The data processing method can be executed by a computer device, which can be Figure 1The service server 100 shown in the figure or any terminal device in the terminal device cluster. The following will take the data processing method executed by a computer device as an example for explanation. The data processing method may at least include the following steps S201-S207:

[0146] Step S201, input the main text information into the target image generation model; the target image generation model includes a text encoding layer; based on the text encoding layer, the main text information is split into text to obtain a word unit sequence corresponding to the main text information; a word unit in the word unit sequence refers to the smallest basic unit obtained after the text information is split; each word unit in the word unit sequence is encoded separately to obtain a first encoding vector.

[0147] Specifically, the computer device can obtain M object text information input by the object (user), and determine the main text information and the secondary text information in the M object text information. The computer device can determine the main text information and the secondary text information based on word frequency statistics. The process can be: obtain M object text information, perform word frequency statistics on the M object text information, determine the text information that appears in the M object text information as the main text information, and determine the text information other than the main text information in the object text information as the secondary text information.

[0148] Specifically, the computer device may perform word frequency statistics on the M object text information to obtain the word frequency corresponding to each text information (word). For example, among the M object text information, object text information 1 may be "animation character, outdoor scene", object text information 2 may be "animation character, outdoor scene", object text information 3 may be "animation character, ...", etc. If the word "animation character" is text information that appears in all M object text information, or is the text information with the highest word frequency, the computer device may determine "animation character" as the main text information, and determine the text information other than the main text information in the object text information (such as "indoor scene", "outdoor scene", etc.) as the secondary text information.

[0149] It can be understood that the main text information can also be multiple words, such as "anime character, girl, character name", etc. Multiple main text information can be used to represent the same main object, and to guide the model to more accurately identify the semantic information of the main object. The main text information and the secondary text information can be used to guide the generation direction of the entire model. When the main text information and the secondary text information are input into the model, the object concepts contained in the main text information and the secondary text information can be extracted as embedding features after encoding.

[0150] Optionally, the computer device can determine the main text information and the secondary text information in M ​​object text information based on the semantic recognition model, and the process can be: obtaining M object text information, performing text segmentation on the M object text information, and obtaining M word-gram sequences; a word-gram in the word-gram sequence refers to the smallest basic unit obtained after performing text segmentation on the object text information; performing feature extraction on the M word-gram sequences to obtain M object feature vectors, performing self-attention processing on the M object feature vectors to obtain M context semantic sequences; generating the main object probability and the secondary object probability corresponding to each word-gram in the M word-gram sequences based on the attention score corresponding to each word-gram in the M context semantic sequences, determining the main text information based on the main object probability corresponding to each word-gram in the M word-gram sequences, and determining the secondary text information based on the secondary object probability corresponding to each word-gram in the M word-gram sequences.

[0151] Specifically, the computer device can perform text tokenization on the M object text information through the semantic recognition model to obtain a word-unit sequence corresponding to the object text information. For example, if the object text information is "cartoon characters in outdoor scenes", the word-unit sequence corresponding to the object text information after removing pause words can be expressed as [cartoon characters, outdoor scenes]. Among them, [cartoon characters] and [outdoor scenes] are both word-units. A word-unit in the word-unit sequence refers to the smallest basic unit obtained after the main text information is split. The method of text splitting can be based on word splitting (word-based), character splitting (character-based), and subword splitting (subword-based), which is not limited in the embodiments of the present application.

[0152] The computer device can perform feature extraction on M word-meta sequences to obtain M object feature vectors, perform self-attention processing on the M object feature vectors to obtain M context semantic sequences, each context semantic sequence includes an attention score corresponding to each word-meta, and the computer device can generate a primary object probability and a secondary object probability corresponding to each word-meta in the M word-meta sequences based on the attention score corresponding to each word-meta in the M context semantic sequences, determine the word-meta with the largest primary object probability in the M word-meta sequences as primary text information, determine the text information other than the primary text information in the object text information as secondary text information, or determine the word-meta whose secondary object probability exceeds a certain threshold as secondary text information, and the embodiments of the present application are not limited here.

[0153] Optionally, when inputting text information, the user can directly determine whether a certain text information in the object text information belongs to the main text information and the secondary text information.

[0154] After distinguishing the main text information from the secondary text information, the computer device can input the main text information into the target image generation model, perform text splitting on the main text information at the text encoding layer of the target image generation model, obtain a word unit sequence corresponding to the main text information, and encode each word unit in the word unit sequence to obtain a first encoding vector.

[0155] The embodiment of the present application can automatically distinguish between the main text information and the secondary text information in the object text information input by the user, calculate the attention score of the context through the semantic recognition model, and accurately identify the main text information and the secondary text information, which can reduce the complexity of user input and improve the convenience of operation.

[0156] Step S202, generating M second encoding vectors based on the first encoding vector and the M secondary text information;

[0157] Specifically, the computer device may perform text encoding on the M secondary text information to obtain M secondary encoding vectors, and perform vector concatenation on the first encoding vector and the M secondary encoding vectors to obtain M second encoding vectors. For example, the M secondary encoding vectors include secondary encoding vector 1 and secondary encoding vector 2, and the service server may perform vector concatenation on the first encoding vector and the secondary encoding vector 1 to obtain second encoding vector 1, and perform vector concatenation on the first encoding vector and the secondary encoding vector 2 to obtain second encoding vector 2.

[0158] Step S203, obtain a Gaussian noise image, input the Gaussian noise image into the image coding layer in the target image generation model, perform feature extraction on the Gaussian noise image based on the image coding layer, and obtain a mean vector and a variance vector of the Gaussian noise image; perform random sampling on the mean vector and the variance vector of the Gaussian noise image to obtain a potential mean vector and a potential variance vector, and generate a potential noise vector based on the potential mean vector and the potential variance vector.

[0159] Specifically, in the image coding layer in the target image generation model, the computer device can perform feature extraction on the Gaussian noise image that satisfies the Gaussian distribution to obtain the mean vector and variance vector of the Gaussian noise image. The mean vector can be the average value of all pixel values ​​of the Gaussian noise image on each channel, that is, the first-order statistic of the Gaussian noise image, and the variance vector can be the average value of the variance of the pixel values ​​of each channel, that is, the second-order statistic of the Gaussian noise image.

[0160] The computer device can randomly sample the mean vector and variance vector of the Gaussian noise image to obtain a potential mean vector and a potential variance vector, and generate a potential noise vector based on the potential mean vector and the potential variance vector.

[0161] Step S204, in the forward diffusion network layer, obtain the latent variable distribution, based on the forward diffusion network layer, add the random noise vector to the latent noise vector in T time steps respectively, and obtain the forward noise vector; T is a positive integer, the latent variable distribution is the conceptual distribution of the added noise, the random noise vector is obtained by random sampling based on the latent variable distribution, the random noise vectors added in the T time steps are different, and the time step is used to indicate the amplitude of the added noise.

[0162] Specifically, in the forward diffusion network layer, the computer device can obtain the latent variable distribution. The latent variable distribution is a conceptual distribution of added noise, such as a Gaussian distribution. The computer device can continuously add a random noise vector to the latent noise vector in T time steps to obtain a forward noise vector. The time step refers to the amplitude of adding noise to the latent noise vector based on the latent variable distribution. Noise can refer to unnecessary or redundant interference information present in the image data. When T is large enough, the forward noise vector can be used to represent an image that contains noisy information completely.

[0163] Step S205, inputting the forward noise vector into the backward diffusion network layer in the target image generation model, and creating M parallel upsampling processing paths through the backward diffusion network layer; the backward diffusion network layer is used to inject the first encoding vector in the first sampling stage, and is used to inject a second encoding vector into each upsampling processing path in the second sampling stage; the input of the second sampling stage includes the output of the first sampling stage;

[0164] Specifically, the computer device can forward the noise vector The back diffusion network layer in the target image generation model is input, and M upsampling processing paths in parallel are created through the back diffusion network layer. Each upsampling processing path can be a mutually independent unit processing space in the back diffusion network layer, and the M upsampling processing paths can perform back diffusion processing in parallel.

[0165] Please also refer to Figure 6 , Figure 6 This is a schematic diagram of a model structure proposed in the embodiment of the present application. Figure 2 ,like Figure 6 As shown, the computer device can transfer the forward noise vector Input the back-diffusion network layer in the target image generation model. The back-diffusion network layer can be a noise prediction network. , noise prediction network It can be a network such as U-net, SegNet or DeepLab, and this embodiment of the present application does not limit this. The computer device can be in the noise prediction network Create M parallel upsampling processing paths in the noise prediction network Taking U-net as an example, in the noise prediction network The M upsampling processing paths connected in parallel may include an upsampling processing path , Upsampling Processing Path and upsampling processing path Each upsampling processing path can be a noise prediction network Independent units in upsampling layers process space.

[0166] When the target image generation model receives the object text information input by the user, it will automatically expand the number of unet up blocks required according to the number of secondary objects in the input object text information. The parameter weights of all expanded unet up block networks are inherited from the pretrained weight parameters in the target image generation model.

[0167] It can be understood that the embodiment of the present application constructs an innovative parallel upsampling processing path (U-net upblock) mechanism. By expanding multiple parallel upsampling processing paths and combining a multi-stage concept injection mechanism on the basis of the original diffusion model, it is possible to generate multiple images that maintain the consistency of the main objects at one time. The main objects contained in the image can maintain stable consistency, and only the secondary objects differ, so that multiple images of consistency can be generated in batches. The embodiment of the present application is a zero-shot (zero sample learning) method. Unlike the diffusion model, which requires additional fine-tuning training when it needs to generate multiple consistent images of different styles, the embodiment of the present application automatically constructs a parallel upsampling processing path mechanism in the model, and inputs the object text information of the image, so that multiple content-consistent pictures can be obtained through the parallel upsampling processing path in the model, which can ensure that the main objects in the generated images are consistent. No additional training is required in the whole process, and it does not rely on any data fine-tuning (finetune), thereby greatly improving the efficiency of the entire model in generating images, and increasing the portability and convenience of the model.

[0168] Step S206, injecting the first coding vector in the first sampling stage through the backward diffusion network layer, performing downsampling processing on the forward noise vector and the first coding vector injected in the first sampling stage, obtaining the first concept vector outputted in the first sampling stage, and respectively allocating the first concept vector to M upsampling processing paths;

[0169] For details, please refer to Figure 6 , Figure 6 This is a schematic diagram of a model structure proposed in the embodiment of the present application. Figure 2 ,like Figure 6 As shown, the noise prediction network It may include a down-sampling network layer (down block), an intermediate sampling network layer (midblock) and an up-sampling network layer (up block). The down-sampling network layer and the intermediate sampling network layer may correspond to the first sampling stage, the up-sampling network layer may correspond to the second sampling stage, the input of the intermediate sampling network layer is the output of the down-sampling network layer, and the input of the up-sampling network layer is the output of the intermediate sampling network layer.

[0170] Predicting Networks with Noise Take U-net as an example, the noise prediction network It includes a downsampling network layer, an intermediate sampling network layer and an upsampling network layer. The downsampling network layer and the intermediate sampling network layer can correspond to the first sampling stage, the upsampling network layer can correspond to the second sampling stage, and the input of the downsampling network layer is a forward noise vector , the input of the intermediate sampling network layer is the output of the downsampling network layer, the input of the upsampling network layer is the output of the intermediate sampling network layer, the downsampling network layer and the upsampling network layer can contain multiple network units (blocks), the intermediate sampling network layer can be a network unit, and each network unit can contain a jump connection layer (Resnet), a self-attention layer (Self-Attention Layer) and a cross-attention layer (Cross-Attention Layer). Among them, the jump connection layer is used to send the received vector to the connected network layer. The modules composed of each network unit are the same, but the corresponding feature dimension direction (that is, the parameter dimension in the network layer) is different, thereby realizing the sampling processing from down-mid-up.

[0171] Noise Prediction Network The first encoding vector can be injected into the cross-attention layer in each network unit in the down-sampling network layer and the intermediate sampling layer in the first sampling stage , feature fusion and downsampling (reducing feature dimension) are performed through the cross-attention processing of the cross-attention layer in each network unit.

[0172] The computer device can perform downsampling processing on the forward noise vector and the first encoding vector injected in the first sampling stage to obtain the first concept vector output in the first sampling stage, and the process can be: inputting the forward noise vector into the backward diffusion network layer; the backward diffusion network layer includes a noise prediction network; the noise prediction network includes a downsampling network layer, an intermediate sampling network layer and an upsampling network layer, the input of the intermediate sampling network layer is the output of the downsampling network layer, and the input of the upsampling network layer is the output of the intermediate sampling network layer; the downsampling network layer includes a first self-attention layer and a first cross-attention layer; in the first self-attention layer, performing self-attention processing on the forward noise vector to obtain a first self-attention result vector, and in the first cross-attention layer, performing cross-attention processing on the first self-attention result vector and the injected first encoding vector to obtain a first concept vector output in the first sampling stage; the feature dimension of the first concept vector is smaller than the feature dimension of the forward noise vector;

[0173] Specifically, the noise prediction network Take a network unit A in the downsampling network layer as an example, the network unit A includes a first connection layer (a skip connection layer corresponding to the network unit A), a first self-attention layer (a self-attention layer corresponding to the network unit A), and a first cross-attention layer (a cross-attention layer corresponding to the network unit A). The first connection layer can send the vector (which can be a forward noise vector) received by the network unit A to the skip connection layer corresponding to the connected network unit, for example, it can be the second connection layer (the skip connection layer corresponding to the network unit B) in a network unit B in the downsampling network layer.

[0174] The input of network unit A may be a forward noise vector. In the first self-attention layer, the computer device may perform self-attention processing on the forward noise vector to obtain a first self-attention result vector. In the first cross-attention layer, the first self-attention result vector and the injected first encoding vector may be cross-attention processed. Feature fusion and downsampling (reducing feature dimension) may be performed through the cross-attention processing to obtain a first cross-attention result vector. Network unit A may input the first cross-attention result vector into an intermediate sampling network layer, and continue to perform the same processing through the intermediate sampling network layer (which may be a network unit) to obtain a first concept vector output in the first sampling stage. The feature dimension of the first concept vector is smaller than the feature dimension of the forward noise vector.

[0175] The computer device performs cross-attention processing on the first self-attention result vector and the injected first encoding vector to obtain a first concept vector output in the first sampling stage. The process can be: performing a point multiplication operation on the first self-attention result vector and the query parameter matrix to obtain a query vector, performing a point multiplication operation on the first self-attention result vector and the key parameter matrix to obtain a key vector, performing a point multiplication operation on the first encoding vector and the value parameter matrix to obtain a value vector; generating an attention score vector based on the query vector and the key vector, performing dimensionality reduction processing on the attention score vector based on the dimension of the key vector, normalizing the reduced dimensionality attention score vector to obtain a normalized vector, and performing a point multiplication operation on the normalized vector and the value vector to obtain a first concept vector.

[0176] Specifically, taking the first concept vector obtained by cross-attention processing in the intermediate sampling network layer as an example, the computer device can combine the first self-attention result vector with the query parameter matrix Perform a dot multiplication to obtain the query vector Q, and add the first self-attention result vector to the key parameter matrix Perform a dot multiplication operation to obtain the key vector K, and add the first encoding vector to the value parameter matrix Perform a dot multiplication operation to obtain the value vector V. The computer device can use the query vector The result of the transpose operation with the key vector K Perform a dot multiplication operation to obtain the attention score vector. Based on the dimension value of the key vector K The square root of The attention score matrix is ​​reduced in dimension, and the attention score vector after dimension reduction is normalized to obtain a normalized vector. The normalized vector is multiplied with the value vector V to obtain the first concept vector. The first concept vector can be expressed as , the process can be shown as formula (1):

[0177] Formula (1)

[0178] It can be understood that the cross-attention processing can further integrate the first self-attention result vector with all the semantic representations in the injected first encoding vector, while making the representation of the generated object (business image) clearer and improving the noise reduction capability of the noise prediction network.

[0179] In the intermediate sampling network layer, the intermediate sampling network layer can copy the first concept vector and send the copied M first concept vectors to the connected M upsampling network layers (for example, the upsampling processing path , Upsampling Processing Path and upsampling processing path ).

[0180] Step S207: In the second sampling stage, a second coding vector is injected into each upsampling processing path respectively, and the first concept vector and the second coding vector injected in the second sampling stage are upsampled in each upsampling processing path respectively to obtain M second concept vectors outputted in the second sampling stage, and business images corresponding to the M upsampling processing paths are generated based on the M second concept vectors.

[0181] For details, please refer to Figure 6 , Figure 6 This is a data processing scenario proposed in the embodiment of the present application. Figure 2 ,like Figure 6 As shown, the noise prediction network The second encoding vector can be injected into the cross-attention layer in each network unit corresponding to each upsampling processing path in the second sampling stage , feature fusion and upsampling (restore feature dimension) are performed through the cross-attention processing of the cross-attention layer in each network unit, and the second concept vector corresponding to each of the M upsampling processing paths is obtained. When the backward diffusion network is a noise prediction network When the computer device decodes the M second concept vectors through the image decoding layer of the target image generation model, the business images corresponding to the M upsampling processing paths are generated.

[0182] The M upsampling processing paths include the target upsampling processing path. For example, in each upsampling processing path, upsampling processing is performed on the first concept vector and the second encoding vector injected in the second sampling stage, and the process of obtaining M second concept vectors output in the second sampling stage may include: inputting the first concept vector into the upsampling network layer; the upsampling network layer includes a second self-attention layer and a second cross-attention layer corresponding to the target upsampling processing path; in the second self-attention layer, self-attention processing is performed on the first concept vector to obtain a second self-attention result vector; in the second cross-attention layer, cross-attention processing is performed on the second self-attention result vector and the second encoding vector assigned to the target upsampling processing path to obtain a cross-attention result vector, and the second concept vector output by the target upsampling processing path is generated according to the cross-attention result vector; the feature dimension of the second concept vector is equal to the feature dimension of the forward noise vector.

[0183] For details, please refer to Figure 7 , Figure 7 This is a schematic diagram of a model structure proposed in the embodiment of the present application. Figure 3 ,like Figure 7 As shown, the downsampling processing path can be a downsampling network layer, Figure 7 The upsampling processing path in can be Figure 6 The target upsampling processing path among the M upsampling processing paths in , using noise prediction network Target upsampling processing path Take a network unit B in the downsampling processing path as an example, the network unit B includes a second connection layer (a skip connection layer corresponding to the network unit B), a second self-attention layer (a second self-attention layer corresponding to the network unit B), and a second cross-attention layer (a cross-attention layer corresponding to the network unit B). The first connection layer of the network unit A in the downsampling processing path and the target upsampling processing path The second connection layer of the network unit B is connected, and the second connection layer can obtain the forward noise vector sent by the network unit A through the first connection layer.

[0184] The input of network unit B can be the first concept vector. In the second self-attention layer, the computer device can perform self-attention processing on the first concept vector to obtain a second self-attention result vector. In the second cross-attention layer, the second self-attention result vector and the injected second encoding vector are cross-attention processed. Feature fusion and upsampling (restore feature dimension) are performed through cross-attention processing to obtain a second cross-attention result vector. Network unit B can perform feature fusion with the forward noise vector obtained by the second connection layer and the second cross-attention result vector, thereby restoring the same feature dimension as the forward noise vector and obtaining the target upsampling processing path. The second concept vector is outputted, wherein the feature dimension of the second concept vector is equal to the feature dimension of the forward noise vector.

[0185] The process by which a computer device can generate business images corresponding to M upsampling processing paths based on M second concept vectors can be: inputting the M second concept vectors into the image decoding layer of the target image generation model, in the image decoding layer, performing denoising processing on the potential noise vectors based on the M second concept vectors to obtain M denoised image vectors, and generating M business images based on the M denoised image vectors.

[0186] For details, please refer to Figure 6 , Figure 6 This is a data processing scenario proposed in the embodiment of the present application. Figure 2 ,like Figure 6 As shown, the noise prediction network The output M second concept vectors can be input to the image decoding layer of the target image generation model. In the image decoding layer, the computer device can perform noise reduction processing on the potential noise vectors based on the M second concept vectors, for example, through a noise prediction network The noise predicted by the output M second concept vectors is used to denoise the noisy image represented by the potential noise vector to obtain M denoised image vectors, and M business images (for example, business image 101, business image 102 and business image 103) are generated based on the M denoised image vectors.

[0187] It can be understood that the noise prediction network The first encoding vector may be injected in the first sampling phase , injects a second encoding vector into each upsampling processing path in the second sampling stage , so the forward noise vector In the upsampling process corresponding to the first sampling stage, the consistency of the semantic information of the main object can be maintained, and the first concept vector output by the upsampling network layer can be obtained. The intermediate sampling network layer can copy the first concept vector to obtain M identical first concept vectors, and the M first concept vectors are distributed to M parallel upsampling processing paths for upsampling processing. The second encoding vector injected into each upsampling processing path is are different from each other, and each upsampling processing path is independent of each other. The second encoding vector is the first encoding vector The first coding vector is obtained by concatenating the first coding vector with the secondary coding vector, which is obtained by integrating the additional secondary coding vector on the basis of the first coding vector. The consistency of the semantic information of the main object in the upsampling process can be further enhanced. The characteristics of each upsampling processing path can be differentiated by different secondary coding vectors, thereby ensuring the difference of the semantic information of the secondary objects in the upsampling process. It can be used to generate business images with consistent main objects but diverse secondary objects.

[0188] Optionally, the back diffusion may include T time steps, each time step may correspond to a noise prediction network, and each noise prediction network may create M parallel upsampling processing paths. Each upsampling processing path may be a mutually independent unit processing space in the noise prediction network, and the M upsampling processing paths may perform upsampling processing in parallel. , noise prediction network The input vector and the first encoding vector injected in the first sampling stage can be downsampled to obtain a noise prediction network The output of the M first concept vectors will be the noise prediction network The output M first concept vectors are respectively assigned to the noise prediction network The output of M upsampling processing paths. Among them, a first concept vector is assigned to an upsampling processing path; if i is 1, the input vector is a forward noise vector, and the M first concept vectors are the same; if i is greater than 1, the input vector includes the noise prediction network The output of M second concept vectors and one first concept vector are generated by the noise prediction network The noise prediction network is determined by a second concept vector outputted from the first encoding vector is the noise prediction network among T noise prediction networks The previous noise prediction network, noise prediction network The output of the noise prediction network For example, when T is 3, the T noise prediction networks may include the noise prediction network , Noise Prediction Network and noise prediction network .

[0189] In the second sampling stage, the noise prediction network Each upsampling processing path of is respectively injected with a second encoding vector, and the noise prediction network is respectively The output first concept vector and the injected second encoding vector are upsampled to obtain the noise prediction network Output M second concept vectors;

[0190] For example, the noise prediction network The second concept vector output can be the noise prediction network Please also refer to Figure 6 , Figure 6 This is a data processing scenario proposed in the embodiment of the present application. Figure 2 ,like Figure 6 As shown, the noise prediction network The network structure may include M parallel attention processing paths, each of which may include a downsampling processing path, an intermediate sampling processing path (i.e., a network unit corresponding to the intermediate sampling network layer), and an upsampling processing path. The downsampling processing path is serially connected to the intermediate sampling processing path, and the intermediate sampling processing path is serially connected to the upsampling processing path.

[0191] The M downsampling processing paths can be noise prediction networks The independent unit processing spaces in the network can perform downsampling processing in parallel. The M downsampling processing paths can also be a downsampling network layer. The downsampling network layer performs independent M downsampling processing, and the M noise prediction networks are obtained by connecting the intermediate sampling processing paths. The first concept vector of the downsampling process can refer to the specific description of the above step S206, and the embodiment of the present application will not be repeated here. Noise prediction network The M upsampling processing paths in the above example can obtain the corresponding first concept vectors through the connected intermediate sampling processing paths, and the first concept vectors obtained by each upsampling processing path are different from each other. The M upsampling processing paths can perform upsampling processing independently in parallel to obtain the noise prediction network. The up-sampling process of the output M second concept vectors can refer to the specific description of the above step S207, and will not be repeated here in this embodiment of the present application.

[0192] If i is T, the computer device can predict the network based on the noise Output of M second concept vector generation and noise prediction network The M upsampling processing paths respectively correspond to the business images.

[0193] It can be understood that the embodiment of the present application constructs a method for automatically generating multiple text maps, which can generate multiple images that maintain consistency of the main object at one time based on the main text information and the secondary text information. This method is a fully automated generation method. It only requires the user to input the object text information of the image, and the model can automatically distinguish the main text information from the secondary text information, and inject the corresponding semantic information at different stages to generate multiple images with consistent main objects. The embodiment of the present application innovatively constructs a multi-stage concept injection method and a combination mechanism of parallel upsampling processing paths. Based on the main text information and the secondary text information, multiple images with consistent main objects are generated at the same time. While keeping the main object consistent, the personalized generation of the secondary objects of each image can also be controlled, so that the entire model can generate multiple images with consistent main objects but diverse sequences at one time.

[0194] Optionally, the vectors injected in the first sampling stage and the second sampling stage of the embodiment of the present application may be vectors obtained by image coding, that is, the embodiment of the present application may also instruct and guide the target image generation model to learn and infer according to the input image to generate multiple business images that conform to the input image through the image coding vector. For example, the user may input multiple main object images consistent with the main object and secondary object images about the secondary object, the main object image may be a photo of a person, and the secondary object image may be a photo of a natural scenery or an urban environment, the target image generation model may encode the main object image into a coding vector carrying the semantic information of the main object through the image text encoder, inject it in the first sampling stage, encode the main object image and the secondary object image into a coding vector carrying the semantic information of the main object and the secondary object, and inject it in the second sampling stage, thereby realizing the feature fusion of the semantic information of the image, which can greatly improve the richness of the secondary object, and can more accurately guide the generation of the main object, providing a variety of input methods, and improving the feasibility of the embodiment of the present application.

[0195] The embodiment of the present application can automatically distinguish the main text information and the secondary text information in the object text information input by the user, perform text encoding on the main text information to obtain a first encoding vector, generate M second encoding vectors based on the first encoding vector and M secondary text information, obtain a potential noise vector, input the potential noise vector into the forward diffusion network layer in the target image generation model, output the forward noise vector through the forward diffusion network layer, and ensure the randomness and diversity of the generated image through the random potential noise vector. The forward noise vector is input into the backward diffusion network layer in the target image generation model, and M parallel upsampling processing paths are created through the backward diffusion network layer. The backward diffusion network layer is used to inject the first encoding vector in the first sampling stage, and is used to inject a second encoding vector into each upsampling processing path in the second sampling stage. By injecting the first encoding vector in the first sampling stage, the semantic information of the main object can be injected into the calculation of the upsampling process, so that the entire model can maintain the consistency and accuracy of the generation of the main object in the early stage of the generation process of multiple images. By constructing M parallel upsampling processing paths, different second encoding vectors are injected in the second sampling stage for independent upsampling processing, and the characteristics of each upsampling processing path are differentiated. The cross-attention processing in the upsampling process can further integrate the first self-attention result vector with all semantic representations in the injected first encoding vector. At the same time, it can make the performance of the generated object (business image) clearer and improve the noise reduction ability of the noise prediction network.

[0196] Since the second coding vector contains both the semantic information of the main object and the semantic information of the secondary object, the consistency of the main object can be further maintained, the accuracy of the consistency of the main objects in multiple images is improved, and the difference of the semantic information of the secondary objects in the upsampling process is guaranteed. Through the parallel processing of M parallel upsampling processing paths, the generation of multiple business images with the same main object and different secondary objects can be completed at one time. The generation process no longer relies on manual operation, thereby reducing the technical cost of generating multiple consistent images and improving the generation efficiency of business images. After the model automatically constructs the parallel upsampling processing path mechanism, the embodiment of the present application inputs the object text information of the image, and multiple content consistency pictures can be obtained through the parallel upsampling processing paths in the model, which can ensure the consistency of the main objects in the generated images. No additional training is required in the whole process, and it does not rely on any data fine-tuning, thereby greatly improving the efficiency of the entire model in generating images, and increasing the portability and convenience of the model.

[0197] See also Figure 8 , Figure 8 Schematic diagram of a data processing device provided in an embodiment of the present application. Figure 8 As shown, the data processing device 1 includes a text encoding module 810 , a forward diffusion module 820 , a path processing module 830 and an image generation module 840 .

[0198] The text encoding module 810 is used to perform text encoding on the primary text information to obtain a first encoding vector, and generate M second encoding vectors based on the first encoding vector and M secondary text information; M is a positive integer, the primary text information is a text prompt describing a primary object in the image, the secondary text information is a text prompt describing a secondary object in the image, and the secondary objects described by the M secondary text information are different from each other; one second encoding vector is generated by the first encoding vector and one secondary text information;

[0199] A forward diffusion module 820 is used to obtain a potential noise vector, input the potential noise vector to a forward diffusion network layer in a target image generation model, and output a forward noise vector through the forward diffusion network layer;

[0200] A path processing module 830 is used to input the forward noise vector into a backward diffusion network layer in the target image generation model, and create M parallel upsampling processing paths through the backward diffusion network layer; the backward diffusion network layer is used to inject a first encoding vector in the first sampling stage, and is used to inject a second encoding vector into each upsampling processing path in the second sampling stage; the input of the second sampling stage includes the output of the first sampling stage;

[0201] The image generation module 840 is used to generate business images corresponding to M upsampling processing paths respectively according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage; the main objects in the M business images are the same, and the secondary objects in the M business images are different from each other.

[0202] In a possible implementation, the image generation module 840 is used to generate business images corresponding to M upsampling processing paths respectively according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, and is specifically used to perform the following operations:

[0203] Injecting a first coding vector in the first sampling stage through a backward diffusion network layer, downsampling the forward noise vector and the first coding vector injected in the first sampling stage to obtain a first concept vector output in the first sampling stage, and respectively allocating the first concept vector to M upsampling processing paths;

[0204] In the second sampling stage, a second coding vector is injected into each upsampling processing path respectively, and the first concept vector and the second coding vector injected in the second sampling stage are upsampled in each upsampling processing path respectively to obtain M second concept vectors outputted in the second sampling stage, and business images corresponding to the M upsampling processing paths are generated based on the M second concept vectors.

[0205] In a possible implementation, the image generation module 840 is used to perform downsampling processing on the forward noise vector and the first encoding vector injected in the first sampling stage to obtain the first conceptual vector output in the first sampling stage, and specifically to perform the following operations:

[0206] The forward noise vector is input into the backward diffusion network layer; the backward diffusion network layer includes a noise prediction network; the noise prediction network includes a downsampling network layer, an intermediate sampling network layer and an upsampling network layer, the input of the intermediate sampling network layer is the output of the downsampling network layer, and the input of the upsampling network layer is the output of the intermediate sampling network layer; the downsampling network layer includes a first self-attention layer and a first cross-attention layer;

[0207] In the first self-attention layer, the forward noise vector is self-attention processed to obtain a first self-attention result vector. In the first cross-attention layer, the first self-attention result vector and the injected first encoding vector are cross-attention processed to obtain a first concept vector output in the first sampling stage. The feature dimension of the first concept vector is smaller than the feature dimension of the forward noise vector.

[0208] The image generation module 840 is further configured to perform the following operations:

[0209] The first concept vectors are replicated based on the intermediate sampling network layer, and the replicated M first concept vectors are sent to an up-sampling network layer for outputting M second concept vectors in a second sampling stage.

[0210] In a possible implementation, the image generation module 840 is used to perform cross-attention processing on the first self-attention result vector and the injected first encoding vector in the first cross-attention layer to obtain the first concept vector output in the first sampling stage, specifically to perform the following operations:

[0211] Perform a dot multiplication operation on the first self-attention result vector and the query parameter matrix to obtain a query vector, perform a dot multiplication operation on the first self-attention result vector and the key parameter matrix to obtain a key vector, and perform a dot multiplication operation on the first encoding vector and the value parameter matrix to obtain a value vector;

[0212] An attention score vector is generated based on the query vector and the key vector. The attention score vector is reduced in dimension based on the dimension of the key vector. The reduced-dimensional attention score vector is normalized to obtain a normalized vector. The normalized vector is point-multiplied with the value vector to obtain the first concept vector.

[0213] In a possible implementation, the M upsampling processing paths include a target upsampling processing path; the image generation module 840 is used to perform upsampling processing on the first concept vector and the second encoding vector injected in the second sampling stage in each upsampling processing path, and when the M second concept vectors outputted in the second sampling stage are obtained, specifically perform the following operations:

[0214] Inputting the first concept vector into an upsampling network layer; the upsampling network layer includes a second self-attention layer and a second cross-attention layer corresponding to the target upsampling processing path;

[0215] In the second self-attention layer, the first concept vector is self-attention processed to obtain a second self-attention result vector;

[0216] In the second cross-attention layer, cross-attention processing is performed on the second self-attention result vector and the second encoding vector assigned to the target upsampling processing path to obtain a cross-attention result vector, and a second concept vector output by the target upsampling processing path is generated based on the cross-attention result vector; the feature dimension of the second concept vector is equal to the feature dimension of the forward noise vector.

[0217] In a possible implementation, the back-diffusion network layer includes T noise prediction networks, where T is a positive integer; each noise prediction network is used to inject a first encoding vector in a first sampling stage, and to inject a second encoding vector into each upsampling processing path in a second sampling stage; the T noise prediction networks include a noise prediction network , i is a positive integer less than or equal to T; the image generation module 840 is used to generate business images corresponding to M upsampling processing paths respectively according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, and is specifically used to perform the following operations:

[0218] Feed the input vector into the noise prediction network , through the noise prediction network The input vector and the first encoding vector injected in the first sampling stage are downsampled to obtain a noise prediction network The output of the M first concept vectors will be the noise prediction network The output M first concept vectors are respectively assigned to the noise prediction network The output of M upsampling processing paths; a first concept vector is assigned to an upsampling processing path; if i is 1, the input vector is a forward noise vector, and the M first concept vectors are the same; if i is greater than 1, the input vector includes the noise prediction network The output of M second concept vectors and one first concept vector are generated by the noise prediction network The noise prediction network is determined by a second concept vector outputted from the first encoding vector is the noise prediction network among T noise prediction networks The previous noise prediction network, noise prediction network The output of the noise prediction network Input;

[0219] In the second sampling stage, the noise prediction network Each upsampling processing path of is respectively injected with a second encoding vector, and the noise prediction network is respectively The output first concept vector and the injected second encoding vector are upsampled to obtain the noise prediction network Output M second concept vectors;

[0220] If i is T, then based on the noise prediction network Output of M second concept vector generation and noise prediction network The M upsampling processing paths respectively correspond to the business images.

[0221] In a possible implementation, when the image generation module 840 is used to generate the service images corresponding to the M upsampling processing paths respectively based on the M second concept vectors, it is specifically used to perform the following operations:

[0222] The M second concept vectors are input into the image decoding layer of the target image generation model. In the image decoding layer, the potential noise vectors are denoised based on the M second concept vectors to obtain M denoised image vectors, and M business images are generated based on the M denoised image vectors.

[0223] In a possible implementation, when the text encoding module 810 is used to perform text encoding on the main text information to obtain the first encoding vector, it is specifically used to perform the following operations:

[0224] Inputting main text information into a target image generation model; the target image generation model includes a text encoding layer;

[0225] Based on the text encoding layer, the main text information is split to obtain a word unit sequence corresponding to the main text information; a word unit in the word unit sequence refers to the smallest basic unit obtained after the text information is split;

[0226] Each word in the word sequence is encoded separately to obtain a first encoding vector.

[0227] In a possible implementation, when the forward diffusion module 820 is used to obtain the potential noise vector, it is specifically used to perform the following operations:

[0228] Obtain a Gaussian noise image, input the Gaussian noise image into an image coding layer in a target image generation model, perform feature extraction on the Gaussian noise image based on the image coding layer, and obtain a mean vector and a variance vector of the Gaussian noise image;

[0229] Random sampling is performed in the mean vector and variance vector of the Gaussian noise image to obtain a potential mean vector and a potential variance vector, and a potential noise vector is generated based on the potential mean vector and the potential variance vector.

[0230] In a possible implementation, the forward diffusion module 820 is used to input the potential noise vector into the forward diffusion network layer in the target image generation model, and when the forward noise vector is output through the forward diffusion network layer, it is specifically used to perform the following operations:

[0231] In the forward diffusion network layer, the latent variable distribution is obtained. Based on the forward diffusion network layer, random noise vectors are added to the latent noise vector in T time steps to obtain the forward noise vector. T is a positive integer, the latent variable distribution is the conceptual distribution of the added noise, the random noise vector is obtained by random sampling based on the latent variable distribution, the random noise vectors added in T time steps are different, and the time step is used to indicate the amplitude of the added noise.

[0232] In a possible implementation, the text encoding module 810 is further configured to perform the following operations:

[0233] M object text information is obtained, word frequency statistics are performed on the M object text information, text information that appears in all the M object text information is determined as primary text information, and text information other than the primary text information in the object text information is determined as secondary text information.

[0234] In a possible implementation, the text encoding module 810 is further configured to perform the following operations:

[0235] Obtaining M object text information, performing text segmentation on the M object text information, and obtaining M word-unit sequences; a word-unit in the word-unit sequence refers to the smallest basic unit obtained after performing text segmentation on the object text information;

[0236] Perform feature extraction on M word-unit sequences to obtain M object feature vectors, perform self-attention processing on the M object feature vectors to obtain M context semantic sequences;

[0237] Based on the attention score corresponding to each word in the M context semantic sequences, the primary object probability and the secondary object probability corresponding to each word in the M word sequences are generated respectively. Based on the primary object probability corresponding to each word in the M word sequences, the primary text information is determined. Based on the secondary object probability corresponding to each word in the M word sequences, the secondary text information is determined.

[0238] The embodiment of the present application can automatically distinguish the main text information and the secondary text information in the object text information input by the user, perform text encoding on the main text information to obtain a first encoding vector, generate M second encoding vectors based on the first encoding vector and M secondary text information, obtain a potential noise vector, input the potential noise vector into the forward diffusion network layer in the target image generation model, output the forward noise vector through the forward diffusion network layer, and ensure the randomness and diversity of the generated image through the random potential noise vector. The forward noise vector is input into the backward diffusion network layer in the target image generation model, and M parallel upsampling processing paths are created through the backward diffusion network layer. The backward diffusion network layer is used to inject the first encoding vector in the first sampling stage, and is used to inject a second encoding vector into each upsampling processing path in the second sampling stage. By injecting the first encoding vector in the first sampling stage, the semantic information of the main object can be injected into the calculation of the upsampling process, so that the entire model can maintain the consistency and accuracy of the generation of the main object in the early stage of the generation process of multiple images. By constructing M parallel upsampling processing paths, different second encoding vectors are injected in the second sampling stage for independent upsampling processing, and the characteristics of each upsampling processing path are differentiated. The cross-attention processing in the upsampling process can further integrate the first self-attention result vector with all semantic representations in the injected first encoding vector. At the same time, it can make the performance of the generated object (business image) clearer and improve the noise reduction ability of the noise prediction network.

[0239] Since the second coding vector contains both the semantic information of the main object and the semantic information of the secondary object, the consistency of the main object can be further maintained, the accuracy of the consistency of the main objects in multiple images is improved, and the difference of the semantic information of the secondary objects in the upsampling process is guaranteed. Through the parallel processing of M parallel upsampling processing paths, the generation of multiple business images with the same main object and different secondary objects can be completed at one time. The generation process no longer relies on manual operation, thereby reducing the technical cost of generating multiple consistent images and improving the generation efficiency of business images. After the model automatically constructs the parallel upsampling processing path mechanism, the embodiment of the present application inputs the object text information of the image, and multiple content consistency pictures can be obtained through the parallel upsampling processing paths in the model, which can ensure the consistency of the main objects in the generated images. No additional training is required in the whole process, and it does not rely on any data fine-tuning, thereby greatly improving the efficiency of the entire model in generating images, and increasing the portability and convenience of the model.

[0240] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0241] See also Fig. 9 , Fig. 9 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig. 9 As shown, the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Fig. 9 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.

[0242] In such Fig. 9 In the computer device 1000 shown, the network interface 1004 can provide a network communication network element; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0243] Performing text encoding on the primary text information to obtain a first encoding vector, generating M second encoding vectors based on the first encoding vector and M secondary text information; M is a positive integer, the primary text information is a text prompt describing a primary object in the image, the secondary text information is a text prompt describing a secondary object in the image, and the secondary objects described by the M secondary text information are different from each other; a second encoding vector is generated by the first encoding vector and one secondary text information;

[0244] Obtaining a potential noise vector, inputting the potential noise vector into a forward diffusion network layer in a target image generation model, and outputting a forward noise vector through the forward diffusion network layer;

[0245] Inputting the forward noise vector into a backward diffusion network layer in the target image generation model, creating M parallel upsampling processing paths through the backward diffusion network layer; the backward diffusion network layer is used to inject a first encoding vector in a first sampling stage, and is used to inject a second encoding vector into each upsampling processing path in a second sampling stage; the input of the second sampling stage includes the output of the first sampling stage;

[0246] According to the forward noise vector, the first coding vector injected in the first sampling stage and the M second coding vectors injected in the second sampling stage, business images corresponding to the M upsampling processing paths are generated; the main objects in the M business images are the same, and the secondary objects in the M business images are different from each other.

[0247] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 and Figure 5 The description of the data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here.

[0248] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program, and when the processor executes the computer program, it can execute the above Figure 3 and Figure 5 The description of the above data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.

[0249] The computer-readable storage medium may be the data processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been displayed or is to be displayed.

[0250] In addition, it should be noted that: the embodiment of the present application also provides a computer program product, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above Figure 3 and Figure 5 Any method provided by the corresponding embodiment.

[0251] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other step units inherent to these processes, methods, devices, products, or equipment.

[0252] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of network elements in the above description. Whether these network elements are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described network elements for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0253] The method and related apparatus provided by the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided by the embodiment of the present application. Specifically, each process and / or box in the method flow chart and / or structural diagram, as well as the combination of the processes and / or boxes in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable device to generate a machine, so that the instructions executed by the processor of the computer or other programmable device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide the functions for implementing the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

[0254] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0255] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0256] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A data processing method, characterized in that: include: Performing text encoding on the primary text information to obtain a first encoding vector, generating M second encoding vectors based on the first encoding vector and M secondary text information; M is a positive integer, the primary text information is a text prompt describing a primary object in the image, the secondary text information is a text prompt describing a secondary object in the image, and the secondary objects described by the M secondary text information are different from each other; one second encoding vector is generated by the first encoding vector and one secondary text information; Obtaining a potential noise vector, inputting the potential noise vector into a forward diffusion network layer in a target image generation model, and outputting a forward noise vector through the forward diffusion network layer; Inputting the forward noise vector into a backward diffusion network layer in the target image generation model, and creating M parallel upsampling processing paths through the backward diffusion network layer; The backward diffusion network layer is used to inject the first coding vector in the first sampling stage, and to inject a second coding vector for each upsampling processing path in the second sampling stage; the input of the second sampling stage includes the output of the first sampling stage; each upsampling processing path is a mutually independent unit processing space in the backward diffusion network layer; the first sampling stage includes a downsampling network layer and an intermediate sampling network layer, and the second sampling stage includes an upsampling network layer; the downsampling network layer, the intermediate sampling network layer, and the M upsampling processing paths in the upsampling network layer belong to a noise prediction network; the input of the intermediate sampling network layer is the output of the downsampling network layer, and the inputs of the M upsampling processing paths are all the output of the intermediate sampling network layer; Based on the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, business images corresponding to the M upsampling processing paths are generated; the main objects in the M business images are the same, and the secondary objects in the M business images are different from each other.

2. The method according to claim 1, characterized in that: The generating, according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, service images corresponding to the M upsampling processing paths respectively include: Injecting the first coding vector in the first sampling stage through the backward diffusion network layer, downsampling the forward noise vector and the first coding vector injected in the first sampling stage to obtain the first concept vector output in the first sampling stage, and respectively allocating the first concept vector to the M upsampling processing paths; In the second sampling stage, a second coding vector is injected into each upsampling processing path respectively, and the first concept vector and the second coding vector injected in the second sampling stage are upsampled in each upsampling processing path respectively to obtain M second concept vectors output by the second sampling stage, and business images corresponding to the M upsampling processing paths are generated based on the M second concept vectors.

3. The method according to claim 2, characterized in that The downsampling process is performed on the forward noise vector and the first coding vector injected in the first sampling stage to obtain the first concept vector output in the first sampling stage, including: Input the forward noise vector into the backward diffusion network layer; the backward diffusion network layer includes a noise prediction network; the noise prediction network includes a downsampling network layer, an intermediate sampling network layer and an upsampling network layer, the input of the intermediate sampling network layer is the output of the downsampling network layer, and the input of the upsampling network layer is the output of the intermediate sampling network layer; the downsampling network layer includes a first self-attention layer and a first cross-attention layer; In the first self-attention layer, the forward noise vector is subjected to self-attention processing to obtain a first self-attention result vector, and in the first cross-attention layer, the first self-attention result vector and the injected first encoding vector are subjected to cross-attention processing to obtain a first concept vector output in the first sampling stage; the feature dimension of the first concept vector is smaller than the feature dimension of the forward noise vector; The method further comprises: The first concept vectors are replicated based on the intermediate sampling network layer, and the replicated M first concept vectors are sent to the up-sampling network layer for outputting M second concept vectors in the second sampling stage.

4. The method according to claim 3, characterized in that In the first cross-attention layer, cross-attention processing is performed on the first self-attention result vector and the injected first encoding vector to obtain a first concept vector output in the first sampling stage, including: Perform a dot multiplication operation on the first self-attention result vector and the query parameter matrix to obtain a query vector, perform a dot multiplication operation on the first self-attention result vector and the key parameter matrix to obtain a key vector, and perform a dot multiplication operation on the first encoding vector and the value parameter matrix to obtain a value vector; An attention score vector is generated based on the query vector and the key vector, the attention score vector is dimensionally reduced based on the dimension of the key vector, the reduced-dimensional attention score vector is normalized to obtain a normalized vector, and a dot product operation is performed on the normalized vector and the value vector to obtain a first concept vector.

5. The method according to claim 3, characterized in that: The M upsampling processing paths include a target upsampling processing path; in each upsampling processing path, upsampling the first concept vector and the second encoding vector injected in the second sampling stage is performed respectively to obtain M second concept vectors output in the second sampling stage, including: Inputting the first concept vector into the upsampling network layer; the upsampling network layer includes a second self-attention layer and a second cross-attention layer corresponding to the target upsampling processing path; In the second self-attention layer, performing self-attention processing on the first concept vector to obtain a second self-attention result vector; In the second cross-attention layer, cross-attention processing is performed on the second self-attention result vector and the second encoding vector assigned to the target upsampling processing path to obtain a cross-attention result vector, and a second concept vector output by the target upsampling processing path is generated based on the cross-attention result vector; the feature dimension of the second concept vector is equal to the feature dimension of the forward noise vector.

6. The method according to claim 1, characterized in that The back diffusion network layer includes T noise prediction networks, where T is a positive integer; each noise prediction network is used to inject the first encoding vector in the first sampling stage, and to inject a second encoding vector into each upsampling processing path in the second sampling stage; the T noise prediction networks include a noise prediction network , i is a positive integer less than or equal to T; generating service images corresponding to the M upsampling processing paths respectively according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage, including: Input the input vector into the noise prediction network , through the noise prediction network Downsampling is performed on the input vector and the first encoding vector injected in the first sampling stage to obtain the noise prediction network The output of the M first concept vectors is used to predict the noise The outputted M first concept vectors are respectively assigned to the noise prediction network output of M upsampling processing paths; a first concept vector is assigned to an upsampling processing path; if i is 1, the input vector is the forward noise vector, and the M first concept vectors are the same; if i is greater than 1, the input vector includes the noise prediction network The output of M second concept vectors and one first concept vector are generated by the noise prediction network The noise prediction network is determined by a second concept vector outputted from the first coding vector and the first coding vector. is the noise prediction network in the T noise prediction networks A noise prediction network, the noise prediction network The output of the noise prediction network is Input; In the second sampling stage, the noise prediction network Each upsampling processing path of the noise prediction network is respectively injected with a second encoding vector, and in each upsampling processing path, the noise prediction network is respectively The output first concept vector and the injected second encoding vector are upsampled to obtain the noise prediction network Output M second concept vectors; If i is T, then based on the noise prediction network The output of the M second concept vectors is generated with the noise prediction network The M upsampling processing paths respectively correspond to the business images.

7. The method according to claim 2, characterized in that The generating, based on the M second concept vectors, service images respectively corresponding to the M upsampling processing paths comprises: The M second concept vectors are input into the image decoding layer of the target image generation model. In the image decoding layer, the potential noise vectors are denoised based on the M second concept vectors to obtain M denoised image vectors, and M business images are generated based on the M denoised image vectors.

8. The method according to claim 1, characterized in that The step of performing text encoding on the main text information to obtain a first encoding vector includes: Inputting main text information into a target image generation model; the target image generation model includes a text encoding layer; Based on the text encoding layer, the main text information is split into texts to obtain a word unit sequence corresponding to the main text information; a word unit in the word unit sequence refers to the smallest basic unit obtained after the text information is split; Each word in the word-unit sequence is encoded to obtain a first encoding vector.

9. The method according to claim 1, characterized in that: The obtaining of the potential noise vector comprises: Obtaining a Gaussian noise image, inputting the Gaussian noise image into an image coding layer in a target image generation model, performing feature extraction on the Gaussian noise image based on the image coding layer, and obtaining a mean vector and a variance vector of the Gaussian noise image; Random sampling is performed in the mean vector and the variance vector of the Gaussian noise image to obtain a potential mean vector and a potential variance vector, and a potential noise vector is generated based on the potential mean vector and the potential variance vector.

10. The method according to claim 1, characterized in that The step of inputting the potential noise vector into a forward diffusion network layer in a target image generation model and outputting a forward noise vector through the forward diffusion network layer comprises: In the forward diffusion network layer, a latent variable distribution is obtained. Based on the forward diffusion network layer, a random noise vector is added to the latent noise vector in T time steps respectively to obtain a forward noise vector; T is a positive integer, the latent variable distribution is a conceptual distribution of added noise, the random noise vector is obtained by random sampling based on the latent variable distribution, the random noise vectors added in T time steps are different from each other, and the time step is used to indicate the amplitude of the added noise.

11. The method according to claim 1, characterized in that: Also includes: M object text information is obtained, word frequency statistics are performed on the M object text information, text information that appears in the M object text information is determined as primary text information, and text information in the object text information other than the primary text information is determined as secondary text information.

12. The method according to claim 1, characterized in that Also includes: Acquire M object text information, perform text segmentation on the M object text information, and obtain M word-unit sequences; a word-unit in the word-unit sequence refers to the smallest basic unit obtained after the object text information is segmented; Performing feature extraction on the M word-unit sequences to obtain M object feature vectors, and performing self-attention processing on the M object feature vectors to obtain M context semantic sequences; Based on the attention score corresponding to each word in the M context semantic sequences, the primary object probability and the secondary object probability corresponding to each word in the M word sequences are generated; based on the primary object probability corresponding to each word in the M word sequences, the primary text information is determined; based on the secondary object probability corresponding to each word in the M word sequences, the secondary text information is determined.

13. A data processing device, characterized in that: include: A text encoding module, configured to perform text encoding on primary text information to obtain a first encoding vector, and generate M second encoding vectors based on the first encoding vector and M secondary text information; M is a positive integer, the primary text information is a text prompt describing a primary object in an image, the secondary text information is a text prompt describing a secondary object in the image, and the secondary objects described by the M secondary text information are different from each other; a second encoding vector is generated by the first encoding vector and one secondary text information; A forward diffusion module, used for obtaining a potential noise vector, inputting the potential noise vector into a forward diffusion network layer in a target image generation model, and outputting a forward noise vector through the forward diffusion network layer; A path processing module, used for inputting the forward noise vector into the backward diffusion network layer in the target image generation model, and creating M parallel upsampling processing paths through the backward diffusion network layer; The backward diffusion network layer is used to inject the first coding vector in the first sampling stage, and to inject a second coding vector for each upsampling processing path in the second sampling stage; the input of the second sampling stage includes the output of the first sampling stage; each upsampling processing path is a mutually independent unit processing space in the backward diffusion network layer; the first sampling stage includes a downsampling network layer and an intermediate sampling network layer, and the second sampling stage includes an upsampling network layer; the downsampling network layer, the intermediate sampling network layer, and the M upsampling processing paths in the upsampling network layer belong to a noise prediction network; the input of the intermediate sampling network layer is the output of the downsampling network layer, and the inputs of the M upsampling processing paths are all the output of the intermediate sampling network layer; An image generation module is used to generate business images corresponding to the M upsampling processing paths respectively according to the forward noise vector, the first coding vector injected in the first sampling stage, and the M second coding vectors injected in the second sampling stage; the main objects in the M business images are the same, and the secondary objects in the M business images are different from each other.

14. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method described in any one of claims 1-12.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 12.

16. A computer program product, characterized in that The computer program product comprises a computer program, which is stored in a computer-readable storage medium and is suitable for being read and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 12.