Image generation method and device

By extracting the features of images and text, selecting the most suitable literary graphics model for image generation, solving the problem of poor image quality in the prior art that the most suitable model is not selected based on the input, and achieving higher quality image generation.

CN119540381APending Publication Date: 2025-02-28BEIJING LONGZHI DIGITAL TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411514543.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The prior art cannot select the most suitable literary graphics model based on the input, resulting in poor quality of generated images.

Method used

By obtaining the reference image and text description of the target image to be generated, the text characteristics of the text description and the style characteristics of the reference image and the image characteristics of the reference image are extracted. Based on these features, multiple text-based graph models are identified from the model library, and after fusion, the model with the highest rating of the target text prompt word is selected for image generation.

Benefits of technology

Improve the quality of generated images and adapt to diverse input and output needs by selecting the most suitable literary graphics model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540381A_ABST
    Figure CN119540381A_ABST
Patent Text Reader

Abstract

The invention provides an image generation method and device. The method comprises the following steps: acquiring a reference image and text description of a to-be-generated target image; extracting text features of the text description, and extracting style features and image features of the reference image; determining a plurality of text graph models from a model library based on the text features to obtain a first set; determining a plurality of text graph models from a model library based on the style features and the image features to obtain a second set; fusing the first set and the second set to obtain a third set; determining a target text cue word most similar to the text description from a text cue score library, and determining a model with the highest score of using the target text cue word from a plurality of text graph models in a third set to obtain a target text graph model; and according to the reference image and the text description, generating a target image by using the target text graph model. By means of the technical means, the problem that in the prior art, the most appropriate text graph model cannot be selected according to input, and consequently the quality of the generated image is poor can be solved, and the quality of the generated image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image generation method and device. Background Art

[0002] In the field of image generation, diffusion models have made significant progress, promoted the development of image editing and stylization techniques, and inspired the rise of a series of community platforms such as Civitai and WebUI, providing a space for designers and creators to communicate and collaborate. These advances are not only reflected in the technical level, but also promote the surge of open source models, opening up new possibilities for the future of image generation technology. However, although these models perform well in specific tasks, they still have limitations in processing diverse inputs and providing diverse outputs. Different vincent graph models are often good at processing different types of images and prompts. There is currently no method to select the most appropriate vincent graph model based on the input, which limits the potential of vincent graphs in a wider range of application scenarios. Summary of the invention

[0003] In view of this, the embodiments of the present application provide an image generation method, device, electronic device and computer-readable storage medium to solve the problem in the prior art that the most appropriate text image model cannot be selected according to the input, resulting in poor generated image quality.

[0004] In a first aspect of an embodiment of the present application, an image generation method is provided, including: obtaining a reference image and a text description of a target image to be generated; extracting text features of the text description, and extracting style features and image features of the reference image; determining multiple text graph models from a model library based on the text features to obtain a first set; determining multiple text graph models from the model library based on the style features and the image features to obtain a second set; fusing the first set and the second set to obtain a third set; determining a target text prompt word that is most similar to the text description from a text prompt scoring library, and determining a model with the highest score using the target text prompt word from multiple text graph models in the third set to obtain a target text graph model; and generating a target image using the target text graph model based on the reference image and the text description.

[0005] According to a second aspect of an embodiment of the present application, an image generation device is provided, including: an acquisition module configured to acquire a reference image and a text description of a target image to be generated; an extraction module configured to extract text features of the text description, and extract style features and image features of the reference image; a first determination module configured to determine a plurality of text graph models from a model library based on the text features to obtain a first set; a second determination module configured to determine a plurality of text graph models from the model library based on the style features and the image features to obtain a second set; a fusion module configured to fuse the first set and the second set to obtain a third set; a third determination module configured to determine a target text prompt word that is most similar to the text description from a text prompt scoring library, and determine a model with the highest score using the target text prompt word from a plurality of text graph models in the third set to obtain a target text graph model; and a generation module configured to generate a target image using the target text graph model based on the reference image and the text description.

[0006] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0007] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0008] Compared with the prior art, the embodiments of the present application have the following beneficial effects: obtaining a reference image and a text description of a target image to be generated; extracting text features of the text description, and extracting style features and image features of the reference image; determining multiple text graph models from a model library based on text features to obtain a first set; determining multiple text graph models from a model library based on style features and image features to obtain a second set; fusing the first set and the second set to obtain a third set; determining the target text prompt words that are most similar to the text description from a text prompt scoring library, and determining the model with the highest score using the target text prompt words from multiple text graph models in the third set to obtain a target text graph model; generating a target image using the target text graph model based on the reference image and text description. The above technical means can solve the problem in the prior art that the most appropriate text graph model cannot be selected according to the input, resulting in poor quality of the generated image, thereby improving the quality of the generated image. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 any creative work.

[0010] Figure 1 It is a flowchart of an image generation method provided in an embodiment of the present application;

[0011] Figure 2 is a flowchart of another image generation method provided in an embodiment of the present application;

[0012] Figure 3 is a structural schematic diagram of an image generating device provided in an embodiment of the present application;

[0013] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0014] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0015] An image generating method and device according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.

[0016] Figure 1 It is a flowchart of an image generation method provided in an embodiment of the present application. Figure 1 The image generation method can be executed by a computer or a server, or software on a computer or a server. Figure 1 As shown, the image generation method includes:

[0017] S101, obtaining a reference image and a text description of a target image to be generated;

[0018] S102, extracting text features of the text description, and extracting style features and image features of the reference image;

[0019] S103, determining a plurality of text graph models from a model library based on text features to obtain a first set;

[0020] S104, determining a plurality of text-based graph models from a model library based on the style features and the image features to obtain a second set;

[0021] S105, merging the first set and the second set to obtain a third set;

[0022] S106, determining the target text prompt word that is most similar to the text description from the text prompt score library, and determining the model with the highest score using the target text prompt word from the multiple text graph models in the third set, to obtain a target text graph model;

[0023] S107, generating a target image using a target text-generated graph model according to the reference image and the text description.

[0024] The reference image and text description are the user's input. The target text-generated graph model needs to generate a target image that meets the personalized effect of the text description on the basis of ensuring the key features of the reference image. The text description describes the effect of generating the target image that the user expects in the form of text.

[0025] Large Language Models (LLMs) can be used to extract text features of text descriptions, and multimodal pre-training models (Bootstrapping Language-Image Pre-training, BLIP) can be used to extract style features and image features of reference images. The style features of the reference image are the unique features of the reference image visually, which can be the use of color, line processing, composition, theme selection, and overall aesthetic feeling. The image features of the reference image are obtained by encoding the reference image using the multimodal pre-training model.

[0026] A plurality of text graph models are stored in the model library, and the first set and the second set include the plurality of text graph models. Based on the text features, a plurality of text graph models are determined from the model library as the first set. Based on the style features and the image features, a plurality of text graph models are determined from the model library as the second set. The first set and the second set are fused to obtain a third set. Fusion of the first set and the second set includes merging the first set and the second set together, and then removing duplicate text graph models.

[0027] The text prompt scoring library stores multiple text prompt words and the scores of each text graph model using each text prompt word, that is, the user's score of the image generated by each text graph model guided by each text prompt word. The target text prompt word that is most similar to the text description is determined from the text prompt scoring library (it can be determined by calculating the similarity between the text description and each text prompt word), and the model with the highest score using the target text prompt word is determined from the multiple text graph models in the third set as the target text graph model. The reference image and the text description are input into the target text graph model to generate the target image.

[0028] According to the technical solution provided in the embodiment of the present application, a reference image and a text description of the target image to be generated are obtained; text features of the text description are extracted, and style features and image features of the reference image are extracted; multiple text graph models are determined from the model library based on the text features to obtain a first set; multiple text graph models are determined from the model library based on the style features and image features to obtain a second set; the first set and the second set are fused to obtain a third set; the target text prompt words that are most similar to the text description are determined from the text prompt scoring library, and the model with the highest score using the target text prompt words is determined from the multiple text graph models in the third set to obtain the target text graph model; based on the reference image and the text description, the target image is generated using the target text graph model. The above technical means can solve the problem in the prior art that the most appropriate text graph model cannot be selected according to the input, resulting in poor quality of the generated image, thereby improving the quality of the generated image.

[0029] Furthermore, based on the text features, multiple text graph models are determined from the model library to obtain a first set, including: obtaining description information of each text graph model in the model library; constructing a model thinking tree of each text graph model according to the description information of each text graph model; based on the text features, traversing the model thinking tree of each text graph model by a breadth-first search method to determine multiple text graph models and obtain the first set.

[0030] Furthermore, a model thinking tree of each text graph model is constructed according to the description information of each text graph model, including: the description information of each text graph model includes the application scenario, category and style of the text graph model; for each text graph model: constructing a scene tree layer of the text graph model according to the application scenario of the text graph model; constructing a category tree layer of the text graph model according to the category of the text graph model; constructing a style tree layer of the text graph model according to the style of the text graph model; assembling the scene tree layer, classification tree layer and style tree layer of the text graph model in order from top to bottom to obtain the model thinking tree of the text graph model.

[0031] The description information of a text graph model includes information describing the application scenario, category, style, etc. of the text graph model. The features of the information describing the application scenario of the text graph model are extracted as the scene tree layer of the text graph model. The features of the information describing the category of the text graph model are extracted as the category tree layer of the text graph model. The features of the information describing the style of the text graph model are extracted as the style tree layer of the text graph model. The model thinking tree of the text graph model includes three layers, which are the scene tree layer, the classification tree layer, and the style tree layer from top to bottom. Extracting features of the information describing the application scenario, category, style, etc. of the text graph model is similar to extracting text features of text descriptions, which will not be repeated here.

[0032] Furthermore, based on text features, the model thinking tree of each text graph model is traversed by a breadth-first search method to determine multiple text graph models and obtain a first set, including: based on text features, the scene tree layer, classification tree layer and style tree layer of the model thinking tree of each text graph model are traversed by a breadth-first search method to determine multiple text graph models whose model thinking tree is most similar to the text features and obtain a first set.

[0033] Breadth-First Search (BFS) is an algorithm for traversing or searching a tree. Text features can be used as input search terms, and breadth-first search can be used to match the closest model mind tree for the search term, that is, to match the closest multiple text graph models for the search term to obtain the first set.

[0034] Furthermore, based on the style features and the image features, multiple text-based graph models are determined from the model library to obtain a second set, including: obtaining images generated by each text-based graph model in the model library; constructing model features of each text-based graph model according to the images generated by each text-based graph model; based on the style features, the image features and the model features of each text-based graph model, multiple text-based graph models are determined from the model library to obtain a second set.

[0035] Furthermore, based on the style features, image features and model features of each text graph model, multiple text graph models are determined from the model library to obtain a second set, including: the model features of each text graph model include model style features and model image features; calculating the first similarity between the style features and the model style features of each text graph model; calculating the second similarity between the image features and the model image features of each text graph model; weighted summing the first similarity and the second similarity corresponding to each text graph model to obtain a third similarity corresponding to each text graph model; and determining multiple text graph models with the highest third similarity from the model library to obtain a second set.

[0036] Extracting the model style features and the model image features is similar to extracting the style features and the image features of the reference image, respectively, and will not be repeated here. The first similarity and the second similarity can both be cosine similarity.

[0037] Furthermore, based on the reference image and the text description, a target image is generated using a target text graph model, including: obtaining a text prompt word example of the target text graph model; performing text enhancement on the text description according to the text prompt word example; and generating a target image using the target text graph model based on the reference image and the text description after text enhancement.

[0038] The text prompt word examples of the target text graph model are preset for the target text graph model in advance, and the target text graph model can understand the best text prompt word examples. The text description is enhanced according to the text prompt word examples, which is to convert the text description into the form of text prompt word examples. Finally, the reference image and the text description after text enhancement are input into the target text graph model to generate the target image.

[0039] Figure 2 FIG. 1 is a flow chart of another image generation method provided in an embodiment of the present application. Figure 2 As shown, the method includes:

[0040] S201, obtaining a reference image and a text description of a target image to be generated;

[0041] S202, extracting text features of the text description, and extracting style features and image features of the reference image;

[0042] S203, determining a plurality of text graph models from a model library based on text features to obtain a first set;

[0043] S204, determining a plurality of text-based graph models from a model library based on the style features and the image features to obtain a second set;

[0044] S205, combining the first set and the second set to obtain a third set;

[0045] S206, determining the target text prompt word that is most similar to the text description from the text prompt score library, and determining the model with the highest score using the target text prompt word from the plurality of text graph models in the third set, to obtain a target text graph model;

[0046] S207, obtaining text prompt word examples of the target text graph model;

[0047] S208, performing text enhancement on the text description according to the text prompt word examples;

[0048] S209, generating a target image using a target text-generated graph model according to the reference image and the text description after text enhancement.

[0049] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.

[0050] The following is an embodiment of the device of the present application, which can be used to implement the embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the present application.

[0051] Figure 3 Schematic diagram of an image generating device provided in an embodiment of the present application. Figure 3As shown, the image generating device comprises:

[0052] An acquisition module 301 is configured to acquire a reference image and a text description of a target image to be generated;

[0053] An extraction module 302 is configured to extract text features of the text description, and extract style features and image features of the reference image;

[0054] A first determination module 303 is configured to determine a plurality of text graph models from a model library based on text features to obtain a first set;

[0055] A second determination module 304 is configured to determine a plurality of cultural graph models from the model library based on the style features and the image features to obtain a second set;

[0056] A fusion module 305 is configured to fuse the first set and the second set to obtain a third set;

[0057] The third determination module 306 is configured to determine the target text prompt word that is most similar to the text description from the text prompt score library, and determine the model with the highest score using the target text prompt word from the multiple text graph models in the third set to obtain the target text graph model;

[0058] The generating module 307 is configured to generate a target image using a target text graph model according to the reference image and the text description.

[0059] According to the technical solution provided in the embodiment of the present application, a reference image and a text description of the target image to be generated are obtained; text features of the text description are extracted, and style features and image features of the reference image are extracted; multiple text graph models are determined from the model library based on the text features to obtain a first set; multiple text graph models are determined from the model library based on the style features and image features to obtain a second set; the first set and the second set are fused to obtain a third set; the target text prompt words that are most similar to the text description are determined from the text prompt scoring library, and the model with the highest score using the target text prompt words is determined from the multiple text graph models in the third set to obtain the target text graph model; based on the reference image and the text description, the target image is generated using the target text graph model. The above technical means can solve the problem in the prior art that the most appropriate text graph model cannot be selected according to the input, resulting in poor quality of the generated image, thereby improving the quality of the generated image.

[0060] In some embodiments, the first determination module 303 is further configured to obtain description information of each text graph model in the model library; construct a model thinking tree of each text graph model according to the description information of each text graph model; and traverse the model thinking tree of each text graph model through a breadth-first search method based on text features to determine multiple text graph models and obtain a first set.

[0061] In some embodiments, the first determination module 303 is also configured so that the description information of each text graph model includes the application scenario, category and style of the text graph model; for each text graph model: construct a scene tree layer of the text graph model according to the application scenario of the text graph model; construct a category tree layer of the text graph model according to the category of the text graph model; construct a style tree layer of the text graph model according to the style of the text graph model; assemble the scene tree layer, classification tree layer and style tree layer of the text graph model in order from top to bottom to obtain the model thinking tree of the text graph model.

[0062] The description information of a text graph model includes information describing the application scenario, category, style, etc. of the text graph model. The features of the information describing the application scenario of the text graph model are extracted as the scene tree layer of the text graph model. The features of the information describing the category of the text graph model are extracted as the category tree layer of the text graph model. The features of the information describing the style of the text graph model are extracted as the style tree layer of the text graph model. The model thinking tree of the text graph model includes three layers, which are the scene tree layer, the classification tree layer, and the style tree layer from top to bottom. Extracting features of the information describing the application scenario, category, style, etc. of the text graph model is similar to extracting text features of text descriptions, which will not be repeated here.

[0063] In some embodiments, the first determination module 303 is also configured to traverse the scene tree layer, classification tree layer and style tree layer of the model thinking tree of each text graph model based on text features through a breadth-first search method to determine multiple text graph models whose model thinking tree is most similar to the text features to obtain a first set.

[0064] Breadth-First Search (BFS) is an algorithm for traversing or searching a tree. Text features can be used as input search terms, and breadth-first search can be used to match the closest model mind tree for the search term, that is, to match the closest multiple text graph models for the search term to obtain the first set.

[0065] In some embodiments, the second determination module 304 is further configured to obtain images generated by each culture graph model in the model library; construct model features of each culture graph model according to the images generated by each culture graph model; and determine multiple culture graph models from the model library based on style features, image features and model features of each culture graph model to obtain a second set.

[0066] In some embodiments, the second determination module 304 is further configured such that the model features of each culture graph model include model style features and model image features; calculate the first similarity between the style features and the model style features of each culture graph model; calculate the second similarity between the image features and the model image features of each culture graph model; weightedly sum the first similarity and the second similarity corresponding to each culture graph model to obtain the third similarity corresponding to each culture graph model; determine from the model library multiple culture graph models with the highest corresponding third similarity to obtain a second set.

[0067] Extracting the model style features and the model image features is similar to extracting the style features and the image features of the reference image, respectively, and will not be repeated here. The first similarity and the second similarity can both be cosine similarity.

[0068] In some embodiments, the generation module 307 is further configured to obtain text prompt word examples of the target text graph model; perform text enhancement on the text description according to the text prompt word examples; and generate a target image using the target text graph model based on the reference image and the text description after text enhancement.

[0069] The text prompt word examples of the target text graph model are preset for the target text graph model in advance, and the target text graph model can understand the best text prompt word examples. The text description is enhanced according to the text prompt word examples, which is to convert the text description into the form of text prompt word examples. Finally, the reference image and the text description after text enhancement are input into the target text graph model to generate the target image.

[0070] In some embodiments, the generation module 307 is further configured to obtain a reference image and a text description of a target image to be generated; extract text features of the text description, and extract style features and image features of the reference image; determine multiple text graph models from a model library based on the text features to obtain a first set; determine multiple text graph models from a model library based on the style features and the image features to obtain a second set; fuse the first set and the second set to obtain a third set; determine the target text prompt words that are most similar to the text description from a text prompt scoring library, and determine the model with the highest score using the target text prompt words from multiple text graph models in the third set to obtain a target text graph model; obtain text prompt word examples of the target text graph model; perform text enhancement on the text description according to the text prompt word examples; and generate a target image using the target text graph model based on the reference image and the text description after text enhancement.

[0071] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0072] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present application. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0073] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 The electronic device 4 is merely an example and does not limit the electronic device 4 , and may include more or less components than those shown in the figure, or different components.

[0074] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0075] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. The memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.

[0076] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.

[0077] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.

[0078] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. An image generation method, characterized in that: include: Obtain a reference image and text description of the target image to be generated; Extracting text features of the text description, and extracting style features and image features of the reference image; Determine a plurality of text graph models from a model library based on the text features to obtain a first set; Determining a plurality of cultural graph models from the model library based on the style features and the image features to obtain a second set; Merging the first set and the second set to obtain a third set; Determine a target text prompt word that is most similar to the text description from a text prompt score library, and determine a model that has the highest score using the target text prompt word from a plurality of text graph models in the third set, to obtain a target text graph model; The target image is generated by using the target text graph model according to the reference image and the text description.

2. The method according to claim 1, characterized in that: Based on the text features, multiple text graph models are determined from a model library to obtain a first set, including: Obtaining description information of each document model in the model library; Construct a model thinking tree of each document graph model according to the description information of each document graph model; Based on the text features, the model thinking tree of each text graph model is traversed by a breadth-first search method to determine multiple text graph models to obtain the first set.

3. The method according to claim 2, characterized in that According to the description information of each document graph model, a model thinking tree of each document graph model is constructed, including: The description information of each document graph model includes the application scenario, category and style of the document graph model; For each Wensheng graph model: Constructing a scene tree layer of the text-generated graph model according to the application scenario of the text-generated graph model; Constructing a category tree layer of the text-generated graph model according to the category of the text-generated graph model; Constructing a style tree layer of the text-generated graph model according to the style of the text-generated graph model; The scene tree layer, classification tree layer and style tree layer of the text-generated graph model are assembled in order from top to bottom to obtain a model thinking tree of the text-generated graph model.

4. The method according to claim 3, characterized in that Based on the text features, the model thinking tree of each document graph model is traversed by a breadth-first search method to determine multiple document graph models, and the first set is obtained, including: Based on the text features, the scene tree layer, classification tree layer and style tree layer of the model thinking tree of each text graph model are traversed by the breadth-first search method to determine multiple text graph models whose model thinking trees are most similar to the text features, and obtain the first set.

5. The method according to claim 1, characterized in that Based on the style feature and the image feature, a plurality of cultural graph models are determined from the model library to obtain a second set, including: Obtain images generated by each text graph model in the model library; Constructing model features of each culture graph model according to the images generated by each culture graph model; Based on the style feature, the image feature and the model features of each culture graph model, a plurality of culture graph models are determined from the model library to obtain the second set.

6. The method according to claim 5, characterized in that Based on the style feature, the image feature, and the model features of each culture graph model, a plurality of culture graph models are determined from the model library to obtain the second set, including: The model features of each text-based graph model include model style features and model image features; Calculating a first similarity between the style feature and the model style features of each text graph model; Calculating a second similarity between the image feature and the model image features of each cultural graph model; A weighted sum of the first similarity and the second similarity corresponding to each culture graph model is obtained to obtain a third similarity corresponding to each culture graph model; A plurality of cultural graph models corresponding to the third highest similarity are determined from the model library to obtain the second set.

7. The method according to claim 1, characterized in that Generating the target image using the target text graph model according to the reference image and the text description includes: Obtaining text prompt word examples of the target text graph model; Performing text enhancement on the text description according to the text prompt word examples; The target image is generated using the target text graph model according to the reference image and the text description after text enhancement.

8. An image generating device, characterized in that: include: An acquisition module is configured to acquire a reference image and a text description of a target image to be generated; An extraction module configured to extract text features of the text description, and extract style features and image features of the reference image; A first determination module is configured to determine a plurality of text graph models from a model library based on the text feature to obtain a first set; A second determination module is configured to determine a plurality of cultural graph models from the model library based on the style feature and the image feature to obtain a second set; a fusion module, configured to fuse the first set and the second set to obtain a third set; A third determination module is configured to determine a target text prompt word that is most similar to the text description from a text prompt score library, and determine a model that has the highest score using the target text prompt word from a plurality of text graph models in a third set, to obtain a target text graph model; A generating module is configured to generate the target image using the target text graph model according to the reference image and the text description.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • AI agent-based text drawing method, system and device

    CN120147483A

  • Dynamic content generation method and device

    CN120163152A

  • Natural-language-driven artificial intelligence sub-mirror drawing method and natural-language-driven artificial intelligence sub-mirror drawing system

    CN120279126A

  • Image generation method and device, equipment and storage medium

    CN120279131A