Picture material batch generation method and device, equipment and medium
By receiving prompt word generation requests and confirming the target scene, using multiple image generation models to generate and filter image materials, the problems of high time-consuming and uneven image materials are solved, and efficient and high-quality image materials are achieved batch generation.
Patent Information
- Application Number
- CN202411485880.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-14
AI Technical Summary
Traditional marketing poster design relies on professional designers, is time-consuming and costly, and the quality of the picture materials generated based on stable diffusion of literary and artistic graphic technology is uneven, making it difficult to directly apply to marketing posters.
By receiving a prompt word generation request and confirming the target scene, multiple prompt texts are generated in batches, and the target generation model that matches the target scene is called from multiple pre-trained image generation models, generating multiple initial image materials, and press The preset scoring strategy is used to score multi-dimensionally and filter out the target image material.
The stylized batch generation and screening of picture materials has been realized, the efficiency and quality of picture materials have been improved, and the need to quickly respond to market changes in the financial technology field and other fields has been met.
Smart Images

Figure CN119444897A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image generation technology and financial technology, and in particular to a method, device, equipment and medium for batch generating picture materials. Background Art
[0002] Traditional marketing poster design relies on professional designers to make it by hand, which is time-consuming and costly. For the financial sector, which needs to respond quickly to market changes or design a large number of posters, the efficiency of this method is obviously not enough to meet the needs.
[0003] Although the text-generated image technology based on stable diffusion (SD) can improve the efficiency of image generation to a certain extent, due to the randomness of the generation process, users may need to make multiple attempts to obtain results that meet the needs of marketing scenarios. In addition, the quality of the generated image materials is often uneven and difficult to be directly applied to marketing posters. Therefore, how to improve the efficiency and quality of image material generation for marketing posters is a problem that needs to be solved urgently. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a method, device, equipment and medium for batch generation of picture materials that can be applied to financial technology or other related fields. Its main purpose is to improve the efficiency and quality of batch generation of picture materials through automated batch generation of picture materials and intelligent screening.
[0005] The technical solution of the present invention is as follows:
[0006] A first aspect of the present invention provides a method for batch generating picture materials, comprising:
[0007] Receive a prompt word generation request and confirm the current target scene, and batch generate multiple prompt texts according to the prompt word generation request and the target scene;
[0008] Calling a target generation model that matches the target scene from a plurality of pre-trained image generation models, wherein the plurality of image generation models have different generation styles;
[0009] Inputting the plurality of prompt texts into the target generation model to batch generate a plurality of initial picture materials;
[0010] The multiple initial picture materials are scored in multiple dimensions according to a preset scoring strategy, and target picture materials are screened out from the multiple initial picture materials according to the scoring results.
[0011] A second aspect of the present invention provides a device for batch generating picture materials, comprising:
[0012] A receiving and generating module, used for receiving a prompt word generation request and confirming a current target scene, and batch generating a plurality of prompt texts according to the prompt word generation request and the target scene;
[0013] A model calling module, used to call a target generation model matching the target scene from a plurality of pre-trained image generation models, wherein the plurality of image generation models have different generation styles;
[0014] A batch generation module, used for inputting the plurality of prompt texts into the target generation model to batch generate a plurality of initial picture materials;
[0015] The scoring and screening module is used to perform multi-dimensional scoring on the multiple initial picture materials according to a preset scoring strategy, and screen out target picture materials from the multiple initial picture materials according to the scoring results.
[0016] A third aspect of the present invention provides a computer device, comprising at least one processor; and
[0017] a memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for batch generating picture materials.
[0019] A fourth aspect of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the one or more processors can execute the above-mentioned method for batch generating image materials.
[0020] Beneficial effects: The present invention discloses a method, device, equipment and medium for batch generation of picture materials. Compared with the prior art, the embodiment of the present invention receives a prompt word generation request and confirms the current target scene, and batch generates multiple prompt texts according to the prompt word generation request and the target scene; calls a target generation model that matches the target scene from multiple pre-trained picture generation models, and the multiple picture generation models have different generation styles; inputs the multiple prompt texts into the target generation model to batch generate multiple initial picture materials; performs multi-dimensional scoring on the multiple initial picture materials according to a preset scoring strategy, and selects target picture materials from the multiple initial picture materials according to the scoring results. By batch generating multiple prompt texts and calling a picture generation model that matches the target scene, it is possible to batch generate multiple picture materials under the target scene, and perform multi-dimensional intelligent scoring on the initial picture materials, thereby realizing batch generation and screening of stylized picture materials and improving the efficiency and quality of batch generation of picture materials. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the scheme in the present invention, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 A schematic diagram of an application environment of the method for batch generating picture materials provided by an embodiment of the present invention;
[0023] Figure 2 A flow chart of a method for batch generating picture materials provided by an embodiment of the present invention;
[0024] Figure 3 A flow chart of step S202 in the method for batch generating picture materials provided in an embodiment of the present invention;
[0025] Figure 4 A flow chart of step S202 in the method for batch generating picture materials provided in an embodiment of the present invention;
[0026] Figure 5 A flow chart of step S204 in the method for batch generating picture materials provided by an embodiment of the present invention;
[0027] Figure 6 A schematic diagram of the functional modules of a device for batch generating picture materials provided by an embodiment of the present invention;
[0028] Figure 7 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. The embodiments of the present invention are described below in conjunction with the accompanying drawings.
[0030] The method for batch generating picture materials provided by the embodiment of the present invention can be applied to Figure 1 In the application environment of FIG. 1 , it includes a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0031] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only as examples).
[0032] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0033] The server 105 may be a server that provides various services, such as a background server that provides support for the content browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (for example only). The background server may analyze and process the received data such as the user request, and feed back the processing results (such as web pages, information, or data obtained or generated according to the user request) to the terminal device. The server 105 may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server 105 may also be a server for a distributed system, or a server combined with a blockchain.
[0034] It should be noted that the picture material batch generation method provided in the embodiment of the present application can generally be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the picture material batch generation device provided in the embodiment of the present invention can also be set in the first terminal device 101, the second terminal device 102 or the third terminal device 103. Alternatively, the picture material batch generation method provided in the embodiment of the present invention can also generally be executed by the server 105. Accordingly, the picture material batch generation device provided in the embodiment of the present invention can generally be set in the server 105.
[0035] It should be understood that the numbers of the above terminal devices, networks and servers are only illustrative. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0036] like Figure 2 As shown, the method for batch generating picture materials provided by the embodiment of the present invention specifically includes the following steps:
[0037] S201, receiving a prompt word generation request and confirming a current target scene, and batch generating a plurality of prompt texts according to the prompt word generation request and the target scene.
[0038] In this embodiment, when the image material generation is realized based on the stable diffusion Wenshengtu technology, the corresponding prompt text needs to be input as the condition of the model generation process according to the application requirements of the material, so as to generate image materials that meet the requirements of different application scenarios. The user can input the corresponding prompt word generation request according to different application scenarios, such as financial report cover design, financial product promotion advertisements, financial data visualization display, etc. The prompt word generation request carries the corresponding material generation requirements, and then based on the prompt word generation request and the target scene, multiple prompt texts are generated in batches, and corresponding generation prompts are provided from different angles through multiple prompt texts, so as to efficiently generate multiple image materials that meet the requirements of the target scene.
[0039] For example, when a prompt word generation request is received and it is confirmed that the current target scenario is the design of a financial report cover, prompt text 1 can be generated: "Please design an annual financial report cover. The background should include a picture of the iconic building A and a rising economic growth chart. Please use a dark blue and gold color scheme, ensure that the title is clear and prominent, and adopt a simple and clear composition style", prompt text 2: "Please design an investment strategy analysis report cover. The background should include a picture of financial center B. Please use a dark gray and bright orange color scheme, and the composition should be balanced and harmonious, while highlighting the key data and title of the report". By generating multiple prompt texts containing generation requirements under the target scenario, it helps to guide the image generation model to batch generate multiple image materials that meet the requirements, thereby improving generation efficiency and diversity.
[0040] S202: Calling a target generation model that matches the target scene from a plurality of pre-trained image generation models, wherein the plurality of image generation models have different generation styles.
[0041] In this embodiment, multiple image generation models are pre-trained and fine-tuned, and multiple image generation models have different generation styles. The specific image generation model can adopt a Wenshengtu model based on stable diffusion. One or more models can be fine-tuned under the same generation style, that is, each image generation model can correspond to a generation style alone, or two or more image generation models can correspond to a generation style at the same time. This embodiment does not limit this. After determining the target scene, matching is performed based on the target scene and the generation style of each image generation model, so as to call the target generation model that matches the target scene. For example, when the target scene is a financial report cover design, the required generation style is more inclined to business and formal style; when the target scene is a financial product promotion advertisement, the required generation style can be flexibly adjusted in combination with the product applicable group, for example, young groups can tend to be cute style, fresh style, middle-aged and elderly groups can tend to be classical style, etc.; when the target scene is a visual display of financial data, the required generation style is more inclined to academic style, etc. Through this model matching method, different image generation models can be selected and adjusted according to different application scenarios and target audiences to produce the best visual effect and communication effect.
[0042] S203: input the plurality of prompt texts into the target generation model to generate a plurality of initial picture materials in batches.
[0043] In this embodiment, after calling the target generation model of the corresponding style, multiple prompt texts are input into the target generation model, so that the target generation model generates multiple initial picture materials that meet the prompt text requirements under the constraints of the prompt text. Specifically, since one or more models can be fine-tuned under the same generation style, the number of target generation models called can be one or more. When generating multiple initial picture materials, multiple prompt texts can be input into one target generation model in sequence, or multiple prompt texts can be input into multiple target generation models, or the same prompt text can be input into multiple target generation models at the same time. Multiple initial picture materials can be obtained efficiently, and a large number of candidate designs can be quickly obtained, providing a basis for subsequent screening.
[0044] S204: Perform multi-dimensional scoring on the plurality of initial picture materials according to a preset scoring strategy, and select target picture materials from the plurality of initial picture materials according to the scoring results.
[0045] In this embodiment, the user can pre-set a scoring strategy, which may include multiple dimensions such as color richness, composition rationality, and theme relevance, so that the generated initial picture materials can be scored in multiple dimensions based on the scoring strategy, and specifically, a machine learning algorithm can be used, such as using a convolutional neural network (CNN) to evaluate the visual quality of the picture, etc. The target picture materials are screened out from multiple initial picture materials based on the multi-dimensional scoring results. For example, each dimension is set to have a full score of 10 points. If there are currently 4 dimensions, that is, a total score of 40 points, pictures with a total score of more than 30 points can be selected as target picture materials. Through multi-dimensional intelligent evaluation and screening, the quality of the picture materials can be more comprehensively evaluated to ensure that the target picture materials finally selected are more in line with user needs and aesthetics, thereby improving the quality of batch-generated picture materials.
[0046] In the above embodiment, the present invention discloses a method for batch generation of picture materials, which receives a prompt word generation request and confirms the current target scene, batch generates multiple prompt texts according to the prompt word generation request and the target scene; calls a target generation model that matches the target scene from multiple pre-trained picture generation models, and the multiple picture generation models have different generation styles; inputs the multiple prompt texts into the target generation model to batch generate multiple initial picture materials; performs multi-dimensional scoring on the multiple initial picture materials according to a preset scoring strategy, and selects target picture materials from the multiple initial picture materials according to the scoring results. By batch generating multiple prompt texts and calling a picture generation model that matches the target scene, it is possible to batch generate multiple picture materials under the target scene, and perform multi-dimensional intelligent scoring on the initial picture materials, thereby realizing batch generation and screening of stylized picture materials and improving the efficiency and quality of batch generation of picture materials.
[0047] In one embodiment, Figure 2 As shown, step S201 includes:
[0048] S301, receiving a prompt word generation request, parsing and acquiring material theme information carried in the prompt word generation request;
[0049] S302, in response to a scene selection instruction input by the user, confirming the current target scene;
[0050] S303, generating a plurality of theme content texts according to the material theme information, and calling the text of the specified elements from the preset word library according to the current target scene, wherein the specified elements include background elements, color matching elements, composition elements and / or image quality elements;
[0051] S304: Fill the subject content text and the designated element text into designated positions in a preset prompt template to generate multiple prompt texts in batches.
[0052] In this embodiment, the user can input the theme of the image material to be generated through the front-end interactive interface, such as "Innovative Financial Technology Product Promotion", etc., and click the preset submit button to trigger the prompt word generation request, which carries the material theme information input by the user. At this time, the system can analyze the user input and extract the keywords of the material theme such as "innovation", "financial technology", "product promotion", etc. for subsequent prompt text generation. At the same time, the user can also select specific financial scenes on the interface, such as "product promotion scene", "offline salon event scene", etc., and specifically display the preview pictures related to each scene, so as to help users choose a scene that best meets their needs.
[0053] Since the prompt text usually includes the theme content, background, color, composition, picture quality and other contents of the picture, a preset prompt template containing the text positions of the above elements can be set in advance, such as "[Background elements] discuss [theme content], [composition elements], [picture quality elements]", and then the corresponding text can be automatically filled in the corresponding position to batch generate multiple prompt texts.
[0054] The theme content text is automatically generated based on the material theme information input by the user. For example, based on the theme of "Innovative Financial Technology Product Promotion" confirmed by the user, multiple content texts related to financial technology can be generated, such as "The Rise of Digital Currency", "The Application of Artificial Intelligence in Asset Management", etc., and other specified elements include background elements, color elements, composition elements and / or image quality elements, etc., and the background elements (such as "Financial Conference Center"), color elements (such as "Professional Blue"), composition elements (such as "Podium") and image quality elements (such as "High Definition") related to the "Product Promotion Scene" can be called from the preset vocabulary, thereby generating multiple prompt texts that are highly relevant to the target scene and theme. Multiple theme content texts and the called specified element texts are filled into the template to generate multiple prompt texts. Through the template method, multiple structured prompt texts can be quickly generated in batches, which improves the generation efficiency and ensures the quality and consistency of the generated text.
[0055] In one embodiment, the material theme information is a theme picture or a theme keyword, and the generating of multiple theme content texts according to the material theme information includes:
[0056] When the material theme information is a theme picture, feature extraction is performed on the theme picture, and a plurality of corresponding description texts are generated according to the extracted features of the theme picture as the plurality of theme content texts;
[0057] When the material theme information is a theme keyword, a theme generation instruction is constructed according to the theme keyword and then input into a large language model to obtain multiple theme content texts generated by the large language model under the instruction of the theme generation instruction.
[0058] In this embodiment, based on the form of the material theme information carried in the prompt word generation request input by the user, there are two ways to generate multiple theme content texts. When the material theme information uploaded by the user is a theme picture, for example, the user uploads an example picture of a financial product promotion poster, the picture can be feature extracted through a deep learning model to identify the main elements in the picture, such as "chart", "currency symbol", "investment growth curve", etc., and multiple corresponding description texts are generated according to the features of the extracted theme picture, such as "chart showing market growth", "rich currency symbol pattern", "curve chart highlighting investment return", etc. These description texts are used as multiple theme content texts for subsequent prompt text generation. Through automated feature extraction and description generation, the efficiency of financial promotional material production is improved.
[0059] When the subject information of the material uploaded by the user is a subject keyword, that is, the user directly enters keywords, such as "financial technology", "investment strategy", "market analysis", etc., and constructs a subject generation instruction, i.e., prompt, through these keywords, such as "generate a description text about the five latest trends in financial technology", and inputs the subject generation instruction into the large language model, and uses the large language model to generate multiple subject content texts related to the subject keywords, such as "financial technology promotes innovation in payment methods", "application of investment strategies in the field of digital currency", "use of artificial intelligence in market analysis", etc., and uses the powerful text generation capability of the large language model to efficiently generate diverse and innovative subject content texts.
[0060] In one embodiment, before determining and calling a target generation model matching the target scene from a plurality of pre-trained image generation models, the method further includes:
[0061] Collect pictures of different styles and build a material library;
[0062] Classifying the image materials in the material library by style to generate a plurality of style image sets;
[0063] The stable diffusion-based style image model is fine-tuned by using the several style image sets to obtain several image generation models with different generation styles.
[0064] In this embodiment, image materials are collected from multiple sources in advance, such as financial product posters, financial news illustrations, financial analysis charts, etc., to ensure that the materials cover a variety of styles and scenes, so as to construct a rich and diverse financial theme image material library to provide data for subsequent model training. Based on the visual characteristics of the image materials in the material library, the image materials are classified by style, for example, the materials are divided into different style categories such as "business formal", "innovative technology", "data chart", etc., to obtain several style picture sets. Based on the multiple style picture sets obtained by classification, a stable diffusion model (such as Stable Diffusion) is selected as the basic model, and the model is fine-tuned using different style picture sets. During the fine-tuning process, training is performed using a small number of pictures and identifiers to achieve rapid learning and generation of specific styles. Specifically, LoRA technology can be used for fine-tuning to obtain a picture generation model with different styles such as business formal, innovative technology, and data icons. The fine-tuned model can more accurately capture and reproduce the specific style of the financial field, improve the professionalism of the generated pictures, and the generation of multiple models of different styles is also convenient for scene matching when generating picture materials later.
[0065] In one embodiment, Figure 4 As shown, step S203 includes:
[0066] S401, obtaining a scene description of the target scene, and extracting scene keywords from the scene description;
[0067] S402, obtaining style labels of a plurality of pre-trained image generation models, wherein the style labels are used to mark the generation styles of the corresponding image generation models;
[0068] S403, matching the scene keyword with a plurality of style tags to obtain a matching degree between the target scene and a plurality of image generation models;
[0069] S404: Use the image generation model with the highest matching degree as the target generation model and call the target generation model.
[0070] In this embodiment, when matching and calling in multiple pre-trained and fine-tuned image generation models, the scene description for the target scene is first obtained. The scene description can be supplemented by the user or automatically generated based on the material generation record after the user selects the target scene. For example, when the target scene is financial product promotion, the scene description of the financial product promotion poster input by the user is obtained, such as "high-end business-style investment bank posters need to highlight professionalism and trust", and scene keywords such as "high-end business", "investment bank", "professional" and "trust" are extracted from the scene description. By extracting the keywords of the scene description, the user's material needs can be captured more accurately, providing an accurate text basis for model matching.
[0071] Multiple pre-trained image generation models, each with a corresponding style label, such as "modern simplicity", "classic business", "abstract art", etc. Rich style labels help meet the diverse design needs in different financial scenarios, and match the extracted scene keywords with the style labels of each model. For example, the scene keywords and style labels can be vectorized separately, and the similarity between the scene keyword vector and the style label vector is calculated, such as calculating the Euclidean distance, cosine similarity, etc., to obtain the matching degree between the target scene and multiple image generation models. If the scene keywords are "professional" and "trust", the matching degree between the model marked as "classic business" may be higher, and the matching degree between the model marked as "abstract art" may be lower, thereby providing quantitative and intuitive matching results and improving model selection and calling.
[0072] Based on the matching score results, the image generation model with the highest matching degree is selected as the target generation model and called. For example, if the "classic business" style model has the highest matching degree with the target scene, this model is called to generate subsequent image materials, ensuring that the generated image materials are highly consistent with the target scene and improving the usability of the materials.
[0073] In one embodiment, Figure 5 As shown, step S204 includes:
[0074] S501, respectively performing a theme consistency assessment, an aesthetic assessment, a color harmony assessment, and a layout rationality assessment on the plurality of initial picture materials, to obtain a theme score, an aesthetic score, a color score, and a layout score for each initial picture material;
[0075] S502: Obtain a preset color score threshold and a layout score threshold, and respectively determine the theme score threshold and the aesthetic score threshold according to the statistical distribution of theme scores and the statistical distribution of aesthetic scores of all initial image materials;
[0076] S503: Filter out target picture materials from the multiple initial picture materials, the target picture materials having the theme score greater than the theme score threshold, the aesthetic score greater than the aesthetic score threshold, the color score greater than the color score threshold, and the layout score greater than the layout score threshold.
[0077] In this embodiment, after the initial image material is generated, the image is further scored from four dimensions, namely, theme consistency, overall aesthetics, color harmony, and layout rationality, according to the quality requirements of the material, so as to automatically select high-quality materials that meet the requirements. The theme consistency refers to whether the content of the automatically generated material image is consistent with the theme; the overall aesthetics refers to whether the generated image as a whole conforms to human aesthetic preferences; the color harmony refers to whether the light and dark of the image color are harmonious; the layout rationality refers to whether the position of the image subject (such as the head of a person) is easily blocked by the text of the poster later, etc. Specifically, each initial image material is evaluated for subject consistency to determine its consistency with the target scene description. For example, the machine learning model ImageReward model is used to score the matching degree between scene keywords and image content to obtain a subject score. The ImageReward model can also be trained based on human-evaluated image aesthetics standards to score the aesthetics of each initial image material to obtain an aesthetics score. During color evaluation, the initial image material is converted into a grayscale image, and a grayscale index is calculated based on the grayscale image, such as the grayscale mean, grayscale variance, etc., and the value of the grayscale index is used as the color score. The layout score can be obtained through a detection model. For example, when the main body of the image is a person, the position of the person's head can be detected through a face detection model to evaluate the rationality of the position and obtain a layout score.
[0078] During the screening, each dimension is provided with a corresponding threshold, among which the color score threshold and layout score threshold can be set in advance based on historical data or industry standards. For example, since the company's marketing scene posters usually require light-colored picture materials, the color score threshold can be set to a grayscale value of 128; the main title needs to be placed above the poster, so the face position should not be blocked by the main title text. The color score threshold and the aesthetic score threshold are flexibly obtained based on the situation of each material generation. Specifically, the theme score threshold and the aesthetic score threshold are respectively confirmed according to the statistical distribution of the theme scores of all initial picture materials and the statistical distribution of the aesthetic scores. For example, the median and 70th percentile of the theme score are used as the theme score threshold, and the median and 70th percentile of the aesthetic score are used as the aesthetic score threshold. According to the scores and thresholds of each dimension, pictures that exceed the threshold in all dimensions are screened out from multiple initial picture materials. These pictures meet the requirements in terms of theme, beauty, color harmony and layout. The screened pictures are used as target picture materials for subsequent financial product promotion or other financial scene applications, ensuring that the picture materials finally used meet high standards in multiple key dimensions and improving the applicability and professionalism of the materials.
[0079] In one embodiment, after step S204, the method further includes:
[0080] Performing text detection on the target image material to determine the position of the text area in the target image material;
[0081] The text area of the target image material is erased and repaired according to the position of the text area to obtain a text-free image material.
[0082] In this embodiment, the selected target image material is further subjected to text detection. Specifically, the target image material can be subjected to text area detection through a CNN-based CRAFT model or a DBnet-based detection model. The model identifies the text area in the image and marks the exact position of the text, including the outline and bounding box of the text. The detection result can be displayed in the form of a heat map, highlighting the text area, and providing accurate position information for subsequent text erasure. Then, based on the detected text area position, an image repair algorithm, such as a scene text erasure framework or LAMA model based on a multi-scale attention mechanism, is used to erase the text area. Specifically, the background texture and color distribution around the text is automatically learned, and a texture matching the original background is generated using a generative adversarial network (GAN) technology, and the erased area is filled and repaired, thereby effectively removing unnecessary text information in the target image material, while maintaining the beauty of the image and the coherence of the background, improving the efficiency and quality of image editing, and meeting the high requirements for image materials in financial scenarios.
[0083] It should be noted that there is not necessarily a certain order between the above-mentioned steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above-mentioned steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0084] Further references Figure 6 , as a response to the above Figure 2 The present invention provides an embodiment of a device for batch generating picture materials, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0085] like Figure 6 As shown, the image material batch generation device 60 described in this embodiment includes:
[0086] A receiving and generating module 601 is used to receive a prompt word generation request and confirm the current target scene, and batch generate multiple prompt texts according to the prompt word generation request and the target scene;
[0087] A model calling module 602 is used to call a target generation model matching the target scene from a plurality of pre-trained image generation models, wherein the plurality of image generation models have different generation styles;
[0088] A batch generation module 603 is used to input the plurality of prompt texts into the target generation model to batch generate a plurality of initial picture materials;
[0089] The scoring and screening module 604 is used to perform multi-dimensional scoring on the multiple initial picture materials according to a preset scoring strategy, and screen out target picture materials from the multiple initial picture materials according to the scoring results.
[0090] The module referred to in the present invention refers to a series of computer program instruction segments that can perform specific functions, which are more suitable for describing the batch generation and execution process of image materials than programs. For the specific implementation methods of each module, please refer to the corresponding method embodiments above, which will not be repeated here.
[0091] In one embodiment, the receiving generation module 601 includes:
[0092] A receiving and parsing unit, configured to receive a prompt word generation request, and parse and obtain material theme information carried in the prompt word generation request;
[0093] A scene confirmation unit, configured to confirm a current target scene in response to a scene selection instruction input by a user;
[0094] An element generation unit, configured to generate a plurality of subject content texts according to the subject information of the material, and call the text of a specified element from a preset word library according to the current target scene, wherein the specified element includes a background element, a color matching element, a composition element and / or a picture quality element;
[0095] The prompt text generating unit is used to fill the subject content text and the designated element text into the designated position of the preset prompt template, and generate multiple prompt texts in batches.
[0096] In one embodiment, the material theme information is a theme picture or a theme keyword, and the element generation unit is specifically used to:
[0097] When the material theme information is a theme picture, feature extraction is performed on the theme picture, and a plurality of corresponding description texts are generated according to the extracted features of the theme picture as the plurality of theme content texts;
[0098] When the material theme information is a theme keyword, a theme generation instruction is constructed according to the theme keyword and then input into a large language model to obtain multiple theme content texts generated by the large language model under the instruction of the theme generation instruction.
[0099] In one embodiment, the device 60 further includes:
[0100] The collection and construction module is used to collect picture materials of different styles and build a material library;
[0101] A classification module, used to classify the image materials in the material library according to style and generate a plurality of style image sets;
[0102] The fine-tuning module is used to fine-tune the stable diffusion-based style image model through the several style image sets to obtain several image generation models with different generation styles.
[0103] In one embodiment, the model calling module 602 includes:
[0104] A first acquisition unit, configured to acquire a scene description of the target scene and extract scene keywords from the scene description;
[0105] A second acquisition unit is used to acquire style labels of a plurality of pre-trained image generation models, wherein the style labels are used to mark the generation styles of the corresponding image generation models;
[0106] A matching unit, used to match the scene keyword with a plurality of style tags to obtain a matching degree between the target scene and a plurality of image generation models;
[0107] The calling unit is used to use the image generation model with the highest matching degree as the target generation model and call the target generation model.
[0108] In one embodiment, the scoring screening module 604 includes:
[0109] A scoring unit is used to evaluate the theme consistency, aesthetics, color harmony and layout rationality of the multiple initial picture materials, and obtain a theme score, aesthetics score, color score and layout score for each initial picture material;
[0110] A threshold acquisition unit, used to acquire a preset color score threshold and a layout score threshold, and respectively determine the theme score threshold and the aesthetic score threshold according to the statistical distribution of the theme scores and the statistical distribution of the aesthetic scores of all initial image materials;
[0111] The screening unit is used to screen out target picture materials from the multiple initial picture materials, whose theme score is greater than a theme score threshold, whose aesthetic score is greater than a aesthetic score threshold, whose color score is greater than a color score threshold, and whose layout score is greater than a layout score threshold.
[0112] In one embodiment, the device 60 further includes:
[0113] A text detection module, used to perform text detection on the target image material and determine the position of the text area in the target image material;
[0114] The text erasing module is used to erase and repair the text area of the target image material according to the position of the text area to obtain a text-free image material.
[0115] In the above embodiment, the present invention discloses a device for batch generating picture materials, which generates multiple prompt texts in batches according to the prompt word generation request and the target scene by receiving a prompt word generation request and confirming the current target scene; calling a target generation model that matches the target scene from multiple pre-trained picture generation models, and the multiple picture generation models have different generation styles; inputting the multiple prompt texts into the target generation model to batch generate multiple initial picture materials; performing multi-dimensional scoring on the multiple initial picture materials according to a preset scoring strategy, and filtering out target picture materials from the multiple initial picture materials according to the scoring results. By batch generating multiple prompt texts and calling a picture generation model that matches the target scene, it is possible to batch generate multiple picture materials under the target scene, and perform multi-dimensional intelligent scoring on the initial picture materials, thereby realizing batch generation and screening of stylized picture materials and improving the efficiency and quality of batch generation of picture materials.
[0116] Another embodiment of the present invention provides a computer device, such as Figure 7 As shown, the computer device 70 includes:
[0117] One or more processors 701 and memory 702, Figure 7 A processor 701 is used as an example for description. The processor 701 and the memory 702 may be connected via a bus or other means. Figure 7 The example of connecting through bus is taken in the following.
[0118] Processor 701 is used to complete various control logics of computer device 70, and it can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a single-chip microcomputer, an ARM (Acorn RISC Machine) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component or any combination of these components. In addition, processor 701 can also be any traditional processor, microprocessor or state machine. Processor 701 can also be implemented as a combination of computing devices, for example, a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP and / or any other such configuration.
[0119] The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions corresponding to the method for batch generating picture materials in the embodiment of the present invention. The processor 701 executes various functional applications and data processing of the computer device 70 by running the non-volatile software programs, instructions and units stored in the memory 702, that is, the method for batch generating picture materials in the above method embodiment is implemented.
[0120] The memory 702 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device 70, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 702 may optionally include a memory remotely arranged relative to the processor 701, and these remote memories may be connected to the computer device 70 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. One or more units are stored in the memory 702, and when executed by one or more processors 701, the steps of the method for batch generating picture materials in any of the above-mentioned method embodiments are executed.
[0121] In the above embodiment, the present invention discloses a computer device, which generates multiple prompt texts in batches according to the prompt word generation request and the target scene by receiving a prompt word generation request and confirming the current target scene; calling a target generation model that matches the target scene from a plurality of pre-trained picture generation models, and the plurality of picture generation models have different generation styles; inputting the plurality of prompt texts into the target generation model, and generating multiple initial picture materials in batches; performing multi-dimensional scoring on the plurality of initial picture materials according to a preset scoring strategy, and filtering out target picture materials from the plurality of initial picture materials according to the scoring results. By generating multiple prompt texts in batches and calling a picture generation model that matches the target scene, it is possible to generate multiple picture materials under the target scene in batches, and perform multi-dimensional intelligent scoring on the initial picture materials, thereby realizing batch generation and screening of stylized picture materials, and improving the efficiency and quality of batch generation of picture materials.
[0122] An embodiment of the present invention provides a non-volatile computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by one or more processors, the steps of the method for batch generating picture materials in any of the above method embodiments are executed.
[0123] In the above embodiment, the present invention discloses a non-volatile computer-readable storage medium, which generates multiple prompt texts in batches according to the prompt word generation request and the target scene by receiving a prompt word generation request and confirming the current target scene; calling a target generation model that matches the target scene from a plurality of pre-trained picture generation models, wherein the plurality of picture generation models have different generation styles; inputting the plurality of prompt texts into the target generation model, and generating multiple initial picture materials in batches; performing multi-dimensional scoring on the plurality of initial picture materials according to a preset scoring strategy, and filtering out target picture materials from the plurality of initial picture materials according to the scoring results. By generating multiple prompt texts in batches and calling a picture generation model that matches the target scene, it is possible to generate multiple picture materials under the target scene in batches, and perform multi-dimensional intelligent scoring on the initial picture materials, thereby realizing batch generation and screening of stylized picture materials, and improving the efficiency and quality of batch generation of picture materials.
[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0125] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0126] In summary, the present invention discloses a method, device, equipment and medium for batch generation of picture materials, the method comprising: receiving a prompt word generation request and confirming the current target scene, batch generating multiple prompt texts according to the prompt word generation request and the target scene; calling a target generation model that matches the target scene from multiple pre-trained picture generation models, the multiple picture generation models having different generation styles; inputting the multiple prompt texts into the target generation model to batch generate multiple initial picture materials; performing multi-dimensional scoring on the multiple initial picture materials according to a preset scoring strategy, and screening out target picture materials from the multiple initial picture materials according to the scoring results. By batch generating multiple prompt texts and calling a picture generation model that matches the target scene, it is possible to batch generate multiple picture materials under the target scene, and perform multi-dimensional intelligent scoring on the initial picture materials, thereby realizing batch generation and screening of stylized picture materials and improving the efficiency and quality of batch generation of picture materials.
[0127] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium, and the computer program can include the processes of the above-mentioned method embodiments when executed. The storage medium can be a memory, a disk, a floppy disk, a flash memory, an optical storage device, etc.
[0128] It should be noted that if any software tools or components other than those of the Company appear in the embodiments of the present application, they are merely used for illustration and do not represent actual use. It should be understood that the application of the present invention is not limited to the above examples, and that those skilled in the art can make improvements or changes based on the above description, and all such improvements and changes shall fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for batch generating picture materials, characterized in that: include: Receive a prompt word generation request and confirm the current target scene, and batch generate multiple prompt texts according to the prompt word generation request and the target scene; Calling a target generation model that matches the target scene from a plurality of pre-trained image generation models, wherein the plurality of image generation models have different generation styles; Inputting the plurality of prompt texts into the target generation model to batch generate a plurality of initial picture materials; The multiple initial picture materials are scored in multiple dimensions according to a preset scoring strategy, and target picture materials are screened out from the multiple initial picture materials according to the scoring results.
2. The method for batch generating picture materials according to claim 1, characterized in that: The receiving of the prompt word generation request and confirming the current target scene, and batch generating a plurality of prompt texts according to the prompt word generation request and the target scene, includes: Receiving a prompt word generation request, parsing and acquiring material theme information carried in the prompt word generation request; In response to a scene selection instruction input by a user, confirming a current target scene; Generate multiple theme content texts according to the material theme information, and call the text of the specified elements from the preset word library according to the current target scene, the specified elements including background elements, color matching elements, composition elements and / or image quality elements; The subject content text and the designated element text are filled into designated positions in a preset prompt template to generate multiple prompt texts in batches.
3. The method for batch generating picture materials according to claim 2, characterized in that: The material theme information is a theme picture or a theme keyword, and the generating of a plurality of theme content texts according to the material theme information includes: When the material theme information is a theme picture, feature extraction is performed on the theme picture, and a plurality of corresponding description texts are generated according to the extracted features of the theme picture as the plurality of theme content texts; When the material theme information is a theme keyword, a theme generation instruction is constructed according to the theme keyword and then input into a large language model to obtain multiple theme content texts generated by the large language model under the instruction of the theme generation instruction.
4. The method for batch generating picture materials according to claim 1, characterized in that: Before determining and calling a target generation model matching the target scene from a plurality of pre-trained image generation models, the method further includes: Collect pictures of different styles and build a material library; Classifying the image materials in the material library by style to generate a number of style image sets; The stable diffusion-based style image model is fine-tuned by using the several style image sets to obtain several image generation models with different generation styles.
5. The method for batch generating picture materials according to claim 1, characterized in that: The calling of a target generation model matching the target scene from a plurality of pre-trained image generation models includes: Obtaining a scene description of the target scene, and extracting scene keywords from the scene description; Obtaining style labels of multiple pre-trained image generation models, where the style labels are used to annotate the generation styles of the corresponding image generation models; Matching the scene keyword with multiple style tags to obtain a matching degree between the target scene and multiple image generation models; The image generation model with the highest matching degree is used as the target generation model and the target generation model is called.
6. The method for batch generating picture materials according to claim 1, characterized in that: The step of performing multi-dimensional scoring on the plurality of initial picture materials according to a preset scoring strategy, and selecting a target picture material from the plurality of initial picture materials according to the scoring results, includes: The plurality of initial picture materials are respectively evaluated for theme consistency, aesthetics, color harmony, and layout rationality to obtain a theme score, aesthetics score, color score, and layout score for each initial picture material; Obtaining a preset color score threshold and a layout score threshold, and respectively confirming the theme score threshold and the aesthetic score threshold according to the statistical distribution of the theme scores and the statistical distribution of the aesthetic scores of all initial image materials; Target picture materials whose theme score is greater than a theme score threshold, whose aesthetic score is greater than a aesthetic score threshold, whose color score is greater than a color score threshold, and whose layout score is greater than a layout score threshold are screened out from the multiple initial picture materials.
7. The method for batch generating picture materials according to claim 1, characterized in that: After the plurality of initial picture materials are scored in multiple dimensions according to a preset scoring strategy and a target picture material is selected from the plurality of initial picture materials according to the scoring results, the method further includes: Performing text detection on the target image material to determine the position of the text area in the target image material; The text area of the target image material is erased and repaired according to the position of the text area to obtain a text-free image material.
8. A device for batch generating picture materials, characterized in that: include: A receiving and generating module, used for receiving a prompt word generation request and confirming a current target scene, and batch generating a plurality of prompt texts according to the prompt word generation request and the target scene; A model calling module, used to call a target generation model matching the target scene from a plurality of pre-trained image generation models, wherein the plurality of image generation models have different generation styles; A batch generation module, used for inputting the plurality of prompt texts into the target generation model to batch generate a plurality of initial picture materials; The scoring and screening module is used to perform multi-dimensional scoring on the multiple initial picture materials according to a preset scoring strategy, and screen out target picture materials from the multiple initial picture materials according to the scoring results.
9. A computer device, characterized in that: comprising at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for batch generating picture materials described in any one of claims 1-7.
10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute the method for batch generating picture materials described in any one of claims 1-7.
Citation Information
Cited By
Text generation method and device, electronic equipment and storage medium
CN119719356A
Text generation method, device, electronic device and storage medium
CN119719356B
Dynamic content generation method and device
CN120163152A