Method and device for converting original picture into cartoon style picture

By automatically screening and calling multiple target models in the preset SD model library, combined with multi-modal large models and retrieval enhancement generation technology, the problems of high model training complexity and limited customization styles in SD model applications are solved. It achieves efficient and personalized comic-style image generation and lowers the threshold for use.

CN118780974APending Publication Date: 2024-10-15BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410974367.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

When using the SD model for image animation in the existing technology, there are problems such as high model training complexity, high usage threshold, and limited customization style.

Method used

By obtaining the original pictures and description information provided by the user, multiple target SD models are automatically selected from the preset SD model library, and these models are called to convert the original pictures into a variety of comic-style target pictures, using multi-modal large models. , retrieval model and generation model for in-depth information extraction and style tag screening, combined with retrieval enhancement generation technology to achieve intelligent selection.

Benefits of technology

It achieves efficient and personalized comic-style image generation, reduces manual intervention costs, improves user creative efficiency and satisfaction, lowers the threshold for converting images into comics, and enables ordinary users to easily customize comic styles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118780974A_ABST
    Figure CN118780974A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of picture processing, in particular to a method and device for converting an original picture into a cartoon style picture, and the method comprises the steps: receiving the original picture and cartoon style description information provided by a user, and enabling a system to automatically screen out a matched model from a preset SD model library, according to the method, original pictures are efficiently converted into target pictures of various personalized cartoon styles, and intelligent selection of SD models is realized by combining a retrieval enhancement generation (RAG) technology, so that a common user can easily customize the cartoon styles and generate high-quality cartoon style pictures in batches; the efficiency of automatically generating the cartoon style picture is further improved, and the use threshold of converting the picture into the cartoon is reduced.
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 a method and device for converting an original image into a comic style image. Background Art

[0002] With the booming development of digital media, the creative transformation and stylization of image content has become one of the key means to enhance the visual experience and increase the appeal of content. Among them, the technology of converting ordinary images into comic-style images has gradually become a hot topic in the field of image processing due to its unique artistic effects and wide range of application scenarios.

[0003] Traditionally, the conversion of images into comics mainly relies on color quantization, filter application or manual drawing by professional designers. Although these methods can simulate the comic style to a certain extent, they have problems such as low efficiency, high cost, difficulty in batch processing and limited style customization. In particular, with the rapid development of social media, online education, brand promotion and other fields, the demand for high-quality, personalized and quickly generated comic-style images is growing, and traditional methods can no longer meet these needs.

[0004] In recent years, the rapid progress of deep learning technology, especially the rise of generative models such as Stable Diffusion (SD), has brought revolutionary changes to image-to-comic technology. The SD model can automatically generate comic-style images by learning from a large amount of comic image data, greatly improving the generation efficiency and effect. However, the application of the SD model also faces some challenges, such as high model training complexity, high threshold for ordinary users, and difficulty in directly achieving accurate matching of user-defined styles.

[0005] It can be seen that when using the SD model to convert pictures into comics in the existing technology, there are problems such as high model training complexity, high usage threshold and limited custom style. Summary of the invention

[0006] The purpose of this application is to provide a method and device for converting an original image into a comic-style image, so as to solve the problems of high model training complexity, high usage threshold and limited custom style when using the SD model to convert images into comics in the prior art.

[0007] In order to achieve the above purpose, the technical solution adopted in this application is as follows:

[0008] According to one aspect of an embodiment of the present application, a method for converting an original image into a comic-style image is provided, including: obtaining an original image to be converted and description information, wherein the description information is used to describe the comic style desired by a user; based on the original image and the description information, screening out multiple target SD models from a preset SD model library, wherein the SD model library is used to store pre-trained SD models, each SD model is used to convert and generate a comic-style image, the comic styles of images converted by any two SD models are different, and multiple target SD models match the comic styles described by the description information; calling multiple target SD models to convert the original image into target images of multiple comic styles respectively.

[0009] According to the above technical means, by receiving the original pictures and comic style description information provided by the user, the system automatically selects matching models from the preset SD model library, and efficiently converts the original pictures into target pictures of a variety of personalized comic styles, which not only meets user needs but also reduces the cost of manual intervention.

[0010] Furthermore, multiple target SD models are called to convert the original images into target images of multiple comic styles, including: generating multiple image conversion tasks according to the access addresses of the multiple target SD models and the original images, wherein each image conversion task specifies the access address of the called target SD model and the original image to be converted, and the target SD models called by any two image conversion tasks are different; executing multiple image conversion tasks to obtain target images of multiple comic styles.

[0011] According to the above technical means, by processing multiple image conversion tasks, each task targets a specific SD model access address and original image, thereby achieving efficient and flexible image style conversion, and being able to quickly generate target images in a variety of comic styles, greatly improving the user's creative efficiency and satisfaction.

[0012] Furthermore, multiple image conversion tasks are performed to obtain target images of multiple comic styles, including performing each image conversion task in the following manner: calling the target SD model through the access address of the target SD model specified in the image conversion task, and converting the original image into a target image of comic style.

[0013] According to the above technical means, since the target SD model is directly called through the specified target SD model access address, the accuracy and specificity of the conversion process is ensured, so that the original image can be quickly and accurately converted into a target image of a specific comic style. This direct and efficient method not only shortens the conversion time, but also improves the quality and consistency of the conversion results, meeting the user's needs for diversified and personalized comic-style images.

[0014] Furthermore, based on the original image and the description information, multiple target SD models are screened out from a preset SD model library, including: multiple comic style labels are obtained based on the original image, the description information and all model labels, wherein all model labels are used to characterize all comic styles of comic style images converted and generated by all SD models in the SD model library, and each SD model corresponds to multiple model labels; from the SD model library, based on the multiple comic style labels and the multiple model labels corresponding to each SD model, multiple target SD models are screened out according to preset screening rules.

[0015] According to the above technical means, by integrating the original pictures, description information and all model labels, it is possible to more accurately understand and match the comic style expected by the user. At the same time, by utilizing the preset screening rules, the target SD model that is highly matched with the target comic style can be quickly screened out from the extensive SD model library, thereby ensuring the targetedness and accuracy of the conversion process, while improving the conversion efficiency and user satisfaction.

[0016] Furthermore, multiple comic style labels are obtained based on the original image, description information and all model labels, including: calling the multimodal large model to extract image information of the original image according to preset prompt words; calling the retrieval model to retrieve the preset knowledge base to obtain background knowledge related to the description information; calling the generation model to screen the comic style labels according to the background knowledge, image information, description information and all model labels to obtain multiple comic style labels.

[0017] According to the above technical means, by comprehensively using multimodal large models, retrieval models and generation models, deep extraction of original image information, accurate retrieval of background knowledge and intelligent screening of comic style labels are achieved. This process not only improves the comprehensiveness and accuracy of information processing, but also enhances the personalization and accuracy of comic style conversion. By integrating multiple data sources and model capabilities, it is possible to better understand user intentions, thereby generating a variety of comic style labels that better meet user expectations, providing a solid foundation for subsequent comic style conversion.

[0018] Furthermore, multiple target SD models are screened out from the SD model library according to multiple comic style labels and multiple model labels corresponding to each SD model according to preset screening rules, including: when there are SD models that hit the comic style label in the SD model library, all SD models that hit the comic style label are sorted in order from large to small according to the number of hits to obtain an SD model sequence, wherein the number of hits is the number of multiple model labels of each SD model that hit the comic style label; and from the SD model sequence, a preset number of SD models are selected in order from front to back as multiple target SD models.

[0019] According to the above technical means, by accurately matching the labels of the models in the SD model library and counting the number of hits, it is possible to scientifically evaluate the degree of fit between each SD model and the user's expected comic style. Subsequently, the top SD models are sorted by the number of hits and selected as the target SD models, ensuring the accuracy and diversity of the final selected models in style transfer. This method not only improves the efficiency of model selection, but also further enhances the accuracy of comic style transfer and user satisfaction.

[0020] Furthermore, from the SD model library, based on multiple comic style tags and multiple model tags corresponding to each SD model, multiple target SD models are screened out according to preset screening rules, including: when there is no SD model that hits the comic style tag in the SD model library, a preset number of SD models are selected from the default recommended SD models as multiple target SD models.

[0021] According to the above technical means, when there is no SD model in the SD model library that directly matches the comic style label described by the user, the system can also ensure the continuity of the process and the satisfaction of user needs through an alternative solution - the default recommended SD model. This design improves the robustness and fault tolerance of the system, and avoids process interruptions or user dissatisfaction caused by the complete lack of matching models. Through the preset default recommended model, the system can still provide users with style conversion services, maintaining a certain degree of flexibility and consistency in user experience.

[0022] Furthermore, before selecting multiple target SD models from a preset SD model library based on the original image and description information, the method includes: using model training materials to train a pre-built model to obtain an SD model, wherein the model training materials are a collection of comic-style images; inputting the model training materials into a preset multimodal large model for processing to obtain multiple model labels corresponding to the SD model; and storing the SD model and the multiple model labels in the SD model library.

[0023] According to the above technical means, by collecting pictures of a specific comic style as model training materials and using these materials to train the pre-built model, an SD model focusing on the comic style can be generated. At the same time, the text generation model is used to process the model training materials to automatically generate multiple model labels closely related to the SD model. These labels help to quickly identify and match the comic style expected by the user in the future. Saving the trained SD model and its corresponding model labels in the SD model library not only enriches the diversity of the model library, but also improves the convenience of model retrieval and use, providing strong support for subsequent comic style conversion tasks.

[0024] According to another aspect of an embodiment of the present application, there is also provided a device for converting an original image into a comic-style image, including: a data acquisition module, used to obtain the original image to be converted and description information, wherein the description information is used to describe the comic style expected by the user; a model screening module, used to screen out multiple target SD models from a preset SD model library based on the original image and the description information, wherein the SD model library is used to store pre-trained SD models, each SD model is used to convert and generate a comic-style image, and multiple target SD models match the comic style described by the description information; a picture conversion module, used to call multiple target SD models to convert the original image into target images of multiple comic styles.

[0025] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein the memory is used to store a computer program; and the processor is used to execute the steps of the method for converting an original image into a comic-style image in any of the above embodiments by running the computer program stored in the memory.

[0026] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of the method for converting an original image into a comic-style image in any of the above embodiments when running.

[0027] Beneficial effects of this application:

[0028] This application receives original images and comic style description information provided by users, and the system automatically selects matching models from the preset SD model library, and efficiently converts the original images into target images of a variety of personalized comic styles. By combining retrieval enhanced generation (RAG) technology, intelligent selection of SD models is achieved, so that ordinary users can easily customize comic styles and batch generate high-quality comic style images, further improving the efficiency of automatically generating comic style images and lowering the threshold for using image-to-comic conversion. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

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

[0031] Figure 1 It is a schematic diagram of a hardware environment of an optional method for converting an original image into a comic style image provided in an embodiment of the present application;

[0032] Figure 2 It is a flowchart of an optional method for converting an original image into a comic style image provided by an embodiment of the present application;

[0033] Figure 3 It is a flowchart of an optional method for constructing a SD model library provided in an embodiment of the present application;

[0034] Figure 4 is a schematic diagram of a picture-to-comic service provided by an embodiment of the present application;

[0035] Figure 5 It is a structural block diagram of an optional device for converting an original image into a comic style image provided by an embodiment of the present application;

[0036] Figure 6 It is a structural block diagram of an optional electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] According to one aspect of an embodiment of the present application, a method for converting an original image into a comic-style image is provided. Optionally, in this embodiment, the method for converting the original image into a comic-style image can be applied to a hardware environment consisting of a terminal and a server. The server is connected to the terminal via a network, and can be used to provide services for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server.

[0040] The above network may include but is not limited to at least one of the following: wired network, wireless network. The above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, etc.

[0041] The method for converting the original image into a comic style image in the embodiment of the present application can be executed by a server, or by a terminal, or by both a server and a terminal. The method for converting the original image into a comic style image in the embodiment of the present application can be executed by a terminal or by a client installed thereon.

[0042] Take the method of converting the original image into a comic style image in this embodiment performed by the server as an example, see Figure 1 , Figure 1 is a schematic diagram of the hardware environment of an optional method for converting an original image into a comic style image provided by an embodiment of the present application, such as Figure 1As shown, the hardware environment of the method for converting the original image into a comic style image includes: a terminal 102, and a server 104 connected to the terminal 102 through a network. The server 104 is used to deploy a picture-to-comic service, and the picture-to-comic service is used to execute the method for converting the original image into a comic style image in the embodiment of the present application, and converts the original image to be converted uploaded by the user into a target image in the desired comic style; the terminal 102 is used to display the original image to be converted uploaded by the user and the description information entered by the user, and display the target image generated by the conversion after the conversion is completed.

[0043] The method of converting the original image into a comic-style image in this embodiment can be applied to the scene of converting images into comics. In practical applications, the SD model can automatically generate comic-style images by learning a large amount of comic image data, greatly improving the generation efficiency and effect. However, the application of the SD model also faces some challenges, such as high model training complexity, high threshold for ordinary users, and difficulty in directly achieving accurate matching of user-defined styles.

[0044] To solve the above problem, this embodiment provides a method for converting an original image running on the above server into a comic style image. Figure 2 , Figure 2 FIG. 1 is a flow chart of an optional method for converting an original image into a comic style image provided in an embodiment of the present application. Figure 2 As shown, the method for converting the original image into a comic style image in the embodiment of the present application specifically includes the following steps:

[0045] Step S201, obtaining an original image to be converted and description information, wherein the description information is used to describe the comic style desired by the user;

[0046] Step S202, based on the original picture and the description information, multiple target SD models are screened from a preset SD model library, wherein the SD model library is used to store pre-trained SD models, each SD model is used to convert and generate a comic-style picture, and the comic styles of the pictures converted by any two SD models are different, and the multiple target SD models match the comic styles described by the description information;

[0047] Step S203, calling multiple target SD models to convert the original image into target images of multiple comic styles.

[0048] Through the above steps S201 to S203, by receiving the original picture and comic style description information provided by the user, the system automatically selects the matching model from the preset SD model library, and converts the original picture into a target picture of a variety of personalized comic styles, which solves the problems of high model training complexity, high usage threshold and limited custom style when using SD model for picture-to-comic conversion in related technologies. By receiving the original picture and comic style description information provided by the user, the system automatically selects the matching model from the preset SD model library, and efficiently converts the original picture into a target picture of a variety of personalized comic styles. By combining the retrieval enhanced generation (RAG) technology, the intelligent selection of SD model is realized, so that ordinary users can easily customize the comic style and batch generate high-quality comic style pictures, which further improves the efficiency of automatically generating comic style pictures and lowers the usage threshold of picture-to-comic conversion.

[0049] Combine the following Figure 2 The method for converting the original image into a comic style image in the embodiment of the present application is explained.

[0050] In the technical solution of step S201, the original image to be converted and description information are obtained.

[0051] The original image is the image to be converted uploaded by the user. In practice, the original image can be stored locally or in the cloud. When the original image needs to be converted into a comic-style image, the user can directly obtain the original image locally or from the cloud.

[0052] The description information is used to describe the comic style expected by the user. In this application, comic style refers to the unique way and characteristics of comic pictures in visual presentation and artistic expression. It covers many aspects, including lines, colors, composition, character design, background description, and the creation of an overall atmosphere. Different comic styles will bring different visual and emotional experiences to users. Comic styles specifically include: ink animation, clay animation, Hayao Miyazaki, Makoto Shinkai, old-fashioned cartoons, etc. In specific practice, the description information is text, voice, etc. input by the user using an input device, and the input device can be a keyboard, a handwriting input board, etc. for inputting text. The input device can also be a microphone for inputting voice, a voice recognition device with built-in voice recognition software, etc. The voice recognition device can be a smart speaker, a voice remote control, etc. In this embodiment, the description information can be in the following form, for example: I want a cool Japanese mecha-style picture.

[0053] In the technical solution of step S202, multiple target SD models are screened from a preset SD model library according to the original image and description information. The SD model library is used to store pre-trained SD models, each SD model is used to convert and generate a comic-style image, and the comic styles of the images converted and generated by any two SD models are different. In specific practice, the SD model in the SD model library can be an SD model trained by the user using model training materials, or it can be a trained SD model obtained from the network.

[0054] The target SD model is an SD model used to convert and generate a comic-style picture that meets the user's expectations. In specific practice, the description information actually input by the user may describe a vague comic style, such as the example of the description information above. Therefore, in the scheme of this embodiment, multiple target SD models can be screened out from the SD model library based on the original picture and the description information. Each target SD model is used to convert and generate a comic-style picture. The comic styles of the pictures converted by any two SD models are different, and the comic styles corresponding to the multiple target SD models match the comic styles described by the description information.

[0055] As an optional embodiment, multiple target SD models are screened out from a preset SD model library based on the original image and description information, including: obtaining multiple comic style labels based on the original image, description information and all model labels, wherein all model labels are used to characterize all comic styles of comic style images converted and generated by all SD models in the SD model library, and each SD model corresponds to multiple model labels; from the SD model library, multiple target SD models are screened out according to preset screening rules based on the multiple comic style labels and the multiple model labels corresponding to each SD model.

[0056] It should be noted that each SD model in the SD model library has corresponding multiple model tags, each model tag is used to characterize the comic style of the comic-style pictures that can be converted and generated by the SD model, and all model tags are used to characterize all comic styles of comic-style pictures converted and generated by all SD models in the SD model library.

[0057] In specific practice, first, according to the original image and description information, multiple comic style labels are screened from all model labels to obtain the comic style corresponding to the user's expectation. Then, according to the multiple comic style labels and the multiple model labels corresponding to each SD model, multiple target SD models are screened from the SD model library according to the preset screening rules. The screening rules specify the screening requirements of the target SD models and the number of screened target SD models.

[0058] It is understandable that by integrating the original pictures, description information and all model labels, it is able to more accurately understand and match the user's expected comic style. At the same time, by utilizing the preset screening rules, the target SD model that highly matches the target comic style can be quickly screened out from the extensive SD model library, ensuring the targetedness and accuracy of the conversion process, while improving conversion efficiency and user satisfaction.

[0059] As an optional embodiment, multiple comic style labels are obtained according to the original image, description information and all model labels, including: calling a multimodal large model to extract image information of the original image according to preset prompt words; calling a retrieval model to retrieve a preset knowledge base to obtain background knowledge related to the description information; calling a generation model to screen comic style labels according to background knowledge, image information, description information and all model labels to obtain multiple comic style labels.

[0060] It should be noted that the multimodal large model refers to a model that combines multimodal information such as text, images, videos, and audio for training. It uses deep learning technology to process various types of data to achieve more intelligent information processing. The multimodal large model is usually trained using self-supervised learning. During the training process, the model compares the similarity and semantic consistency between data of different modalities to generate task objectives and predict task results. Specifically, data of different modalities are input into a deep neural network after preprocessing, and after multiple layers of feature extraction and fusion, the corresponding results are finally output. The prompt word is used to guide the multimodal large model to output the results expected by the user. In this embodiment, the multimodal large model can be GPT-4o.

[0061] The retrieval model is used to retrieve the most relevant information for a given query from a large-scale document collection or knowledge base. In this embodiment, the retrieval model is used to retrieve background knowledge related to the comic style pictures described in the description information from the knowledge base. The knowledge base stores knowledge related to all models of animation, photography, portraits, and model libraries. Therefore, the background knowledge retrieved also includes knowledge related to all models of animation, photography, portraits, and model libraries. The generation model is used to fuse the retrieved background knowledge with other information, and output multiple comic style tags corresponding to the comic style expected by the user according to a specific prompt. In specific practice, the retrieval model and the generation model are usually used together to form RAG (Retrieval Augmented Generation), which is a natural language processing model architecture that combines two key tasks of retrieval and generation. In RAG, the retrieval model and the generation model play important roles respectively, and work together to improve the quality and accuracy of text generation.

[0062] In specific practice, first use the multimodal large model to extract the information of the original image according to the prompt word to obtain the image information. Then use the retrieval model to search the knowledge base to obtain relevant background knowledge; finally use the generation model to filter the comic style tags according to the background knowledge, image information, description information and all model tags to obtain multiple comic style tags. Specifically, the description information, the image information extracted by the multimodal large model and all model tags are combined into Prompt (prompt word) according to the preset format, and the Prompt (prompt word) is input to RAG for filtering the comic style tags, and finally the multiple comic style tags are filtered and output according to the preset filtering rules. The format of the Prompt (prompt word) can be as follows: the user wants to generate {the description information input by the user}, and the reference picture provided has {image information}. Please select the tags that meet his needs in combination with these tag definitions {model tags in the model library}.

[0063] It is understandable that by comprehensively using multimodal large models, retrieval models, and generation models, we have achieved deep extraction of original image information, accurate retrieval of background knowledge, and intelligent screening of comic style labels. This process not only improves the comprehensiveness and accuracy of information processing, but also enhances the personalization and accuracy of comic style conversion. By integrating multiple data sources and model capabilities, we can better understand user intent and generate a variety of comic style labels that better meet user expectations, providing a solid foundation for subsequent comic style conversion.

[0064] As an optional embodiment, multiple target SD models are screened out from the SD model library according to multiple comic style tags and multiple model tags corresponding to each SD model according to preset screening rules, including: when there are SD models that hit the comic style tags in the SD model library, all SD models that hit the comic style tags are sorted in order from large to small according to the number of hits to obtain an SD model sequence, wherein the number of hits is the number of multiple model tags of each SD model that hit the comic style tags; from the SD model sequence, a preset number of SD models are selected in order from front to back as multiple target SD models.

[0065] In specific practice, if there are SD models that hit the comic style tags in the SD model library, the preset screening rules are: sort them in descending order according to the number of hit comic style tags, and take the top N SD models as multiple target SD models, where N is a preset number. In this embodiment, N is 3.

[0066] It is understandable that by accurately matching the labels of the models in the SD model library and counting the number of hits, it is possible to scientifically evaluate the degree of fit between each SD model and the user's expected comic style. Subsequently, the top SD models are sorted by the number of hits and selected as the target SD models, ensuring the accuracy and diversity of the final selected models in style transfer. This method not only improves the efficiency of model selection, but also further enhances the accuracy of comic style transfer and user satisfaction.

[0067] As an optional embodiment, multiple target SD models are screened out from the SD model library according to preset screening rules based on multiple comic style tags and multiple model tags corresponding to each SD model, including: when there is no SD model that hits the comic style tag in the SD model library, a preset number of SD models are selected from the default recommended SD models as multiple target SD models.

[0068] In specific practice, if there is no SD model that hits the comic style tag in the SD model library, the preset screening rule is: from the default recommended SD model, take N SD models as multiple target SD models, where N is a preset number. In this embodiment, N is 3. It should be noted that the recommended SD model is an SD model that is frequently used by users, or a currently popular SD model. In specific practice, the recommended SD model is stored in a model table, in which multiple frequently used or currently popular SD models are stored. When a popular SD model is updated, or an SD model that is frequently used by users is updated, the table will also be updated.

[0069] It is understandable that when there is no SD model in the SD model library that directly matches the comic style label described by the user, the system can also ensure the continuity of the process and the satisfaction of user needs through an alternative solution, that is, the default recommended SD model. This design improves the robustness and fault tolerance of the system and avoids process interruptions or user dissatisfaction caused by the complete lack of matching models. Through the preset default recommended model, the system can still provide style conversion services to users, maintaining a certain degree of flexibility and consistency in user experience.

[0070] In the technical solution of step S203, multiple target SD models are called to convert the original images into target images of multiple comic styles.

[0071] The target image is a comic style image, and the comic style of the image matches the comic style described in the description information. In specific practice, multiple target SD models are called to convert the original image into target images of multiple comic styles respectively, and each target SD model converts the original image into a target image of one comic style.

[0072] As an optional embodiment, multiple target SD models are called to convert the original images into target images of multiple comic styles, including: generating multiple image conversion tasks according to the access addresses of the multiple target SD models and the original images, wherein each image conversion task specifies the access address of the called target SD model and the original image to be converted, and the target SD models called by any two image conversion tasks are different; executing multiple image conversion tasks to obtain target images of multiple comic styles.

[0073] In specific practice, the batch generation service is used to convert the original image into a variety of comic-style images. In this embodiment, the batch generation service is deployed based on ComfyUI. ComfyUI is a stable diffusion algorithm graphical interface based on node workflow. It cleverly decomposes the stable diffusion process into various nodes, thereby achieving precise customization and reliable reproduction of the workflow. ComfyUI has been widely used in many fields, including e-commerce poster generation, anime to real people, old photo restoration, portrait customization, stylized filters, video generation, etc.

[0074] When using the batch generation service, each step in an image conversion task is converted into a node in a workflow, and each node is configured with parameters and executed in sequence to convert the original image into a comic-style image. In practice, you can create multiple workflows at the same time and execute multiple image conversion tasks in parallel; you can also create only one workflow and execute multiple image conversion tasks in series.

[0075] It can be understood that by processing multiple image conversion tasks, each task targets a specific SD model access address and original image, efficient and flexible image style conversion is achieved, and target images of various comic styles can be quickly generated, greatly improving the user's creative efficiency and satisfaction.

[0076] As an optional embodiment, multiple image conversion tasks are performed to obtain target images of multiple comic styles, including performing each image conversion task in the following manner: calling the target SD model through the access address of the target SD model specified in the image conversion task, and converting the original image into a target image of comic style.

[0077] When using the batch generation service, by configuring the parameters of each node in each workflow, each node is executed in sequence to realize the conversion of the original image into a comic style image. The workflow may include the following nodes: Load Image, CLIP Text Encode, Load Checkpoint, KSampler, and VAE Decode, wherein Load Image is to load the original image to be converted, CLIP Text Encode is to encode the text prompt words describing the comic style, that is, to encode the description information, Load Checkpoint is to load the target SD model, and KSampler is to denoise the latent space noise image, and combine the loaded model and the encoded prompt words to generate the potential representation of the target image, and VAE Decode is to decode the latent space image into an image in the pixel space, that is, to generate the final comic style image. For the parameters such as the positive prompt words, negative prompt words, iteration steps, and guidance coefficients in the sampler (KSampler), they are set according to the actual situation and are not specifically limited in this application.

[0078] It can be understood that since the target SD model is directly called through the specified target SD model access address, the accuracy and specificity of the conversion process is ensured, so that the original image can be quickly and accurately converted into a target image of a specific comic style. This direct and efficient method not only shortens the conversion time, but also improves the quality and consistency of the conversion results, meeting the user's demand for diversified and personalized comic-style images.

[0079] As an optional embodiment, before selecting multiple target SD models from a preset SD model library based on the original image and description information, the SD model library is constructed. In specific practice, the process of constructing the SD model library is described in detail in the following. Figure 3 , Figure 3 is a flow chart of an optional method for constructing a SD model library provided in an embodiment of the present application, such as Figure 3 As shown, the specific steps include:

[0080] Step S301, using model training materials to train a pre-built model to obtain an SD model, wherein the model training materials are a collection of comic-style pictures;

[0081] Step S302, inputting the model training material into a preset multimodal large model for processing to obtain multiple model labels corresponding to the SD model;

[0082] Step S303, saving the SD model and multiple model labels in the SD model library.

[0083] In specific practice, the function of building an SD model library is realized through an automated model training platform. Specifically, the automated model training platform provides a model training module for training an SD model of a specific comic style based on model training materials. When using the automated model training platform to train an SD model, the user only needs to upload the model training materials to obtain an SD model of a specific comic style. In this application, the specific model training process is not specifically limited.

[0084] In specific practice, the automated model training platform also provides a meta-information recognition module, which uses a multimodal large model to extract the image information of each image in the model training material, and summarizes the comic style of the same group of materials, thereby obtaining the model label corresponding to the SD model. In this embodiment, the multimodal large model can be GPT-4o, and the image information can include information such as characters, environment, and scene.

[0085] It should be noted that after the SD model training is completed and before it is stored in the SD model library, it is necessary to check whether the model label generated by the meta-information recognition module matches the comic style of the picture generated by the trained SD model. If it matches, it is stored in the SD model library, otherwise, the model label is regenerated.

[0086] It is understandable that by collecting pictures of a specific comic style as model training materials and using these materials to train the pre-built model, an SD model focusing on the comic style can be generated. At the same time, the text generation model is used to process the model training materials to automatically generate multiple model labels closely related to the SD model. These labels help to quickly identify and match the comic style expected by the user in the future. Saving the trained SD model and its corresponding model labels in the SD model library not only enriches the diversity of the model library, but also improves the convenience of model retrieval and use, providing strong support for subsequent comic style conversion tasks.

[0087] In practical applications, the method of converting the original image into a comic style image in this application is encapsulated as a picture-to-comic service, which provides a service calling interface. For the process of the picture-to-comic service, please refer to Figure 4 , Figure 4 is a schematic diagram of a picture-to-comic service provided in an embodiment of the present application. Figure 4 In , the original image is the original image to be converted, the expectation is the description information entered by the user, the model meta-information includes the model label, the recommended model is the target SD model, and the model feature is the model label. Figure 4As shown, when the comic style that the user expects to convert is vague (i.e., the target is vague), the image-to-comic service receives the original image and expectation provided by the user, uses RAG to filter and obtain the recommended model according to the model meta-information, expectation and knowledge base, and then converts the original image into a comic style picture through the batch generation module, and outputs the comic style picture. When the comic style that the user expects to convert is clear (i.e., the target is clear), the image-to-comic service also receives the model training materials provided by the user, inputs the model training materials into the automated model training platform for model training, obtains the trained model, and obtains the corresponding model label of the model. After confirming that the model and the model label correspond through manual inspection, the model is stored in the model library, and the original image is converted into a specific comic style picture through the customized model.

[0088] When users use the image-to-comic service in this application to convert the original image into a comic-style image, if the user's needs are vague, they can specify the desired comic style based on their preferences and needs through the information described in the expectations. This flexibility allows the generated images to be highly personalized to meet the diverse needs of users. At the same time, the SD model is automatically screened by RAG, and the image conversion is performed through the batch processing module, which greatly reduces the need for manual intervention. The user only needs to provide the original image and expectations, and the system can quickly generate comic images in a variety of styles, improving processing efficiency and user experience. If the user's needs are clear, a model of a specific comic style can be trained based on the model training material through an automated model training platform, and then the trained model can be used to convert the original image into a specific comic-style image through a batch processing module. This meets the user's customization needs while improving the user experience of the service.

[0089] It is understandable that the image-to-comic service in this application not only meets the user's demand for rapid conversion when the comic style is vague, but also performs efficient conversion by intelligently screening and recommending suitable models, by providing two methods: intelligent recommendation model and customized model training; it also meets the user's customization needs when the comic style is clear, allowing users to provide training materials and train models that conform to specific styles. These two methods together improve the flexibility, usability and user experience of the service. It should be noted that for the aforementioned method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited to the described order of actions, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0090] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, 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 (Read-Only Memory) / RAM (Random Access Memory), a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present application.

[0091] According to another aspect of the embodiment of the present application, there is also provided a device for converting an original image into a comic style image for implementing the above-mentioned method of converting an original image into a comic style image. Figure 5 , Figure 5 is a structural block diagram of an optional device for converting an original image into a comic style image provided by an embodiment of the present application, such as Figure 5 As shown, the device may include:

[0092] The data acquisition module 501 is used to acquire the original image to be converted and description information, wherein the description information is used to describe the comic style expected by the user;

[0093] The model screening module 502 is used to screen multiple target SD models from a preset SD model library according to the original picture and the description information, wherein the SD model library is used to store pre-trained SD models, each SD model is used to convert and generate a comic style picture, and the comic styles of the pictures converted by any two SD models are different, and the multiple target SD models match the comic styles described by the description information;

[0094] The picture conversion module 503 is used to call multiple target SD models to convert the original pictures into target pictures of multiple comic styles.

[0095] It should be noted that the data acquisition module 501 in this embodiment can be used to execute the above step S201, the model screening module 502 in this embodiment can be used to execute the above step S202, and the image conversion module 503 in this embodiment can be used to execute the above step S203.

[0096] Regarding the device for converting the original image into a comic-style image in this embodiment, the specific manner in which its data acquisition module 501, model screening module 502 and image conversion module 503 execute the method for converting the above-mentioned original image into a comic-style image has been described in detail in the embodiment of the method for converting the original image into a comic-style image, and will not be elaborated here.

[0097] It can be understood that the technical solution provided by this embodiment, each module in the device for converting the original image into a comic-style image, receives the original image and comic-style description information provided by the user, and the system automatically selects matching models from the preset SD model library, and efficiently converts the original image into a variety of personalized comic-style target images. By combining the retrieval enhanced generation (RAG) technology, the intelligent selection of SD models is realized, so that ordinary users can easily customize the comic style and batch generate high-quality comic-style images, which further improves the efficiency of automatically generating comic-style images and lowers the usage threshold of image-to-comic conversion.

[0098] The device in this embodiment, in addition to the above modules, may also include a module for executing any method in any of the above-mentioned embodiments of the method for converting an original image into a comic-style image.

[0099] It should be noted that the above modules and corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules, as part of the device, can be run in the implementation of Figure 1 The hardware environment of the method shown may be implemented by software or hardware, wherein the hardware environment includes a network environment.

[0100] According to another aspect of an embodiment of the present application, an electronic device for implementing the above-mentioned method of converting an original image into a comic-style image is also provided. The electronic device may be a server, a terminal, or a combination thereof.

[0101] According to another embodiment of the present application, an electronic device is also provided. Figure 6 , Figure 6 is a structural block diagram of an optional electronic device provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .

[0102] Memory 1503, used for storing computer programs;

[0103] The processor 1501 is used to implement the following steps when executing the program stored in the memory 1503:

[0104] Step S201, obtaining an original image to be converted and description information, wherein the description information is used to describe the comic style desired by the user;

[0105] Step S202, based on the original picture and the description information, multiple target SD models are screened from a preset SD model library, wherein the SD model library is used to store pre-trained SD models, each SD model is used to convert and generate a comic-style picture, and the comic styles of the pictures converted by any two SD models are different, and the multiple target SD models match the comic styles described by the description information;

[0106] Step S203, calling multiple target SD models to convert the original image into target images of multiple comic styles.

[0107] It can be understood that the technical solution provided by this embodiment is that the processor of the electronic device, by receiving the original picture and comic style description information provided by the user, the system automatically selects the matching model from the preset SD model library, and efficiently converts the original picture into a variety of personalized comic style target pictures. By combining the retrieval enhanced generation (RAG) technology, the intelligent selection of SD models is realized, so that ordinary users can easily customize the comic style and batch generate high-quality comic style pictures, which further improves the efficiency of automatically generating comic style pictures and lowers the usage threshold of picture-to-comic conversion.

[0108] Optionally, in this embodiment, the above-mentioned communication bus can be a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used for communication between the above-mentioned electronic device and other devices.

[0109] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0110] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0111] An embodiment of the present application further provides a computer-readable storage medium, the storage medium including a stored program, wherein the method steps of the above method embodiment are executed when the program is run.

[0112] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media that can store program codes, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.

[0113] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0114] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.

[0115] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0116] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0117] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.

[0118] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0119] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for converting an original image into a comic style image. It is characterized in that include: Obtaining an original image to be converted and description information, wherein the description information is used to describe the comic style desired by the user; According to the original picture and the description information, a plurality of target SD models are screened out from a preset SD model library, wherein the SD model library is used to store pre-trained SD models, each of the SD models is used to convert and generate a comic-style picture, the comic styles of the pictures converted and generated by any two of the SD models are different, and the plurality of target SD models match the comic styles described by the description information; The multiple target SD models are called to convert the original images into target images of multiple comic styles respectively.

2. The method for converting an original picture into a comic style picture according to claim 1, It is characterized in that The calling of the plurality of target SD models to convert the original images into target images of a plurality of comic styles respectively includes: Generate multiple picture conversion tasks according to the access addresses of the multiple target SD models and the original pictures, wherein each picture conversion task specifies the access address of the called target SD model and the original picture to be converted, and the target SD models called by any two picture conversion tasks are different; The multiple image conversion tasks are executed to obtain the target images in multiple comic styles.

3. The method for converting an original picture into a comic style picture according to claim 2, It is characterized in that The performing of the plurality of image conversion tasks to obtain the target images in a plurality of comic styles includes performing each of the image conversion tasks in the following manner: The target SD model is called through the access address of the target SD model specified in the image conversion task to convert the original image into a target image in a comic style.

4. The method for converting an original picture into a comic style picture according to claim 1, It is characterized in that The step of selecting a plurality of target SD models from a preset SD model library according to the original image and the description information includes: According to the original image, the description information and all model labels, a plurality of comic style labels are obtained, wherein all model labels are used to characterize all comic styles of the images converted and generated by all SD models in the SD model library, and each SD model corresponds to a plurality of model labels; From the SD model library, based on the multiple comic style tags and the multiple model tags corresponding to each SD model, multiple target SD models are screened out according to preset screening rules.

5. The method for converting an original picture into a comic style picture according to claim 4, It is characterized in that The method of obtaining a plurality of comic style labels according to the original image, the description information and all model labels includes: Calling the multimodal large model to extract the image information of the original image according to the preset prompt words; Calling the retrieval model to retrieve a preset knowledge base to obtain background knowledge related to the description information; The generation model is called to filter comic style labels according to the background knowledge, the image information, the description information and all the model labels to obtain the multiple comic style labels.

6. The method for converting an original picture into a comic style picture according to claim 4, It is characterized in that The method further comprises: filtering out a plurality of target SD models from the SD model library according to a plurality of the comic style tags and a plurality of the model tags corresponding to each of the SD models and according to a preset filtering rule, including: In the case where there are SD models that hit the comic style label in the SD model library, all SD models that hit the comic style label are sorted in descending order of the number of hits to obtain an SD model sequence, wherein the number of hits is the number of times that the multiple model labels of each SD model hit the comic style label; From the SD model sequence, a preset number of SD models are selected in order from front to back as the multiple target SD models.

7. The method for converting an original picture into a comic style picture according to claim 4, It is characterized in that The method further comprises: filtering out a plurality of target SD models from the SD model library according to a plurality of the comic style tags and a plurality of the model tags corresponding to each of the SD models and according to a preset filtering rule, including: When there is no SD model matching the comic style label in the SD model library, a preset number of SD models are selected from the default recommended SD models as the multiple target SD models.

8. The method for converting an original picture into a comic style picture according to claim 1, It is characterized in that Before selecting a plurality of target SD models from a preset SD model library according to the original image and the description information, the method includes: Using model training materials to train a pre-built model to obtain an SD model, wherein the model training materials are a collection of comic-style pictures; Input the model training material into a preset multimodal large model for processing to obtain multiple model labels corresponding to the SD model; The SD model and the multiple model labels are stored in the SD model library.

9. A device for converting an original picture into a comic style picture, It is characterized in that include: A data acquisition module, used to acquire the original image to be converted and description information, wherein the description information is used to describe the comic style expected by the user; A model screening module, used for screening out a plurality of target SD models from a preset SD model library according to the original picture and the description information, wherein the SD model library is used for storing pre-trained SD models, each of the SD models is used for converting and generating a picture in a comic style, and the comic styles of the pictures converted and generated by any two of the SD models are different, and the plurality of target SD models match the comic styles described by the description information; The image conversion module is used to call the multiple target SD models to convert the original images into target images of multiple comic styles.

10. An electronic device comprising a processor, a communication interface, a memory and a communication bus, in, The processor, the communication interface and the memory communicate with each other via the communication bus, wherein: The memory is used to store computer programs; The processor is used to execute the method of converting an original image into a comic style image according to any one of claims 1 to 8 by running the computer program stored in the memory.

11. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, wherein the computer program is configured to execute the method for converting an original image into a comic-style image as claimed in any one of claims 1 to 8 when running.

Citation Information

Cited By

  • Visual style conversion method and related device

    CN121523677A

  • A visual style transfer method and related apparatus

    CN121523677B