Method and device for generating head portrait frame image, electronic equipment and storage medium

By training elements to adjust the model and update the parameters of the avatar frame generation model, the problem of difficulty in generating AI painting avatar frames with different design styles in the existing technology is solved, and style transfer and stable generation of avatar frames with different design styles is achieved.

CN119810255APending Publication Date: 2025-04-11NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202311305382.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-09
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

It is difficult to quickly and stably generate AI painting avatar frames with different design styles in the existing technology, and there is a difference between the image style of the open source large model and the design style of the avatar frame, so style migration cannot be achieved.

Method used

By obtaining the avatar frame image samples with interface design style and its corresponding image feature information, training elements adjust the model, and using the model to update the avatar frame generation model parameters to achieve style migration.

Benefits of technology

It realizes the rapid change of the interface design style of the avatar frame image generated by the avatar frame generation model, and the stable generation of AI painting avatar frames with different design styles, solving the problem of difficulty in style migration in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810255A_ABST
    Figure CN119810255A_ABST
Patent Text Reader

Abstract

The invention provides a head portrait frame image generation method and device, electronic equipment and a storage medium, and the method comprises the steps: training an element adjustment model with preset training parameters through a head portrait frame image sample and image feature information corresponding to the head portrait frame image sample, and obtaining a trained element adjustment model; the image feature information comprises element features of the head portrait frame image under different visual element types, and updating model parameters of a head portrait frame generation model by using the model parameters of the trained element adjustment model to obtain an updated head portrait frame generation model, and inputting a first element feature under the first target visual element type into the updated head portrait frame generation model to generate a target head portrait frame image representing the first element feature. According to the method, the image style of the head portrait frame generation model can be conveniently and rapidly replaced by the design style of the element adjustment model, and AI painting head portrait frames of different design styles can be rapidly and stably generated.
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, device, electronic device and storage medium for generating an avatar frame image. Background Art

[0002] Artificial Intelligence (AI) painting avatar frames can be applied to various scenarios. For example, on social media, users can combine their avatars with AI painting avatar frames to show their personality and artistic taste; in chat applications, users can use AI painting avatar frames to increase the fun and visual appeal of chats; in addition, AI painting avatar frames can also be applied to various scenarios such as games and electronic business cards, bringing users a new personalized experience.

[0003] In the prior art, when generating AI painting avatar frames, it is found that there is a difference between the image style corresponding to the existing open source large model and the design style of the avatar frame, and it is impossible to achieve the purpose of style transfer through the open source large model to quickly and stably generate AI painting avatar frames with different design styles. In addition, there is currently no suitable avatar frame generation model on the market to quickly and stably generate AI painting avatar frames with different design styles. Summary of the invention

[0004] In view of this, the present application provides a method, device, electronic device and storage medium for generating an avatar frame image, which can solve the technical problem in the prior art that AI painting avatar frames with different painting styles cannot be generated quickly and stably.

[0005] In a first aspect, an embodiment of the present application provides a method for generating an avatar frame image, the method comprising:

[0006] Acquire material image training samples; the material image training samples include avatar frame image samples with an interface design style and image feature information corresponding to the avatar frame image samples, wherein the image feature information includes element features of the avatar frame image under different visual element types;

[0007] Inputting the material image training sample into an element adjustment model with pre-set training parameters for training, thereby obtaining a trained element adjustment model;

[0008] Using the model parameters of the trained element adjustment model, the model parameters of the avatar frame generation model are updated to obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features;

[0009] The first element feature of the first target visual element type is input into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample.

[0010] In a second aspect, an embodiment of the present application further provides a device for generating an avatar frame image, the device comprising:

[0011] An image sample acquisition module is used to acquire material image training samples; the material image training samples include avatar frame image samples with an interface design style and image feature information corresponding to the avatar frame image samples, wherein the image feature information includes element features of the avatar frame image under different visual element types;

[0012] An adjustment model training module is used to input the material image training sample into an element adjustment model with pre-set training parameters for training, so as to obtain a trained element adjustment model;

[0013] A generation model update module is used to adjust the model parameters of the model using the trained elements, update the model parameters of the avatar frame generation model, and obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features;

[0014] An avatar frame generation module is used to input the first element feature under the first target visual element type into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample.

[0015] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to execute the method for generating an avatar frame image as described above.

[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for generating an avatar frame image as described above is executed.

[0017] The avatar frame image generation method, device, electronic device and storage medium provided in the embodiments of the present application train an element adjustment model with pre-set training parameters through multiple avatar frame image samples in the material image training samples and image feature information corresponding to each avatar frame image sample to obtain a trained element adjustment model, wherein the image feature information includes element features of the avatar frame image under different visual element types; then use the model parameters of the trained element adjustment model to update the model parameters of the avatar frame generation model to obtain an updated avatar frame generation model; finally, input the first element feature under the first target visual element type into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature, wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training samples.

[0018] The present application updates the model parameters of the avatar frame generation model by using an element adjustment model in the avatar frame generation model, so as to replace the image style of the avatar frame generation model with the design style of the element adjustment model, thereby achieving the purpose of style transfer. Since the style transfer of the avatar frame generation model can be completed through the element adjustment model, the interface design style of the avatar frame image generated by the avatar frame generation model can be conveniently and quickly changed; and the image feature information used to train the element adjustment model includes the element features of the avatar frame image under different visual element types, which can ensure that a stable element adjustment model is obtained, and then AI painting avatar frames with different design styles can be stably generated.

[0019] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0021] Figure 1 A flowchart of a method for generating an avatar frame image provided in an embodiment of the present application;

[0022] Figure 2 A flowchart of another method for generating an avatar frame image provided in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of the structure of a device for generating an avatar frame image provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of the structure of another device for generating a head portrait frame image provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme 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 a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.

[0027] The embodiments of the present application relate to an AI painting avatar frame, which can be applied to various scenarios. For example, on social media, users can combine their avatars with the AI ​​painting avatar frame to show their personality and artistic taste; in chat applications, users can use the AI ​​painting avatar frame to increase the fun and visual appeal of the chat; in addition, the AI ​​painting avatar frame can also be applied to various scenarios such as games and electronic business cards, bringing users a new personalized experience.

[0028] In the prior art, AI painting generation tools are often used, such as Stable Diffusion to generate AI painting avatar frames. Here, select the open source large model in Stable Diffusion, adjust the model parameters and enter keywords or pictures, then Stable Diffusion can generate AI painting avatar frames, that is, Stable Diffusion can generate pictures from text or pictures from pictures.

[0029] However, when generating AI painting avatar frames, it was found that there were differences between the image style corresponding to the existing open source large model and the design style of the avatar frame. For example, the image style corresponding to the open source large model is realistic, but the design style of the avatar frame is flat. Since the design style of the avatar frame does not match the image style of the open source large model, the open source large model cannot generate an avatar frame that meets the project style requirements, and thus cannot achieve the purpose of style transfer through the open source large model to quickly and stably generate AI painting avatar frames with different design styles. In addition, there is currently no suitable avatar frame generation model on the market to quickly and stably generate AI painting avatar frames with different design styles, which makes it impossible to meet the business standards.

[0030] Based on this, the embodiments of the present application provide a method, device, electronic device and storage medium for generating an avatar frame image, which can not only conveniently and quickly change the interface design style of the avatar frame image generated by the avatar frame generation model, but also can stably generate AI painting avatar frames with different design styles.

[0031] See also Figure 1 , Figure 1 This is a flow chart of a method for generating an avatar frame image provided by an embodiment of the present application. Figure 1 As shown in, the method for generating an avatar frame image provided in an embodiment of the present application includes:

[0032] S101, obtaining a material image training sample; the material image training sample includes an avatar frame image sample having an interface design style and image feature information corresponding to the avatar frame image sample, wherein the image feature information includes element features of the avatar frame image under different visual element types;

[0033] S102, inputting the material image training sample into the element adjustment model with pre-set training parameters for training, to obtain a trained element adjustment model;

[0034] S103, using the model parameters of the trained element adjustment model to update the model parameters of the avatar frame generation model to obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features;

[0035] S104. Input the first element feature of the first target visual element type into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample.

[0036] The embodiment of the present application updates the model parameters of the avatar frame generation model by using an element adjustment model with a smaller file size in the avatar frame generation model, so as to replace the image style of the avatar frame generation model with the design style of the element adjustment model, thereby achieving the purpose of style transfer. Since the style transfer of the avatar frame generation model can be completed through the element adjustment model, the interface design style of the avatar frame image generated by the avatar frame generation model can be conveniently and quickly changed; and the image feature information used to train the element adjustment model includes the element features of the avatar frame image under different visual element types, which can ensure that a stable element adjustment model is obtained, and thus AI painting avatar frames with different design styles can be stably generated.

[0037] To facilitate understanding of the present application, the technical solution provided by the present application is described in detail below in conjunction with specific embodiments. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0038] In step S101, a material image training sample is obtained; the material image training sample includes an avatar frame image sample having an interface design style and image feature information corresponding to the avatar frame image sample, and the image feature information includes element features of the avatar frame image under different visual element types.

[0039] Here, there are many interface design styles, each of which has unique visual characteristics and design methods. Choosing different styles according to actual needs can make the design of the avatar frame more targeted and attractive. Specifically, the interface design styles include flat style, material design style, three-dimensional style and Doodle style. Among them, the flat style is a simple and modern design style that removes unnecessary shadows, textures and 3D effects, and emphasizes simple, clear and easy-to-understand graphic elements. The flat style uses bright and vivid colors, simple shapes and fonts to make the user interface design more intuitive and easy to use, while making the mobile interface easier to operate. The material design style combines paper texture, animation and shadow effects, emphasizes the hierarchy between elements, uses mature animation and shadow effects, makes the user interface more realistic and hierarchical, and uses bright and vivid colors to improve the user's visual experience. The three-dimensional style is more in line with the simulation effect of the real world, such as buttons, sliding bars and switches. Elements use shadows and reflection effects to give users a more intuitive feeling and usage experience. The Doodle style often presents hand-drawn or sketch-like graphics, creatively combining contrasting colors or shapes to create a unique and memorable visual effect.

[0040] Visual elements are the basic building blocks of avatar frame design, including lines, shapes, colors, textures, and patterns. By combining these elements, a large number of avatar frames with different expressions can be created. The visual element type represents the types formed by some visual elements with common properties and characteristics, including style type, subject type, personalized visual type, and background type. Among them, the style type represents the type of interface design style corresponding to the avatar frame image, the subject type represents the type of custom category corresponding to the subject appearing in the avatar frame image, the personalized visual type represents the type of personalized visual elements of the avatar frame in the avatar frame image, and the background type is used to represent the type of element characteristics of the image background of the avatar frame image.

[0041] Specifically, the style element features of the avatar frame image under the style type represent the interface design style corresponding to the avatar frame image; adding the interface design style to the avatar frame image sample can enable the element adjustment model to learn the style element features, and then enable the AI ​​painting generation tool to call the interface design style to output the avatar frame image.

[0042] The subject element features of the avatar frame image under the subject type represent the custom category corresponding to the subject appearing in the avatar frame image, where the custom category is some categories that are redefined to facilitate model learning, such as leaves are defined as plants. For example, common elements such as peonies, magpies, leaves, and buildings appear in most avatar frame image samples. These elements are divided into major categories, and corresponding categories such as flowers, birds, plants, and buildings are obtained. When the element adjustment model is used later, when the corresponding major category vocabulary (for example: building) is input, the element adjustment model will call the visual features of the learned major category items to output the corresponding image.

[0043] The personalized visual element features of the avatar frame image under the personalized visual type represent the personalized visual elements of the avatar frame in the avatar frame image, and the personalized visual elements include but are not limited to shape element features, color element features, and line element features. Among them, the shape element features represent the shape of the subject with the first style, the color element features represent the color features obtained by fusion of multiple colors, and the line element features represent the lines with the first style.

[0044] Here, the element adjustment model is trained by personalized visual element features, so that the elements adjusted by the element adjustment model have personalized visual element features. In this way, when the element adjustment model is used in the avatar frame generation model to update the model parameters of the avatar frame generation model, the avatar frame generated by the avatar frame generation model can have personalized visual element features, thereby ensuring that an AI painting avatar frame with a design style that meets the user's requirements is obtained.

[0045] For example, when the personalized visual element feature includes a line element feature, the line element feature represents a line with a first style. The first style represents a Chinese style. These Chinese style lines may not be included in the open source large model, and text annotations are required to allow the element adjustment model to learn the visual expression corresponding to such line element features.

[0046] In this way, the line element features included in the avatar frame generated by the avatar frame generation model can be adjusted through the element adjustment model, so as to achieve the purpose of conveniently and quickly changing the line style of the avatar frame generated by the avatar frame generation model, thereby achieving the purpose of rapid style transfer.

[0047] The background element features of the avatar frame image under the background type characterize the element features of the image background of the avatar frame image, such as a single color, some descriptions indicating a single image background, etc. The background element features are used to ensure that the avatar frame image generated by the avatar frame generation model maintains a clean background.

[0048] Exemplarily, a solid background color may be added, such as a gray background for the annotation information, or annotation words related to the image background may be directly added to the material image training sample to make the main object of the avatar frame clearer.

[0049] By adding background element features to material image training samples and using the material image training samples with added background element features to train an element adjustment model, the embodiment of the present application allows the element adjustment model to adjust line element features in the avatar frame generated by the avatar frame generation model, thereby enabling the avatar frame generation model to generate avatar frame images with a cleaner background, which is convenient and fast.

[0050] For example, style element features include but are not limited to flat style, material design style, three-dimensional style and Doodle style; subject element features include but are not limited to flowers, trees, plants (actually leaves), buildings, birds, cats, and mountains; line element features include but are not limited to cloud lines, gold lines, wavy lines, and arcs; background element features include but are not limited to pure white background, gray background, separate avatar frame, no characters, and other features.

[0051] In this step, the material image training samples include multiple avatar frame image samples with interface design styles and image feature text corresponding to each avatar frame image sample. The image feature information is the image feature text obtained by manually annotating the avatar frame image samples. Each avatar frame image sample and the image feature text corresponding to the avatar frame image sample adopt the same naming method, such as the same name and the same naming format. The avatar frame image samples and their corresponding image feature texts are associated, and then all the avatar frame image samples and the image feature text corresponding to each avatar frame image sample are saved in a folder for use in element adjustment model training.

[0052] Here, the image feature information includes at least one element feature from the following items: style element feature, subject element feature, personalized visual feature and background element feature. That is to say, when manually annotating the avatar frame image sample, the manually annotated content includes at least one of the above element features, so as to ensure that a relatively stable element adjustment model can be obtained when the avatar frame image sample and the image feature information are used to train the element adjustment model.

[0053] In a preferred implementation, the image feature information includes the avatar frame name, style element features, subject element features, personalized visual element features and background element features, which can ensure that the trained element adjustment model is more stable.

[0054] It should be noted that if the interface design style of all avatar frame image samples in the material image training sample is unified, there is no need to annotate the design style, that is, the image feature information does not need to include style element features; if the interface design style of all avatar frame image samples in the material image training sample is not unified, the design style needs to be annotated, that is, the image feature information needs to include style element features. Here, the image feature information includes style element features, and the trained element adjustment model will be more accurate. Then, the avatar frame image quality generated by the avatar frame generation model updated by the element adjustment model will be better, and it will be more convenient to use the avatar frame. Furthermore, the quality of the avatar frame can be differentiated by annotating the interface design style, and the generated avatar frame will display the design style in the name of the avatar frame.

[0055] Furthermore, in addition to the element features of the avatar frame image under different visual element types, the image feature information also includes the avatar frame name. Specifically, the avatar frame name is used to characterize the specific name of the element adjustment model, which is a unique identifier that can identify the element adjustment model and can be understood as ID information. In this way, it is convenient to accurately call the element adjustment model through the avatar frame name, and then it is convenient to insert the element adjustment model into the avatar frame generation model. The specific implementation method includes: clicking the element adjustment model use button on the AI ​​painting generation tool to display the specific name corresponding to the element adjustment model in the keyword input box of the AI ​​painting generation tool, so as to use the interface design style of the element adjustment model to replace the style of the avatar frame generation model in the AI ​​painting generation tool.

[0056] For example, in the preparation stage of material image training samples, high-quality avatar frame image samples in the project are collected, cropped to 512x512 pixel size, and the image background is set to a gray background to ensure that the subsequent output images remain clean. The images are manually annotated, and at least 100 high-quality material images are required. Text annotation is performed on the avatar frame image samples, and the text annotation method is: avatar frame name + subject element features + line element features + background element features (for example: L35 avatar frame + bird + gold line + gray background).

[0057] Specifically, each avatar frame image sample in the material image training sample has the following characteristics: the avatar frame is distributed around the avatar in the avatar frame image sample and the element features are distributed on the avatar frame; further, after training the element adjustment model with the above-mentioned material image training samples and using the element adjustment model to update the avatar frame generation model, the target avatar frame image generated by the updated avatar frame generation model also has the following characteristics: the avatar frame is distributed around the avatar in the target avatar frame image and the element features are distributed on the avatar frame.

[0058] Specifically, the distribution of the avatar frames around the avatar in the avatar frame image sample reflects the positional relationship between the avatar frames and the avatar, that is, the avatar frames are distributed around the avatar. In addition, the avatar frames are evenly distributed. For example, the avatar frames are distributed in the middle of the picture, and the avatar frames are distributed according to preset shapes, which include but are not limited to ring shapes, rectangular shapes, regular polygon shapes, etc. Among them, the picture is 512x512 pixels in size; for example, the distribution of element features on the avatar frame reflects that the element features are distributed in the lower left corner or upper right corner of the avatar frame.

[0059] Furthermore, the AI ​​painting generation tool can generate and output avatar frame images that meet the project style and business requirements. All generated avatar frame images can meet the following characteristics: the avatar frames are evenly distributed and the element features are distributed on the avatar frames. For example, the elements are distributed in a circular manner, and the design style meets the project requirements. Here, the project style refers to a more conceptual style, such as a flat style.

[0060] In an optional embodiment, the avatar frame image samples in the material image training samples include a first style subject, and the image feature information corresponding to the avatar frame image samples including the first style subject includes subject element features; in step S103, the model parameters of the trained element adjustment model are used to update the model parameters associated with the subject element features in the avatar frame generation model to obtain an updated avatar frame generation model; wherein the target model parameters of the avatar frame generation model before the update represent the correspondence between the second style subject and the subject element features, the target model parameters of the updated avatar frame generation model represent the correspondence between the first style subject and the subject element features, and the subject element features corresponding to the second style subject are the same as the subject element features corresponding to the first style subject.

[0061] Here, the second style is different from the first style. Exemplarily, the first style subject has oriental characteristics, and the second style subject has western characteristics. In the embodiment of the present application, in step S103, the correspondence between the second style subject and the subject element features is updated to the correspondence between the first style subject and the subject element features, so that the target model parameters of the avatar frame generation model can be updated quickly, and then the avatar frame image with the first style subject can be obtained by using the updated avatar frame generation model.

[0062] The above scheme can easily and quickly complete the style replacement of the main object without re-training the open source large model, reducing resource usage, and further ensuring that the AI ​​painting generation tool generates an avatar frame image with the main object in the first style.

[0063] In the related scheme, some elements included in the open source big model of the AI ​​painting generation tool are Western elements, but the elements in the avatar frame generated in the embodiment of the present application are all Eastern elements. For example, the open source big model will not use traditional Chinese subjects as training samples, but generally uses Western picture libraries to do so, while the building complexes in our project requirements are all traditional Chinese building complexes. Furthermore, when the project requirement is to obtain an avatar frame image with oriental elements, the avatar frame image generated by the existing AI painting generation tool will not meet the project requirements. In order to solve the above problems, it is necessary to replace some Western element vocabulary in the open source big model with Eastern element vocabulary. The specific approach is:

[0064] Selecting some avatar frame image samples with traditional Chinese subjects to train the element adjustment model; specifically, at least some of the avatar frame image samples in the material image training samples include traditional Chinese subjects, and the image feature text corresponding to each avatar frame image sample including the traditional Chinese subject at least includes subject element features;

[0065] In step S102, the material image training samples are input into the element adjustment model with pre-set training parameters for training, and a trained element adjustment model is obtained, wherein the material image training samples include head frame image samples with traditional Chinese subjects. In this way, some Western elements represented by subject elements in the trained element adjustment model are changed to traditional Chinese subjects.

[0066] Further, in step S103, the model parameters of the trained element adjustment model are used to update the model parameters associated with the subject element features in the avatar frame generation model to obtain an updated avatar frame generation model; wherein the target model parameters of the avatar frame generation model before the update are used to represent the correspondence between the Western subject and the subject element features, and the target model parameters of the updated avatar frame generation model are used to represent the correspondence between the traditional Chinese subject and the subject element features, and the subject element features corresponding to the Western subject are the same as the subject element features corresponding to the traditional Chinese subject.

[0067] Through the above method, the Western vocabulary meaning represented by a certain element in the open source large model can be replaced with the meaning represented by the traditional Chinese subject. Since the file size of the element adjustment model is much smaller than the file size of the open source large model, the element adjustment model can be used to quickly and easily complete the concept replacement of vocabulary without re-training the open source large model, thus reducing resource usage. Furthermore, it can further ensure that the AI ​​painting generation tool generates avatar frame images that meet project requirements.

[0068] Specifically, in step S102, the material image training sample is input into the element adjustment model with pre-set training parameters for training, so as to obtain a trained element adjustment model.

[0069] First, set the training parameters for the element tuning model by following these steps:

[0070] Step a: In response to a parameter configuration operation for the element adjustment model, determine the configuration parameters set for the element adjustment model; the configuration parameters include at least one of the following items: number of training steps per graph, learning rate scheduler type, and optimizer type.

[0071] The configuration parameters include the number of training steps per graph, the type of learning rate scheduler, and the type of optimizer; wherein the number of training steps per graph includes a preset number of steps, preferably, the preset number of steps is 200 steps, the type of learning rate scheduler includes cosine, and the type of optimizer includes 8bit-Adam.

[0072] Among them, the number of training steps per image represents the number of iterations performed for each image during the training of the element adjustment model. When training a machine learning model, multiple iterations are required to optimize the parameters of the model to minimize the loss function or maximize the performance index. Among them, all the avatar frame image samples and the image feature text corresponding to each avatar frame image sample are placed in the same folder, and the folder name includes the number of training steps per image. The number of training steps per image here can be selected as 200 steps, so that the element adjustment model can achieve a better training effect.

[0073] Preferably, the learning rate scheduler can use cosine, which is a technology for dynamically adjusting the learning rate. It can automatically adjust the learning rate according to the performance of the model during the training process to improve the model's training effect (making the element adjustment model learn more like the interface design style of the input avatar frame image sample) and generalization ability (the element adjustment model's ability to draw inferences from one example). Cosine is used here because the learning rate scheduler can ensure that the learning rate of the element adjustment model follows the trend of the cosine function. The cosine function is used to adjust the learning rate so that the learning rate gradually decreases during the training process, ensuring that the element adjustment model learns the project style appropriately.

[0074] Preferably, the optimizer can use 8bit-adam, which is an optimization algorithm for deep learning. It can significantly reduce the use of storage and computing resources without affecting the accuracy of the element adjustment model, thereby making the model training and reasoning faster.

[0075] Step b: Load the configuration parameters into the initial training parameters of the element adjustment model to determine the training parameters set for the element adjustment model.

[0076] After the above parameters are set, click the button to start training the model to start training the element adjustment model. Specifically, the configuration parameters are loaded into the initial training parameters of the element adjustment model, the training parameters set for the element adjustment model are determined, and the element adjustment model with pre-set training parameters is trained in combination with the material image training samples to obtain a trained element adjustment model. Here, the training cutoff condition for the element adjustment model is that the number of training times reaches the target total number of steps, and the target total number of steps is the product of the number of training steps per image and the number of samples of the material image training samples.

[0077] After completing the training of the element adjustment model, the element adjustment model will be tested, including text-to-image test, image-to-image test, weight test, and versatility test. The test is used to determine whether the element adjustment model can meet the project requirements. If the output element adjustment model is found to meet the test requirements after testing, the training of the element adjustment model is completed.

[0078] Optionally, after obtaining the trained element adjustment model, the embodiment of the present application further includes:

[0079] Step c: testing the trained element adjustment model to generate test results; wherein the testing method includes at least one of the following items: text-to-graph test, image-to-graph test, weight test and versatility test.

[0080] Among them, the text-generated image test refers to inputting a keyword to see if the element adjustment model can output the graphics corresponding to the keyword. The image-generated image test refers to inputting an image at random, generally selecting a sketch, and then testing whether the sketch can generate an image that conforms to the style of the project, and then used to verify whether it can be mass-produced. The smaller the weight of the element adjustment model, the more it tends to be in the style of the open source large model. The larger the weight of the element adjustment model, the more it tends to be in the style of the element adjustment model. The weight ranges from 0 to 1. The weight in this case is 1. The weight test is used to detect whether the style of the generated image is the style of the element adjustment model when the weight is 1. The versatility test refers to preventing overfitting. Overfitting means that the element adjustment model cannot draw inferences from one example, that is, changing a few keywords to test whether the element adjustment model can normally change the elements in the generated image.

[0081] Step d: If the test result meets the preset test requirements, the trained element adjustment model is used to update the avatar frame generation model.

[0082] Here, the test results meeting the preset test requirements means that the text-generated image test, image-generated image test, weight test and versatility test all meet the test requirements. Among them, meeting the test requirements means that the model accuracy is not less than the preset accuracy. In this case, the training of the element adjustment model can be stopped, and then the trained element adjustment model can be used to update the avatar frame generation model, so as to further obtain the avatar frame image that meets the project requirements.

[0083] Exemplarily, the element adjustment model is the LoRA model (Low-Rank Adaptation of Large Language Models), which is a low-rank adaptation version of the open source large model. It is a smaller painting model that can achieve fine-tuning of the open source large model. The open source large model here is an avatar frame generation model. For example, the style corresponding to the open source large model is the Chinese painting style, but the design style corresponding to the LoRA model is the flat style. The LoRA model will call out the parts of the open source large model that are related to the flat style, replace them with the LoRA model, and then put them back into the open source large model.

[0084] Compared with open source large models, LoRA model files are small (open source large model files are mostly around 4G, while LoRA models are generally below 144M), and are more convenient and controllable to call. The LoRA model can achieve the effect of style transfer, stably generate avatar frame images that meet the project style, and ensure that the visual elements related to the avatar frame image appear stably in the picture, so that the avatar frame image can meet the target requirements.

[0085] Specifically, the training process of the LoRA model is as follows: collect material image training samples, crop each avatar frame image sample in the material image training samples and perform text annotation to obtain image feature text, then place the avatar frame image sample and image feature text into the open source large model of Stable Diffusion, use the LoRA model training script, and set the training parameters. The algorithm in the open source large model will train the LoRA model based on the avatar frame image samples, image feature text, and training parameters, and finally output the LoRA model.

[0086] Furthermore, in step S103, the model parameters of the avatar frame generation model are updated using the model parameters of the trained element adjustment model to obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features.

[0087] Exemplarily, the avatar frame generation model can be an open source large model in Stable Diffusion. By inputting element features in Stable Diffusion, an avatar frame image that conforms to the project style can be generated, wherein the element features are keywords used to generate the avatar frame image.

[0088] Here, there are two ways to use the element adjustment model. One is to write it in the element feature input box of Stable Diffusion, and the other is to write it in the plug-in and call the element adjustment model through the plug-in. The embodiment of the present application directly writes the element adjustment model in the element feature input box to facilitate the adjustment of the model weight and copying. Specifically, there is an application icon of the element adjustment model below the Stable Diffusion generation control. Click the application icon to automatically copy the element adjustment model to the element feature input box. Furthermore, in the process of generating the avatar frame image using the input element features in Stable Diffusion, the model parameters of the avatar frame generation model will be updated in advance using the element adjustment model, so that Stable Diffusion uses the updated avatar frame generation model to generate the avatar frame image.

[0089] In step S104, the first element feature of the first target visual element type is input into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample.

[0090] Here, since the model parameters of the avatar frame generation model have been updated using the element adjustment model in step S103, the style of the updated avatar frame generation model becomes the interface design style corresponding to the element adjustment model, wherein the interface design style corresponding to the element adjustment model is the same as the interface design style of the avatar frame image sample in the material image training sample. Here, the element adjustment model only updates some model parameters of the avatar frame generation model.

[0091] In the related scheme, considering that the target avatar frame image includes multiple avatar frame images to be processed, some of the avatar frame images to be processed may be more in line with the project style, and some of the avatar frame images to be processed may not be in line with the project style. At this time, in order to further improve the quality of the final avatar frame image and make it as consistent as possible with the project style, the embodiment of the present application can adopt the following scheme:

[0092] See also Figure 2 , Figure 2 This is a flow chart of another method for generating an avatar frame image provided by an embodiment of the present application. Figure 2 As shown in, the method for generating an avatar frame image provided in an embodiment of the present application includes:

[0093] S201, obtaining a material image training sample; the material image training sample includes an avatar frame image sample having an interface design style and image feature information corresponding to the avatar frame image sample, wherein the image feature information includes element features of the avatar frame image under different visual element types;

[0094] S202, inputting the material image training sample into the element adjustment model with pre-set training parameters for training, to obtain a trained element adjustment model;

[0095] S203, using the model parameters of the trained element adjustment model to update the model parameters of the avatar frame generation model to obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features;

[0096] S204, inputting the first element feature of the first target visual element type into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample;

[0097] S205. Input the target avatar frame image to be processed and the second element feature under the second target visual element type into the updated avatar frame generation model to generate multiple extended avatar frame images associated with the target avatar frame image; wherein the second target visual element type corresponding to the second element feature is the same as the first target visual element type corresponding to the first element feature.

[0098] The description of steps S201 to S204 may refer to the description of steps S101 to S104 and will not be repeated here.

[0099] In step S205, the target avatar frame image and the second element feature under the second target visual element type are input into the updated avatar frame generation model to generate multiple extended avatar frame images associated with the target avatar frame image; wherein the second target visual element type corresponding to the second element feature is the same as the first target visual element type corresponding to the first element feature.

[0100] Here, the image generation function of Stable Diffusion is used to expand more avatar frame images that meet the project style based on the target avatar frame image. Specifically, the target avatar frame image and the second element feature under the second target visual element type are input into the element feature input box of Stable Diffusion, so that the updated avatar frame generation model in Stable Diffusion continues to generate expanded avatar frame images.

[0101] In the embodiment of the present application, the second target visual element type corresponding to the second element feature is the same as the first target visual element type corresponding to the first element feature. In one embodiment, the second element feature under the second target visual element type can be completely the same as the first element feature under the first target visual element type; in another embodiment, the second element feature under the second target visual element type is an element feature obtained by slightly changing the first element feature under the first target visual element type.

[0102] Here, by setting the second target visual element type corresponding to the second element feature to be the same as the first target visual element type corresponding to the first element feature, multiple extended avatar frame images can be obtained using the target avatar frame image and the second element feature under the second target visual element type, thereby improving the diversity of user choices, allowing users to obtain avatar frame images that match the project style as quickly as possible, which helps to improve the quality of the acquired avatar frame images.

[0103] Furthermore, if the avatar frame image generated by the text-generated image function of Stable Diffusion is more in line with the project style, the image-generated image function of Stable Diffusion can be further applied to further expand one of the avatar frame images that is more in line with the project style. And so on, until an avatar frame image that meets the project requirements is generated.

[0104] Through the above method, the accuracy of the generated avatar frame image can be further improved, making it more in line with the project style, which is conducive to the promotion and application of the avatar frame image.

[0105] Furthermore, the method provided in the embodiment of the present application also includes:

[0106] In response to an editing operation on a target avatar frame image and / or a target extended avatar frame image using image processing software, the target avatar frame image and / or the target extended avatar frame image is modified; the target extended avatar frame image is part or all of the multiple extended avatar frame images.

[0107] The target extended avatar frame image may be one of the multiple extended avatar frame images, where one of the extended avatar frame images refers to an avatar frame image with relatively high quality among the multiple extended avatar frame images. When the target extended avatar frame image is all of the multiple extended avatar frame images, it can be said that the image quality of the multiple extended avatar frame images is relatively high, and thus all of them can be adopted by the user.

[0108] After the generation of the avatar frame image is completed, the target avatar frame image and / or the target extended avatar frame image will continue to be manually corrected so that the avatar frame image generated by the avatar frame generation model can reach the quality for business use.

[0109] Here, manual correction refers to the drawing correction of the avatar frame image produced by AI by art practitioners, using Adobe Photoshop to edit the avatar frame image, and correcting, deleting, and supplementing some content that is not logical and does not conform to normal art drawing rules until the picture effect reaches the actual production level.

[0110] Through the above method, the final avatar frame image can be made to be highly consistent with the project style and can be promoted and applied.

[0111] The embodiment of the present application updates the model parameters of the avatar frame generation model by using the element adjustment model in the avatar frame generation model, so as to replace the image style of the avatar frame generation model with the design style of the element adjustment model, thereby achieving the purpose of style transfer. Since the style transfer of the avatar frame generation model can be completed through the element adjustment model, the interface design style of the avatar frame image generated by the avatar frame generation model can be conveniently and quickly changed; and the image feature information used to train the element adjustment model includes the element features of the avatar frame image under different visual element types, which can ensure that a stable element adjustment model is obtained, and then AI painting avatar frames with different design styles can be stably generated.

[0112] Based on the same inventive concept, the embodiment of the present application also provides a device for generating an avatar frame image corresponding to the method for generating an avatar frame image. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the method for generating an avatar frame image in the embodiment of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0113] See also Figure 3 , Figure 4 , Figure 3 A schematic diagram of the structure of a device for generating an avatar frame image provided in an embodiment of the present application. Figure 4 This is a schematic diagram of the structure of another device for generating a head portrait frame image provided by an embodiment of the present application. Figure 3 As shown in , the device 300 includes:

[0114] The image sample acquisition module 301 is used to acquire material image training samples; the material image training samples include avatar frame image samples with an interface design style and image feature information corresponding to each avatar frame image sample, wherein the image feature information includes element features of the avatar frame image under different visual element types;

[0115] The adjustment model training module 302 is used to input the material image training sample into the element adjustment model with pre-set training parameters for training, so as to obtain a trained element adjustment model;

[0116] A generation model update module 303 is used to use the model parameters of the trained element adjustment model to update the model parameters of the avatar frame generation model to obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features;

[0117] The avatar frame generation module 304 is used to input the first element feature under the first target visual element type into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample.

[0118] In an optional embodiment of the present application, the image feature information includes at least one element feature of the following items: style element feature, subject element feature, personalized visual element feature and background element feature;

[0119] Among them, the style element characteristics represent the interface design style corresponding to the avatar frame image, the subject object element characteristics represent the custom category corresponding to the subject object appearing in the avatar frame image, the personalized visual element characteristics represent the personalized visual elements of the avatar frame in the avatar frame image, and the background element characteristics represent the element characteristics of the image background of the avatar frame image.

[0120] In an optional embodiment of the present application, the personalized visual element feature includes a line element feature, and the line element feature represents a line with a first style.

[0121] In an optional embodiment of the present application, the avatar frame image sample in the material image training sample includes a first style subject, and the image feature information corresponding to the avatar frame image sample including the first style subject includes subject element features;

[0122] The generation model updating module 303 is specifically used for:

[0123] Using the trained element adjustment model parameters, the model parameters associated with the subject element features in the avatar frame generation model are updated to obtain an updated avatar frame generation model;

[0124] Among them, the target model parameters of the avatar frame generation model before updating represent the correspondence between the second style subject and the subject element features, and the target model parameters of the avatar frame generation model after updating are used to represent the correspondence between the first style subject and the subject element features, and the subject element features corresponding to the second style subject are the same as the subject element features corresponding to the first style subject.

[0125] In an optional embodiment of the present application, the avatar frame image sample in the material image training sample has the following characteristics: the avatar frame is distributed around the avatar in the avatar frame image sample and the element features are distributed on the avatar frame;

[0126] The target avatar frame image has the following characteristics: the avatar frame is distributed around the avatar in the avatar frame image sample, and the element features are distributed on the avatar frame.

[0127] In an optional embodiment of the present application, after obtaining the trained element adjustment model, the device further includes a model testing module (not shown in the figure), and the model testing module is used to:

[0128] Testing the trained element adjustment model to generate a test result; wherein the testing method includes at least one of the following items: a text-generated graph test, a graph-generated graph test, a weight test, and a versatility test;

[0129] If the test result meets the preset test requirements, the avatar frame generation model is updated using the trained element adjustment model.

[0130] In an optional embodiment of the present application, the adjustment model training module 302 is used to set training parameters for the element adjustment model through the following steps:

[0131] In response to a parameter configuration operation for the element adjustment model, determining a configuration parameter set for the element adjustment model; the configuration parameter includes at least one of the following items: a number of training steps per graph, a learning rate scheduler type, and an optimizer type;

[0132] The configuration parameters are loaded into the initial training parameters of the element adjustment model to determine the training parameters set for the element adjustment model.

[0133] In an optional embodiment of the present application, the number of training steps for each graph includes a preset number of steps, the type of the learning rate scheduler includes cosine, and the type of the optimizer includes 8bit-Adam.

[0134] Further, such as Figure 4 As shown, the device 300 further includes an image expansion module 305, and the image expansion module 305 is used to:

[0135] The target avatar frame image and the second element feature under the second target visual element type are input into the updated avatar frame generation model to generate multiple extended avatar frame images associated with the target avatar frame image; wherein the second target visual element type corresponding to the second element feature is the same as the first target visual element type corresponding to the first element feature.

[0136] In an optional embodiment of the present application, the apparatus 300 further includes an image editing module 306, and the image editing module 306 is used to:

[0137] In response to an editing operation on a target avatar frame image and / or a target extended avatar frame image using image processing software, the target avatar frame image and / or the target extended avatar frame image is modified; the target extended avatar frame image is part or all of the multiple extended avatar frame images.

[0138] The device for generating an avatar frame image provided by the embodiment of the present application updates the model parameters of the avatar frame generation model by using the element adjustment model in the avatar frame generation model, so as to replace the image style of the avatar frame generation model with the design style of the element adjustment model, thereby achieving the purpose of style transfer. Since the style transfer of the avatar frame generation model can be completed through the element adjustment model, the interface design style of the avatar frame image generated by the avatar frame generation model can be conveniently and quickly changed; and the image feature information used to train the element adjustment model includes the element features of the avatar frame image under different visual element types, which can ensure that a stable element adjustment model is obtained, and then AI painting avatar frames with different design styles can be stably generated.

[0139] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .

[0140] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the following method may be executed:

[0141] Acquire material image training samples; the material image training samples include avatar frame image samples with an interface design style and image feature information corresponding to the avatar frame image samples, wherein the image feature information includes element features of the avatar frame image under different visual element types;

[0142] Inputting the material image training sample into an element adjustment model with pre-set training parameters for training, thereby obtaining a trained element adjustment model;

[0143] Using the model parameters of the trained element adjustment model, the model parameters of the avatar frame generation model are updated to obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features;

[0144] The first element feature of the first target visual element type is input into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample.

[0145] In an optional embodiment of the present application, the image feature information includes at least one element feature of the following items: style element feature, subject element feature, personalized visual element feature and background element feature;

[0146] Among them, the style element characteristics represent the interface design style corresponding to the avatar frame image, the subject element characteristics represent the category corresponding to the subject appearing in the avatar frame image, the personalized visual element characteristics represent the personalized visual elements of the avatar frame in the avatar frame image, and the background element characteristics represent the element characteristics of the image background of the avatar frame image.

[0147] In an optional embodiment of the present application, the personalized visual element feature includes a line element feature, and the line element feature represents a line with a first style.

[0148] In an optional embodiment of the present application, the avatar frame image sample in the material image training sample includes a first style subject, and the image feature information corresponding to the avatar frame image sample including the first style subject includes subject element features;

[0149] When the processor 510 uses the trained element to adjust the model parameters of the model, updates the model parameters of the avatar frame generation model, and obtains the updated avatar frame generation model, the processor 510 specifically performs the following steps:

[0150] Using the trained element adjustment model parameters, the model parameters associated with the subject element features in the avatar frame generation model are updated to obtain an updated avatar frame generation model;

[0151] Among them, the target model parameters of the avatar frame generation model before updating represent the correspondence between the second style subject and the subject element features, and the target model parameters of the avatar frame generation model after updating represent the correspondence between the first style subject and the subject element features, and the subject element features corresponding to the second style subject are the same as the subject element features corresponding to the first style subject.

[0152] In an optional embodiment of the present application, the avatar frame image sample in the material image training sample has the following characteristics: the avatar frame is distributed around the avatar in the avatar frame image sample and the element features are distributed on the avatar frame;

[0153] The target avatar frame image has the following characteristics: the avatar frame is distributed around the avatar in the target avatar frame image, and the element features are distributed on the avatar frame.

[0154] In an optional embodiment of the present application, after obtaining the trained element adjustment model, the processor 510 further performs the following steps:

[0155] Testing the trained element adjustment model to generate a test result; wherein the testing method includes at least one of the following items: a text-generated graph test, a graph-generated graph test, a weight test, and a versatility test;

[0156] If the test result meets the preset test requirements, the avatar frame generation model is updated using the trained element adjustment model.

[0157] In an optional embodiment of the present application, the processor 510 sets training parameters for the element adjustment model through the following steps:

[0158] In response to a parameter configuration operation for the element adjustment model, determining a configuration parameter set for the element adjustment model; the configuration parameter includes at least one of the following items: a number of training steps per graph, a learning rate scheduler type, and an optimizer type;

[0159] The configuration parameters are loaded into the initial training parameters of the element adjustment model to determine the training parameters set for the element adjustment model.

[0160] In an optional embodiment of the present application, the number of training steps for each graph includes a preset number of steps, the type of the learning rate scheduler includes cosine, and the type of the optimizer includes 8bit-Adam.

[0161] In an optional embodiment of the present application, the processor 510 further performs the following steps:

[0162] The target avatar frame image and the second element feature under the second target visual element type are input into the updated avatar frame generation model to generate multiple extended avatar frame images associated with the target avatar frame image; wherein the second target visual element type corresponding to the second element feature is the same as the first target visual element type corresponding to the first element feature.

[0163] In an optional embodiment of the present application, the processor 510 further performs the following steps:

[0164] In response to an editing operation on a target avatar frame image and / or a target extended avatar frame image using image processing software, the target avatar frame image and / or the target extended avatar frame image is modified; the target extended avatar frame image is part or all of the multiple extended avatar frame images.

[0165] The embodiment of the present application updates the model parameters of the avatar frame generation model by using the element adjustment model in the avatar frame generation model, so as to replace the image style of the avatar frame generation model with the design style of the element adjustment model, thereby achieving the purpose of style transfer. Since the style transfer of the avatar frame generation model can be completed through the element adjustment model, the interface design style of the avatar frame image generated by the avatar frame generation model can be conveniently and quickly changed; and the image feature information used to train the element adjustment model includes the element features of the avatar frame image under different visual element types, which can ensure that a stable element adjustment model is obtained, and then AI painting avatar frames with different design styles can be stably generated.

[0166] The embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the computer-readable storage medium can perform the following steps:

[0167] Acquire material image training samples; the material image training samples include avatar frame image samples with an interface design style and image feature information corresponding to the avatar frame image samples, wherein the image feature information includes element features of the avatar frame image under different visual element types;

[0168] Inputting the material image training sample into an element adjustment model with pre-set training parameters for training, thereby obtaining a trained element adjustment model;

[0169] Using the model parameters of the trained element adjustment model, the model parameters of the avatar frame generation model are updated to obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features;

[0170] The first element feature of the first target visual element type is input into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample.

[0171] In an optional embodiment of the present application, the image feature information includes at least one element feature of the following items: style element feature, subject element feature, personalized visual element feature and background element feature;

[0172] Among them, the style element characteristics represent the interface design style corresponding to the avatar frame image, the subject element characteristics represent the category corresponding to the subject appearing in the avatar frame image, the personalized visual element characteristics represent the personalized visual elements of the avatar frame in the avatar frame image, and the background element characteristics represent the element characteristics of the image background of the avatar frame image.

[0173] In an optional embodiment of the present application, the personalized visual element feature includes a line element feature, and the line element feature represents a line with a first style.

[0174] In an optional embodiment of the present application, the avatar frame image sample in the material image training sample includes a first style subject, and the image feature information corresponding to the avatar frame image sample including the first style subject includes subject element features;

[0175] When the computer-readable storage medium uses the trained elements to adjust the model parameters of the model, updates the model parameters of the avatar frame generation model, and obtains the updated avatar frame generation model, the computer-readable storage medium specifically performs the following steps:

[0176] Using the trained element adjustment model parameters, the model parameters associated with the subject element features in the avatar frame generation model are updated to obtain an updated avatar frame generation model;

[0177] Among them, the target model parameters of the avatar frame generation model before updating represent the correspondence between the second style subject and the subject element features, and the target model parameters of the avatar frame generation model after updating represent the correspondence between the first style subject and the subject element features, and the subject element features corresponding to the second style subject are the same as the subject element features corresponding to the first style subject.

[0178] In an optional embodiment of the present application, the avatar frame image sample in the material image training sample has the following characteristics: the avatar frame is distributed around the avatar in the avatar frame image sample and the element features are distributed on the avatar frame;

[0179] The target avatar frame image has the following characteristics: the avatar frame is distributed around the avatar in the target avatar frame image, and the element features are distributed on the avatar frame.

[0180] In an optional embodiment of the present application, after obtaining the trained element adjustment model, the computer-readable storage medium further performs the following steps:

[0181] Testing the trained element adjustment model to generate a test result; wherein the testing method includes at least one of the following items: a text-generated graph test, a graph-generated graph test, a weight test, and a versatility test;

[0182] If the test result meets the preset test requirements, the avatar frame generation model is updated using the trained element adjustment model.

[0183] In an optional embodiment of the present application, a computer-readable storage medium sets training parameters for the element adjustment model through the following steps:

[0184] In response to a parameter configuration operation for the element adjustment model, determining a configuration parameter set for the element adjustment model; the configuration parameter includes at least one of the following items: a number of training steps per graph, a learning rate scheduler type, and an optimizer type;

[0185] The configuration parameters are loaded into the initial training parameters of the element adjustment model to determine the training parameters set for the element adjustment model.

[0186] In an optional embodiment of the present application, the number of training steps for each graph includes a preset number of steps, the type of the learning rate scheduler includes cosine, and the type of the optimizer includes 8bit-Adam.

[0187] In an optional embodiment of the present application, the computer-readable storage medium further performs the following steps:

[0188] The target avatar frame image and the second element feature under the second target visual element type are input into the updated avatar frame generation model to generate multiple extended avatar frame images associated with the target avatar frame image; wherein the second target visual element type corresponding to the second element feature is the same as the first target visual element type corresponding to the first element feature.

[0189] In an optional embodiment of the present application, the computer-readable storage medium further performs the following steps:

[0190] In response to an editing operation on a target avatar frame image and / or a target extended avatar frame image using image processing software, the target avatar frame image and / or the target extended avatar frame image is modified; the target extended avatar frame image is part or all of the multiple extended avatar frame images.

[0191] The embodiment of the present application updates the model parameters of the avatar frame generation model by using the element adjustment model in the avatar frame generation model, so as to replace the image style of the avatar frame generation model with the design style of the element adjustment model, thereby achieving the purpose of style transfer. Since the style transfer of the avatar frame generation model can be completed through the element adjustment model, the interface design style of the avatar frame image generated by the avatar frame generation model can be conveniently and quickly changed; and the image feature information used to train the element adjustment model includes the element features of the avatar frame image under different visual element types, which can ensure that a stable element adjustment model is obtained, and then AI painting avatar frames with different design styles can be stably generated.

[0192] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0193] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. 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 communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0194] 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 of this embodiment.

[0195] 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.

[0196] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0197] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for generating an avatar frame image, characterized in that: The method comprises: Acquire material image training samples; the material image training samples include avatar frame image samples with an interface design style and image feature information corresponding to the avatar frame image samples, wherein the image feature information includes element features of the avatar frame image under different visual element types; Inputting the material image training sample into an element adjustment model with pre-set training parameters for training, thereby obtaining a trained element adjustment model; Using the model parameters of the trained element adjustment model, the model parameters of the avatar frame generation model are updated to obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features; The first element feature of the first target visual element type is input into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample.

2. The method according to claim 1, characterized in that The image feature information includes at least one element feature of the following items: style element feature, subject element feature, personalized visual element feature and background element feature; Among them, the style element characteristics represent the interface design style corresponding to the avatar frame image, the subject element characteristics represent the category corresponding to the subject appearing in the avatar frame image, the personalized visual element characteristics represent the personalized visual elements of the avatar frame in the avatar frame image, and the background element characteristics represent the element characteristics of the image background of the avatar frame image.

3. The method according to claim 2, characterized in that The personalized visual element feature includes a line element feature, and the line element feature represents a line with a first style.

4. The method according to claim 1, characterized in that: The avatar frame image sample in the material image training sample includes a first style subject, and the image feature information corresponding to the avatar frame image sample including the first style subject includes subject element features; The method uses the trained elements to adjust the model parameters of the model, updates the model parameters of the avatar frame generation model, and obtains the updated avatar frame generation model, including: Using the trained element adjustment model parameters, the model parameters associated with the subject element features in the avatar frame generation model are updated to obtain an updated avatar frame generation model; Among them, the target model parameters of the avatar frame generation model before updating represent the correspondence between the second style subject and the subject element features, and the target model parameters of the avatar frame generation model after updating represent the correspondence between the first style subject and the subject element features, and the subject element features corresponding to the second style subject are the same as the subject element features corresponding to the first style subject.

5. The method according to claim 1, characterized in that The avatar frame image sample in the material image training sample has the following characteristics: the avatar frame is distributed around the avatar in the avatar frame image sample and the element features are distributed on the avatar frame; The target avatar frame image has the following characteristics: The avatar frame is distributed around the avatar in the target avatar frame image, and the element features are distributed on the avatar frame.

6. The method according to claim 1, characterized in that After obtaining the trained element adjustment model, the method further includes: Testing the trained element adjustment model to generate a test result; wherein the testing method includes at least one of the following items: a text-generated graph test, a graph-generated graph test, a weight test, and a versatility test; If the test result meets the preset test requirements, the avatar frame generation model is updated using the trained element adjustment model.

7. The method according to claim 1, characterized in that Set the training parameters for the element tuning model by following these steps: In response to a parameter configuration operation for the element adjustment model, determining a configuration parameter set for the element adjustment model; the configuration parameter includes at least one of the following items: a number of training steps per graph, a learning rate scheduler type, and an optimizer type; The configuration parameters are loaded into the initial training parameters of the element adjustment model to determine the training parameters set for the element adjustment model.

8. The method according to claim 7, characterized in that The number of training steps for each graph includes a preset number of steps, the type of the learning rate scheduler includes cosine, and the optimizer type includes 8bit-Adam.

9. The method according to claim 1, characterized in that: The method further comprises: The target avatar frame image and the second element feature under the second target visual element type are input into the updated avatar frame generation model to generate multiple extended avatar frame images associated with the target avatar frame image; wherein the second target visual element type corresponding to the second element feature is the same as the first target visual element type corresponding to the first element feature.

10. The method according to claim 9, characterized in that The method further comprises: In response to an editing operation on a target avatar frame image and / or a target extended avatar frame image using image processing software, the target avatar frame image and / or the target extended avatar frame image is modified; the target extended avatar frame image is part or all of the multiple extended avatar frame images.

11. A device for generating an avatar frame image, characterized in that: The device comprises: An image sample acquisition module is used to acquire material image training samples; the material image training samples include avatar frame image samples with an interface design style and image feature information corresponding to the avatar frame image samples, wherein the image feature information includes element features of the avatar frame image under different visual element types; An adjustment model training module is used to input the material image training sample into an element adjustment model with pre-set training parameters for training, so as to obtain a trained element adjustment model; A generation model update module is used to adjust the model parameters of the model using the trained elements, update the model parameters of the avatar frame generation model, and obtain an updated avatar frame generation model; wherein the avatar frame generation model is an image generation model that generates an avatar frame image using input element features; An avatar frame generation module is used to input the first element feature under the first target visual element type into the updated avatar frame generation model to generate a target avatar frame image representing the first element feature; wherein the target avatar frame image has the same interface design style as the avatar frame image sample in the material image training sample.

12. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to execute the method for generating an avatar frame image as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for generating an avatar frame image according to any one of claims 1 to 10 is executed.

Citation Information

Cited By

  • Training method of generative model for generating visual IP picture material and visual IP picture generation method

    CN120931765A

  • Training method of generative model for generating visual ip picture material and visual ip picture generation method

    CN120931765B