Image generation method and device, electronic equipment and storage medium
By obtaining and utilizing the image reference information of the target character, the problem of inefficiency and inconsistent facial images in traditional manual drawing methods is solved, and the method of efficient batch generation of images in game scenes is realized.
Patent Information
- Application Number
- CN202411470579.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-03-11
AI Technical Summary
In game scenes, the same character needs to design a variety of different postures and costumes. Traditional manual drawing methods are inefficient and the facial images are inconsistent. It is difficult for artificial intelligence technology to maintain the consistency of facial images when batch generation of images.
By obtaining the image reference information of the target character, including feature tags and reference images, using feature tags to generate avatars and obtain random number seeds, combining random number seeds and reference images to generate a base map, and finally generating the target image based on feature tags, random number seeds and base map to maintain the consistency of the facial image.
In the process of batch generation of images, the facial images in multiple different target images of the same target character can be kept as consistent as possible, improving image generation efficiency and solving the problem of facial images inconsistent.
Smart Images

Figure CN119600129A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to an image generation method, device, electronic device and storage medium. Background Art
[0002] In game scenes, for the same character, it is often necessary to design a variety of different poses and costumes for the character, and then the staff will produce art resources that can be used in the game based on the design. Manually drawing images often takes a lot of time and energy, and the quality of the image is very dependent on the professional skills of the painter, which is inefficient.
[0003] With the development of electronic technology, the application of artificial intelligence is becoming more and more extensive. For example, artificial intelligence technology can be applied to image generation. Compared with traditional manually drawn images, the efficiency of image generation using artificial intelligence technology is extremely high. Therefore, in scenarios where batch image generation is required, artificial intelligence technology is widely used. However, this technology has the problem that the facial image of the same character may be inconsistent. Summary of the invention
[0004] The embodiments of the present application provide an image generation method, device, electronic device, and storage medium, which can make the facial images of the same target character in different target images remain as consistent as possible in a scenario where batch generation of images is required.
[0005] In a first aspect, an embodiment of the present application provides an image generation method, comprising: Acquire image reference information of a target character; the image reference information includes a feature label and a reference image; Performing image generation processing according to the feature tag to obtain an avatar of the target character, and obtaining a random number seed corresponding to the avatar; Perform image generation processing according to the feature label, the random number seed and the reference image to obtain a base map of the target character; the base map is used to guide rapid batch generation of images; An image generation process is performed according to the feature label, the random number seed and the base map to obtain a target image of the target character.
[0006] In a second aspect, an embodiment of the present application provides an image generating device, including: An acquisition unit, used to acquire image reference information of a target character; the image reference information includes a feature tag and a reference image; A generating unit, configured to perform image generation processing according to the feature tag, obtain an avatar of the target character, and obtain a random number seed corresponding to the avatar; The generating unit is further used to perform image generation processing according to the feature label, the random number seed and the reference image to obtain a base map of the target character; the base map is used to guide rapid batch generation of images; The generating unit is further used to perform image generation processing according to the feature label, the random number seed and the base map to obtain a target image of the target character.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor; and a memory configured to store computer executable instructions, wherein the computer executable instructions, when executed, cause the processor to execute the image generation method as described in the first aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the image generation method as described in the first aspect.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the image generation method as described in the first aspect.
[0010] It can be seen that in the embodiment of the present application, first, the image reference information of the target character is obtained; the image reference information includes a feature label and a reference image; then, image generation processing is performed according to the feature label to obtain the avatar of the target character, and the random number seed corresponding to the avatar is obtained; then, image generation processing is performed according to the feature label, the random number seed and the reference image to obtain the base map of the target character; the base map is used to guide the rapid batch generation of images; finally, image generation processing is performed according to the feature label, the random number seed and the base map to obtain the target image of the target character. In this way, the random number seed corresponding to the avatar of the target character is consistent with the random number seed used in the image generation process of the base map, which is conducive to the facial image of the target character in the base map being consistent with the facial image of the target character in the avatar, and then, the random number seed corresponding to the avatar of the target character is consistent with the random number seed used in the image generation process of the target image and the target image is guided by the base map during the generation process of the target image, which can make the facial image in the target image of the target character consistent with the facial image of the target character in the avatar, and then, when different base maps are used to guide image generation for the same target character, the facial images in each generated target image can be consistent. In this way, in image generation scenarios where a large number of images are required and / or the image generation efficiency is relatively high, by adopting the image generation method provided in the embodiments of the present application, the facial images of the same target character in multiple different target images can be kept as consistent as possible during the process of batch generating images. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor. Figure 1 A schematic diagram of an implementation environment of an image generation method provided in an embodiment of the present application; Figure 2 A processing flow chart of an image generation method provided in an embodiment of the present application; Figure 3A A head portrait setting diagram used in an image generation method provided in an embodiment of the present application; Figure 3B A body setting diagram used in an image generation method provided in an embodiment of the present application; Figure 4 A schematic diagram of a base map generation process in an image generation method provided in an embodiment of the present application; Figure 5 A schematic diagram of another base map generation process in an image generation method provided in an embodiment of the present application; Figure 6 A schematic diagram of a target image generation process in an image generation method provided in an embodiment of the present application; Figure 7 An example diagram of a target image in an image generation method provided in an embodiment of the present application; Figure 8 A schematic diagram of a flow chart of another image generation method provided in an embodiment of the present application; Fig. 9 A schematic diagram of an image generating device provided in an embodiment of the present application; Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0012] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0013] Standing pictures are paintings of characters or figures, usually used in entertainment media such as games, animation, and novels. Standing pictures are characterized by realistic characters and rich details, which can bring a more realistic visual experience to the audience. This form of painting is usually used to show the image and appearance of the character. It can show details such as the character's expression, clothing, posture and body language, as well as part of the background or specific environment. The purpose of standing pictures is to allow the audience to better understand and connect with the characters, resonate with the story, and help convey the emotions and plot of the story.
[0014] Taking the game scene as an example, the game designer may design multiple different portraits for each character. For the same character, the postures in each portrait may be different. Therefore, when the character's face faces in different directions, the character's facial image looks a little different. It is not appropriate to directly paste the head portrait into the portraits of different postures. In the traditional painting process, when the artist manually draws each portrait of the same character, the goal of keeping the facial image of the character consistent in each portrait places high demands on the professional skills of the artist. In addition, it takes a long time to manually draw the portrait, and the image generation efficiency is low.
[0015] If common artificial intelligence technology is used to draw portraits, compared with manual drawing, although batch image generation can be achieved, which significantly shortens the portrait generation time and improves image generation efficiency, there is a problem that it is difficult to keep the facial image of the same character consistent in different portraits, which may cause different faces in each generated image after batch image generation.
[0016] Therefore, in order to solve the above problems, an embodiment of the present application provides an image generating method.
[0017] The image generation method provided in one or more embodiments of this specification may be applicable to an implementation environment of the image generation method, which implementation environment at least includes a server 101 for image generation.
[0018] The server 101 may be a single server, or a server cluster consisting of a plurality of servers, or one or more cloud servers in a cloud computing platform, for image generation.
[0019] In the implementation environment, during the image generation process, the server 101 first obtains the image reference information of the target character; the image reference information includes a feature tag and a reference image; then, the image generation process is performed according to the feature tag to obtain the avatar of the target character, and the random number seed corresponding to the avatar is obtained; then, the image generation process is performed according to the feature tag, the random number seed and the reference image to obtain the base map of the target character; the base map is used to guide the rapid batch generation of images; finally, the image generation process is performed according to the feature tag, the random number seed and the base map to obtain the target image of the target character. In this way, the random number seed corresponding to the avatar of the target character is consistent with the random number seed used in the image generation process of the base map, which is conducive to the facial image of the target character in the base map being consistent with the facial image of the target character in the avatar, and then, the random number seed corresponding to the avatar of the target character is consistent with the random number seed used in the image generation process of the target image and the target image is guided by the base map during the generation process of the target image, so that the facial image in the target image of the target character is consistent with the facial image of the target character in the avatar, and then, when different base maps are used to guide image generation for the same target character, the facial images in each generated target image can be consistent. In this way, in image generation scenarios where a large number of images are required and / or the image generation efficiency is relatively high, by adopting the image generation method provided in the embodiments of the present application, the facial images of the same target character in multiple different target images can be kept as consistent as possible in the process of efficiently generating images in batches.
[0020] Figure 2 A processing flow chart of an image generation method provided in an embodiment of the present application. Figure 2 The image generation method provided in this embodiment specifically includes steps S202 to S208.
[0021] Step S202, obtaining image reference information of the target character; the image reference information includes feature tags and reference images.
[0022] A role refers to a person or thing that plays a specific role or assumes a specific responsibility in a specific situation or story. Specifically in the embodiment of the present application, the target role can be any person in a specific scene, or the target role can also be any thing with a personalized facial image in a specific scene.
[0023] For example, the target character may be game character A, or the target character may be mascot B of a sports event having a personalized facial image, and so on.
[0024] Image refers to the comprehensive impression formed in the human brain by the external features and internal characteristics perceived through sensory pathways such as vision, hearing, and touch. Specifically in the embodiment of the present application, the image of the target character refers to the comprehensive impression formed in the human brain by the external features and internal characteristics of the target character perceived through vision.
[0025] The image reference information may include a feature tag and a reference image, and the image reference information may be used to provide a reference in the process of generating an image for a target character.
[0026] The number of feature tags can be one or more. Each feature tag can describe an image feature of the target character. Image features refer to unique attributes or marks that can identify and distinguish a specific image in sensory experiences such as vision, hearing, and touch. The image features in the embodiments of the present application can be unique attributes or marks that can identify and distinguish the image of the target character in visual sensory experiences.
[0027] The number of reference images can be one or more. Reference images can describe the image characteristics of the target character, or reference images can be used to provide reference for the image layout of images that include the target character. Image layout refers to the way image elements are organized and arranged during the design or typesetting process. It involves the position, size, proportion, spacing and alignment of images on a page, screen or other display space. The purpose of image layout is to create visual harmony, balance and functionality so that the image can effectively convey information, attract the audience's attention, and be coordinated with the surrounding text and other visual elements.
[0028] The reference image can also be a sketch of the target character that reflects the image characteristics of the target character. Sketches usually refer to preliminary drafts or concept drawings drawn by users or designers before starting formal design. Sketches can be hand-drawn or digital, and are mainly used to express design ideas, composition, layout, and basic elements. Sketches usually do not pursue details and accuracy, but focus on the expression of creativity and concepts.
[0029] Before obtaining feature labels and reference images, some data preparation work can be done in advance, for example, personalized design of the target character's head, body, clothing, and actions to obtain the target character's setting information, which is used to obtain feature labels and reference images.
[0030] The target character's avatar setting information includes but is not limited to: hairstyle, hair color, face shape, facial features proportions, etc.
[0031] The target character's body setting information includes but is not limited to: body proportions, body features, and the like.
[0032] The target character's clothing setting information includes but is not limited to: clothing style, color matching, etc.
[0033] The target character's action setting information includes but is not limited to: dynamic posture, character pose, etc.
[0034] Dynamic pose and character pose have some overlap in concept, but they differ in application scenarios and emphasis. Dynamic pose usually refers to poses captured during movement or action. It emphasizes the dynamics and fluidity of the pose, that is, the pose is a moment in a continuous sequence of actions. Dynamic pose is common in sports photography, dance photography, action movies, animation, game design and other fields. It captures the power, speed, rhythm and dynamics of a person or object in motion. Character pose usually refers to the pose of a person in a static or relatively static state. It emphasizes the staticness and expressiveness of the pose, that is, the pose is to convey a certain emotion, attitude or storyline. Character pose is common in portrait photography, fashion photography, illustration, comics, character design and other fields. It is used to show the personality, emotions, social role, etc. of the character.
[0035] The setting information of the target role listed above is only exemplary, and can be customized according to needs during specific implementation, and the embodiments of the present application are not limited to this.
[0036] In a specific implementation, obtaining a characteristic label of a target character includes: performing label extraction processing on a character setting diagram to obtain a text label describing the image characteristics of the target character; the character setting diagram is pre-configured for the target character.
[0037] The character setting diagram may be pre-configured for the target character. For example, the setting information of the target character is obtained, and the character setting diagram is generated according to the setting information.
[0038] It should be emphasized that although the character setting diagram includes the image features of the target character expected by the designer, the image materials used in the process of generating the character setting diagram can be pre-configured general image materials that can be reused by multiple characters, or they can be manually drawn image materials with relatively low degree of detail.
[0039] Character setting pictures may include head setting pictures, body setting pictures, and so on.
[0040] Figure 3A This is an avatar setting diagram used in an image generation method provided in an embodiment of the present application, which exemplarily shows avatar setting information of three different characters. Figure 3B This is a body setting diagram used in an image generation method provided in an embodiment of the present application, which exemplarily shows the body setting information of three different characters.
[0041] For example, the target characters may include character A, character B, and character C. The avatar 302 of character A, the avatar 304 of character B, and the avatar 306 of character C are shown in FIG. Figure 3A As shown in FIG. 308 of character A, body 310 of character B and body 312 of character C are shown in FIG. Figure 3B shown.
[0042] Text labels can include positive labels (Positive Prompts) and negative labels (Negative Prompts). Taking the use of a generative model, such as the Stable Diffusion model (hereinafter referred to as the SD model), for image generation as an example, positive labels and negative labels are used to guide the model in the process of generating images. These labels help the model understand the content of the image that the user wants to generate and the content that the user does not want to include.
[0043] Specifically, positive labels are content or features that users want to include in the generated image. These labels usually describe the image style, theme, details, etc. that users expect. Negative labels are content or features that users do not want to appear in the generated image. These labels are used to exclude certain undesirable elements or styles.
[0044] Each text label can describe a visual feature of the target character. Visual features refer to the visual elements and attributes in an image that can be recognized and understood by the human visual system. For example, visual features include but are not limited to: character gender, age range, hairstyle, hair color, face shape, facial features, expression, background, etc.
[0045] For example, positive labels may include: positive label X1 about the gender of the character, positive label X2 about the age range, positive label X3 about the hairstyle, etc. Negative labels may include: negative label X1' about the gender of the character, negative label X2' about the age range, negative label X3' about the hairstyle, etc.
[0046] For another example, positive labels include: a female, about 30 years old, long dark brown hair, a single braid with a pink bow on it, small eyes, black eyes, short nose, etc. Negative labels include: cute girl, messy hair, short hair, double ponytails, big eyes, sad, etc.
[0047] In the process of extracting labels from the character setting diagram to obtain text labels describing the image characteristics of the target character, manual extraction or a labeler can be used. A labeler is a tool or system used to add labels or annotations to data or objects.
[0048] The labeler is used to extract labels from the character setting diagram to obtain text labels that describe the image characteristics of the target character.
[0049] For example, the labeler interface may include an image upload area and a label generation area. In the image upload area, the character setting diagram can be input into the labeler by "drag and drop the image here or click to upload", and the label generation area can be used to display the labels that match the character setting diagram extracted from the character setting diagram by the labeler.
[0050] In the labeler interface, you can drag and drop the avatar setting image to the image upload area, click the "Reverse" control to trigger the labeler to extract the label of the avatar setting image and obtain the text label that describes the image characteristics of the target character.
[0051] Illustratively, the text labels include label 1, label 2, label 3, label 4, and so on.
[0052] In addition, the feature tag of the target character may be obtained by manually configuring the feature tag of the target character. Also, the feature tag of the target character may be obtained by obtaining the feature tag of a reference character and correcting the feature tag of the reference character to obtain the feature tag of the target character.
[0053] Reference characters usually refer to specific characters or people that users want to be included in the generated images. These characters can be real celebrities, fictional characters, anime characters, game characters, etc. Reference characters can help the generative model better understand the user's needs and thus generate images that better meet expectations.
[0054] To obtain a reference image of the target character, some common image materials that can be reused by different characters can be obtained from the Internet, and the image materials are edited to obtain a reference image that meets the user's expectations.
[0055] For example, obtain common image materials describing human actions, image materials of human beings wearing different types of clothing, image materials highlighting human body proportions, etc. from design websites.
[0056] To obtain a reference image of the target character, one can also obtain image material by using a text-generated image or a picture-generated image method in a generative artificial intelligence platform that can be used for image generation, and then perform image editing on the obtained image material to obtain a reference image that meets expectations.
[0057] Among them, the generative artificial intelligence platform that can be used for image generation can be Midjourney (hereinafter referred to as MJ) or any other platform with image generation capabilities.
[0058] Text-to-Image is an artificial intelligence technology that can generate corresponding images based on the text description entered by the user. This technology combines natural language processing and computer vision, enabling computers to understand text content and convert it into visual images.
[0059] Image-to-Image is an artificial intelligence technology that can generate new images based on the images input by the user. This technology is usually used for tasks such as image conversion, style transfer, image enhancement, and image restoration. Image-to-Image technology can be understood as taking an image as input and generating another image with specific features or style through a certain algorithm or model.
[0060] Regardless of whether the image material is obtained through text-generated images or image-generated images, the description words can be continuously adjusted to draw new image materials. Users can operate flexibly according to their needs for reference images.
[0061] A reference image of the target character may be obtained, or image material may be manually drawn using drawing software and the image material may be used as a reference image.
[0062] The several implementation processes for obtaining reference images listed above are merely exemplary. In the specific implementation process, any one method or a combination of multiple methods can be flexibly adopted to obtain the reference image according to the needs, and the embodiments of the present application do not limit this.
[0063] Step S204, performing image generation processing according to the feature tag to obtain the avatar of the target character, and obtaining the random number seed corresponding to the avatar.
[0064] The avatar of the target character may be an image including the head of the target character.
[0065] The image generation process is performed according to the feature label to obtain the avatar of the target character. The feature label can be converted into an image by using a vincent graph, and the converted image is used as the avatar of the target character.
[0066] The image generation process is performed according to the feature tag to obtain the avatar of the target character, or one or more reference images including the feature tag are searched in the historical data according to the feature tag, and the one or more reference images are converted into another image by image-to-image method, and the converted image is used as the avatar of the target character. The historical data may include the correspondence between the feature tag and the reference image.
[0067] A random number seed is usually an initial value used to start a random number generator. Random number generators are used to create variation and diversity in artwork. If this seed number is changed, the generated image will be different even if other parameters (such as style, theme) remain unchanged.
[0068] The random number seed plays two main roles when generating images: one is to determine the appearance of the generated image, and the other is to ensure the reproducibility of the results. Therefore, in order to lock the image of each character in the generated image, the random number seed corresponding to the target character's head must be obtained.
[0069] In a specific implementation, the feature tag includes a first text tag that describes the head feature of the target character; image generation processing is performed according to the feature tag to obtain an avatar of the target character, including: configuring the operating parameters of the first image generation model according to the first text tag; and running the configured first image generation model to perform image generation processing to obtain the avatar.
[0070] The head features of the target character include but are not limited to: hairstyle, hair color, face shape, facial features ratio, etc. The first text label describing the head feature can be extracted from the avatar setting picture of the target character by a labeler.
[0071] The first image generation model may be the aforementioned SD model, or any other image generation model with a text-generated image function that uses artificial intelligence technology.
[0072] The SD model is taken as an example for exemplary explanation. Other image generation models can refer to the corresponding description part of the SD model: the SD model includes a text-generated image module, which can convert label information in text form into an image by means of a text-generated image. Specifically in this implementation, the text-generated image module can convert the first text label describing the head features of the target character into an avatar of the target character.
[0073] In the process of the Wenshengtu module converting the first text label into the avatar of the target character, the following operations are specifically performed: according to the first text label, the operation parameters of the Wenshengtu module are configured; and the configured Wenshengtu module is operated to perform image generation processing to obtain the avatar.
[0074] Exemplarily, the first operating parameters of the Wenshengtu module include but are not limited to: number of iterations, sampling method, width, height, total batch number, single batch number, prompt word guidance coefficient, random number seed, etc. The value of the first operating parameter can be customized according to needs.
[0075] For example, the number of iterations is 40, the sampling method is Euler a, the width is 512, the height is 512, the total number of batches is 1, the number of single batches is 1, the prompt word guidance coefficient is 7, and the random number seed is left blank.
[0076] Iterations refers to the number of iterations that the generative model performs when generating an image. In each iteration, the model is updated according to the current state and gradually generates the final image. The number of iterations directly affects the quality and details of the generated image. Generally, the more iterations, the higher the quality of the generated image and the richer the details.
[0077] The second operation parameter of the Wenshengtu module may be label information. The second operation parameter may be configured according to the first text label, for example, the second operation parameter includes: label 1, label 2, label 3, label 4, . . .
[0078] After configuring the second operating parameter of the Wenshengtu module according to the first text tag, the configured Wenshengtu module can be run to perform image generation processing to obtain the avatar.
[0079] In specific implementation, the configured first image generation model may be run once or multiple times to perform image generation processing to obtain an avatar. In the case of running the configured first image generation model multiple times, the running parameters of the first image generation model may be adjusted after each model run, for example, "yellow hair" in the label information may be changed to "light yellow hair", etc. By continuously adjusting the label information and running the Wensheng diagram, the generated avatar may be very close to the avatar setting diagram, that is, the generated avatar meets the user's design expectations.
[0080] In a specific implementation, obtaining a random number seed corresponding to the avatar includes: reading a random number seed used in the image generation process of the avatar from metadata of the avatar. Metadata refers to data describing data. The metadata of the avatar may be image description information of the avatar.
[0081] It should be noted that if the random number seed is left blank before the image is generated, a random value will be randomly determined as the random number seed during the image generation process, and this value will be recorded in the metadata of the generated avatar.
[0082] Taking the SD model as an example, the metadata of the avatar can be obtained through the PNG (Portable Network Graphics) image information function of the SD model. In the PNG image generated by the SD model, the PNG image information usually refers to the metadata and additional information contained in the image file. This information can help users understand the image generation parameters, model settings, copyright information, etc. PNG is a lossless compressed bitmap image format that is widely used for image transmission and storage on the Internet.
[0083] For example, by dragging and dropping the avatar to a designated area in the PNG picture information interface of the SD model, metadata of the avatar can be extracted, and the metadata includes a random number seed used in the image generation process of the avatar.
[0084] In specific implementation, before executing the step of "generating an image based on feature tags to obtain an avatar of the target character", the random number seed can be customized to a preset value and added to the setting information of the target character. In this case, obtaining the random number seed corresponding to the avatar can be performed by reading the random number seed from the setting information of the target character.
[0085] In addition, obtaining the random number seed corresponding to the avatar may also be: evaluating the avatar according to the comparison result between the avatar and the avatar setting image to obtain an evaluation score of the avatar, and if the evaluation score is greater than a preset value, obtaining the random number seed corresponding to the avatar.
[0086] If the evaluation score of the avatar is less than or equal to a preset value, the tag information can be continuously adjusted to generate a new avatar.
[0087] For example, when the comparison result between the avatar and the avatar setting picture indicates that the avatar can restore 90% of the information of the avatar setting picture, the random number seed corresponding to the avatar can be obtained.
[0088] Step S206, performing image generation processing according to the feature label, random number seed and reference image to obtain a base map of the target character; the base map is used to guide rapid batch generation of images.
[0089] The base map can be a tile base map. The role of the base map is to guide and control the image generation of the target character in the subsequent steps. The requirements of the base map include: sorting out the overall effect of the target character based on the previous setting information, specifically, it is necessary to determine the character's pose, clothing style, color matching, head hairstyle, overall light and shadow and other elements.
[0090] The number of reference images can be one or more.
[0091] When there are multiple reference images and each reference image describes different local image features, image generation processing is performed based on feature labels, random number seeds and reference images to obtain a base map of the target character. Alternatively, multiple reference images can be fused to obtain a comprehensive reference image, and the comprehensive reference image is converted by combining feature labels and random number seeds in an image-to-image manner to obtain the base map of the target character.
[0092] In the case where there are multiple reference images, each reference image can reflect the local image features of the target character. Figure 4 Example. Figure 4 A schematic diagram of a base map generation process in an image generation method provided in an embodiment of the present application.
[0093] like Figure 4 As shown, in the image generation process of the base map 410, multiple reference images are used, wherein reference image 402 describes the head features of the target character, reference image 402 describes the body proportions of the target character, reference image 406 describes the clothing style and color of the target character, and reference image 408 describes the action pose of the target character.
[0094] In addition, after obtaining the comprehensive reference image, the comprehensive reference image can be further processed by image-to-image processing in combination with feature labels and random number seeds to obtain the base map of the target character. This makes the quality and visual effect of the processed comprehensive reference image more unified, reducing the sense of disharmony that may be caused by the fusion of multiple images of different styles.
[0095] The base map of the target character can be obtained by performing image generation processing based on the feature labels, random number seeds and reference images. The base map of the target character can be obtained by converting the reference image in an image-to-image manner in combination with the feature labels and random number seeds.
[0096] When the number of reference images is one, the reference image can reflect the overall image characteristics of the target character. Figure 5 Example. Figure 5 A schematic diagram of another base map generation process in an image generation method provided in an embodiment of the present application.
[0097] like Figure 5 As shown, during the image generation process of the base image 504, a reference image, namely, the reference image 502 is used, and the reference image 502 describes the overall image features of the target character.
[0098] It should be emphasized that the reason why a random number seed is used in the image generation process of the base map is to make the facial image of the target character in the base map and the facial image of the target character in the aforementioned avatar as consistent as possible. Since the base map can be used as part of the reference information in the generation process of the target image of the target character in the subsequent steps, compared with leaving the random number seed blank or setting a random number seed with a different value, this is more conducive to making the facial image of the target character in the target image consistent with the facial image of the target character in the avatar in the subsequent target image generation process.
[0099] In a specific implementation, the feature label includes a first text label describing the head feature of the target character and a second text label describing the body feature of the target character; image generation processing is performed according to the feature label, the random number seed and the reference image to obtain a base map of the target character, including: configuring the operating parameters of the second image generation model according to the first text label, the second text label and the random number seed; inputting the reference image into the configured second image generation model for image generation processing to obtain the base map.
[0100] The head features of the target character include but are not limited to: hairstyle, hair color, face shape, facial features ratio, etc. The first text label describing the head feature can be extracted from the avatar setting picture of the target character by a labeler.
[0101] The physical characteristics of the target character include but are not limited to: body proportions, clothing styles, character poses, etc. The second text label describing the physical characteristics may be extracted from the body setting diagram of the target character by a labeler.
[0102] The second image generation model can be the aforementioned SD model, or any other image generation model that uses artificial intelligence technology and has the function of generating images from images.
[0103] The SD model is taken as an example for exemplary explanation. Other image generation models can refer to the corresponding description part of the SD model: the SD model includes an image-to-image module, which can convert one or more images into a new image by image-to-image method. Specifically in this implementation, the image-to-image module can convert the target character reference image into the base image of the target character, and the first text label, the second text label and the random number seed are used in the image conversion process.
[0104] In the process of the image generation module converting the reference image of the target character into the base map of the target character, the following operations are specifically performed: the operating parameters of the image generation module are configured according to the first text label, the second text label and the random number seed; the reference image is input into the configured image generation module for image generation processing to obtain the base map.
[0105] Exemplarily, the first operating parameters of the graph generation module include but are not limited to: number of iterations, sampling method, width, height, total batch number, single batch number, prompt word guidance coefficient, random number seed, etc. In the first operating parameter, the value of the random number seed can be configured according to the random number seed corresponding to the avatar of the target character obtained in the above steps, and the values of other first operating parameters can be customized according to requirements. The second operating parameter of the graph generation module is label information, which can be configured according to the first text label and the second text label.
[0106] In specific implementation, the configured second image generation model can be run once or multiple times to perform image generation processing to obtain a base map. In the case of running the configured second image generation model multiple times, it is only necessary to input a reference image before the first run, and the reference image can be reused in subsequent model runs. In addition, the running parameters of the second image generation model can be adjusted after each model run, for example, the "pink clothes" in the label information can be changed to "bright pink clothes", etc. By constantly adjusting the label information and running the image generation model, the generated base map can be more in line with the user's design expectations.
[0107] Step S208, performing image generation processing according to the feature labels, random number seeds and base map to obtain a target image of the target character.
[0108] The target image of the target character is obtained by performing image generation processing according to the feature labels, random number seeds and base map. It can be understood that the target image of the target character is obtained by fusing the avatar with the base map. However, it should be emphasized that in the actual implementation process, the aforementioned avatar is not used directly, but the random number seeds and feature labels are used in the image generation process. A part of the feature labels is used in the image generation process of the avatar, and the random number seeds are used. The part of the feature labels and the same random number seeds are also used in the image generation process of the target image, which is conducive to keeping the facial image of the target character in the target image consistent with the facial image of the target character in the avatar. Therefore, the head features reflected by the avatar are integrated into the target image.
[0109] Figure 6 Schematic diagram of a target image generation process in an image generation method provided in an embodiment of the present application. Figure 6 As shown, in the process of generating the target image 606 of the target character, the random number seed and the base image 604 corresponding to the avatar 602 can be used.
[0110] Figure 7 This is an example diagram of a target image in an image generation method provided in an embodiment of the present application.
[0111] like Figure 7 As shown, the standing image 702 is a target image of a target character generated by the image generation method provided by an embodiment of the present application.
[0112] Image generation processing is performed based on feature labels, random number seeds and base maps to obtain a target image of the target character. Feature labels in text form can be converted into an image through a text map, and the image is determined as the target image of the target character. In the specific conversion process, random number seeds and base maps are used as reference information.
[0113] Taking the aforementioned SD model as an example, in the process of generating the target image, the Wenshengtu module and ControlNet-Tile (control network-blocking) function of the SD model can be used. The Wenshengtu module is used to convert feature labels in text form into an image. The conversion process uses random number seeds, and the ControlNet-Tile function is used to use the base map as reference information in the conversion process.
[0114] In a specific implementation, the feature label includes a first text label describing the head feature of the target character and a second text label describing the body feature of the target character; image generation processing is performed according to the feature label, the random number seed and the base map to obtain a target image of the target character, including: configuring the operating parameters of the third image generation model according to the first text label, the second text label and the random number seed; generating a control signal of the third image generation model according to the base map; and operating the configured third image generation model under the guidance of the control signal to perform image generation processing to obtain the target image.
[0115] The head features of the target character include but are not limited to: hairstyle, hair color, face shape, facial features ratio, etc. The first text label describing the head feature can be extracted from the avatar setting picture of the target character by a labeler.
[0116] The physical characteristics of the target character include but are not limited to: body proportions, clothing styles, character poses, etc. The second text label describing the physical characteristics may be extracted from the body setting diagram of the target character by a labeler.
[0117] The third image generation model may be the aforementioned SD model, or any other image generation model with a text-generating image function that uses artificial intelligence technology.
[0118] The SD model is taken as an example for exemplary explanation. Other image generation models can refer to the corresponding description part of the SD model: the SD model includes a Vincent graph module and a ControlNet-Tile function. The Vincent graph module can convert text-based label information into images by means of Vincent graphs. Specifically, in this implementation, the Vincent graph module can convert a first text label describing the head features of the target character and a second text label describing the body features of the target character into a target image of the target character. During the conversion process, the random number seed corresponding to the avatar obtained in the aforementioned steps is used. In addition, the ControlNet-Tile function can generate a control signal for guiding image generation based on the base map, and the control signal can be transmitted to the Vincent graph module to assist the Vincent graph module in converting the first text label and the second text label into the target image of the target character.
[0119] Exemplarily, the first operating parameters of the Wenshengtu module include but are not limited to: number of iterations, sampling method, width, height, total batch number, single batch number, prompt word guidance coefficient, random number seed, etc. In the first operating parameter, the value of the random number seed can be configured according to the random number seed corresponding to the avatar of the target character obtained in the above steps, and the values of other first operating parameters can be customized according to requirements. The second operating parameter of the Wenshengtu module is label information, which can be configured according to the first text label and the second text label.
[0120] For example, the number of iterations is 80, the sampling method is Euler a, the width is 640, the height is 1024, the total number of batches is 1, the number of single batches is 1, the prompt word guidance coefficient is 7, and the random number seed is configured according to the random number seed corresponding to the target character's avatar.
[0121] In addition, you can also turn on high-resolution restoration and configure the corresponding first operating parameters, for example, the magnification algorithm is the preset algorithm 1, the high-score iteration step is 30, the redraw amplitude is 0.7, the magnification factor is 2, and so on.
[0122] A control signal for the third image generation model is generated according to the base map.
[0123] For example, in the configuration interface of the ControlNet-Tile function, the base image can be dragged and dropped into the designated image upload area. The configuration interface also includes the operating parameters of the ControlNet-Tile function.
[0124] For example, the control type is Tile, the preprocessor is x1, the model is x2, the control weight is x3, the guidance intervention timing is x4, the guidance termination timing is x5, the control mode is balanced, the scaling mode is fill gaps after scaling, and so on.
[0125] After the operating parameters of the third image generation model are configured and the base map is uploaded to the ControlNet-Tile function to trigger the generation of a control signal according to the base map, the third image generation model can be run to generate a target image of the target character.
[0126] In a specific implementation, a base map includes a first image and a second image, wherein the first image corresponds to a first posture and the second image corresponds to a second posture; a target image includes a first target image and a second target image; image generation processing is performed according to feature labels, random number seeds and the base map to obtain a target image of a target character, including: image generation processing is performed according to feature labels, random number seeds and the first image to obtain a first target image; the first target image includes a target character in a first posture; image generation processing is performed according to feature labels, random number seeds and the second image to obtain a second target image; the second target image includes a target character in a second posture.
[0127] The number of base images may be one or more. In the case of multiple base images, the poses of the target characters in each base image may be different. For example, in a game scene, it is necessary to design multiple different poses of the same game character.
[0128] This implementation method takes the example of a base map including a first image and a second image to exemplify the image generation process of a target image when there are multiple base maps. When the number of base maps is greater than two, refer to the corresponding description part of this implementation method.
[0129] The first image corresponds to the first posture, which means that the posture of the target character in the first image is the first posture, for example, the character A lowers his head and holds a closed fan pointing at his chin.
[0130] The second image corresponds to the second posture, which means that the posture of the target character in the second image is the second posture, for example, the character A raises his head to the upper right with his arms folded.
[0131] The first posture and the second posture may be two different postures.
[0132] An image generation process is performed according to the feature label, the random number seed and the first image to obtain a first target image, the first target image including a target character in a first posture, and specific reference may be made to the corresponding description section of performing image generation process according to the feature label, the random number seed and the base map to obtain a target image of the target character. Since the base map can be used to guide rapid batch generation of images, the posture of the target character in the first target image is the same as the posture of the target character in the first image.
[0133] Similarly, an image generation process is performed according to the feature label, the random number seed and the second image to obtain a second target image, and the second target image includes the target character in the second posture. For details, reference may be made to the corresponding description section of performing image generation process according to the feature label, the random number seed and the base map to obtain the target image of the target character. Since the base map can be used to guide the rapid batch generation of images, the posture of the target character in the second target image is the same as the posture of the target character in the second image.
[0134] It should be noted that, although the base images used in the image generation process of the first target image and the second target image are completely different images, since both use feature labels and random number seeds, and the same random number seeds are used in the generation process of the first image and the second image, the facial image of the target character in the first target image and the second target image can be consistent, although the local images related to the head may not be exactly the same due to different angles, the facial features look like the same character from a visual effect. In this way, through the image generation method provided in the embodiment of the present application, the appearance of the character standing drawing can be accurately controlled to ensure the uniformity of the facial features of the unified character, and the distinguishability of the character can be effectively controlled to achieve effective distinction between different characters, and the output efficiency can be greatly improved.
[0135] Based on similar technical concepts, the base map may also include a third image and a fourth image, wherein the third image corresponds to the first outfit, the fourth image corresponds to the second outfit, and the target image includes the third target image and the fourth target image; image generation processing is performed according to the feature label, the random number seed and the base map to obtain the target image of the target character, including: image generation processing is performed according to the feature label, the random number seed and the third image to obtain the third target image; the third target image includes the target character wearing the first outfit; image generation processing is performed according to the feature label, the random number seed and the fourth image to obtain the fourth target image; the fourth target image includes the target character wearing the second outfit.
[0136] Taking the game scene as an example, through the above implementation method, multiple portraits of the same character can be quickly completed, in which the character is dressed in different clothes and / or in different postures, and the facial image of the character in each different portrait can remain consistent.
[0137] In such Figure 2In the embodiment shown, first, the image reference information of the target character is obtained; the image reference information includes a feature tag and a reference image; then, image generation processing is performed according to the feature tag to obtain the avatar of the target character, and a random number seed corresponding to the avatar is obtained; then, image generation processing is performed according to the feature tag, the random number seed and the reference image to obtain the base map of the target character; the base map is used to guide the rapid batch generation of images; finally, image generation processing is performed according to the feature tag, the random number seed and the base map to obtain the target image of the target character. In this way, the random number seed corresponding to the avatar of the target character is consistent with the random number seed used in the image generation process of the base map, which is conducive to the facial image of the target character in the base map being consistent with the facial image of the target character in the avatar. Furthermore, the random number seed corresponding to the avatar of the target character is consistent with the random number seed used in the image generation process of the target image and the target image is guided by the base map during the generation process of the target image, so that the facial image in the target image of the target character is consistent with the facial image of the target character in the avatar. Furthermore, when different base maps are used to guide image generation for the same target character, the facial images in each generated target image can be consistent. In this way, in image generation scenarios where a large number of images are required and / or the image generation efficiency is relatively high, by adopting the image generation method provided in the embodiments of the present application, the facial images of the same target character in multiple different target images can be kept as consistent as possible during the process of batch generating images.
[0138] The following takes the application of an image generation method provided in an embodiment of the present application in a game scene as an example, combined with Figure 8 The image generation method provided in the embodiment of the present application is further explained. Figure 8 A processing flow chart of another image generation method provided in an embodiment of the present application.
[0139] like Figure 8 As shown, the game character production process includes three parts: concept map 802, software development process 816, and photo editing 826.
[0140] The concept map 802 includes: an avatar 804 , a body 806 , and an expression 808 .
[0141] The avatar 804 can refer to the corresponding description part of the setting information about the avatar of the aforementioned target character; the body 806 can refer to the corresponding description part of the setting information about the body of the aforementioned target character; the performance 808 can include setting information about the light and shadow, silhouette, decorative elements, background and other elements of the target character.
[0142] Body 806 may include features 810 , clothing 812 , and motion 814 .
[0143] In the software development process 816, the avatar digitization 818 can refer to the corresponding description part of the aforementioned step S204 "performing image generation processing according to the feature label to obtain the avatar of the target character, and obtaining the random number seed corresponding to the avatar". The concept map 820 refers to the setting information obtained after the concept map 802 is completed in the game character production process. The concept map 820 can be used to obtain the aforementioned reference image. Based on the concept map 820, the image generation process can obtain the base map 822, and the image generation process can refer to the corresponding description part of the aforementioned step S206 "performing image generation processing according to the feature label, random number seed and reference image to obtain the base map of the target character". The avatar digitization 818 and the base map 822 can be used together for the text generation process to obtain the finished image 824, and the specific details can refer to the corresponding description part of the aforementioned step S208 "performing image generation processing according to the feature label, random number seed and base map to obtain the target image of the target character". The finished image 824 can refer to the corresponding description part of the aforementioned target image of the target character.
[0144] For example, in a specific implementation of the software development process 816, the following steps (a1)-(a5) may be performed: Step (a1): Obtain an avatar sketch required for avatar digitization 818, where the avatar sketch refers to the avatar setting diagram of the target character; input the avatar setting diagram into a label extractor for label extraction to obtain multiple labels corresponding to the avatar setting diagram: label 1 describing the gender of the target character, label 2 describing the hairstyle of the target character, label 3 describing the facial features of the target character, label 4 describing the race of the target character, and so on.
[0145] In addition, the acquired avatar setting diagram may be considered as a part of the concept diagram 820 .
[0146] Among the above-mentioned multiple tags, some tags can describe the head features of the target character, such as the hairstyle and facial features of the target character; other tags can describe the personalized features of the target character other than the head, such as the gender and race of the target character.
[0147] Step (a2): The multiple tags obtained by executing step (a1) are input into the large model, and the avatar of the target character is generated according to the text image function of the large model.
[0148] Among them, the large model can adopt the aforementioned SD model, or any other image generation model with cultural image function.
[0149] In the process of generating the avatar of the target character according to the Wensheng map function of the large model, Wensheng map processing can be performed multiple times until the image similarity between the obtained image and the aforementioned avatar setting image is greater than the preset similarity threshold, the image generation is terminated, the image obtained by the last execution of Wensheng map processing is determined as the image of the target character, and the seed value of the last image is saved. The seed value is the aforementioned random number seed.
[0150] In the process of executing multiple Wensheng image processing, multiple labels input into the large model can be reused. That is, it is only necessary to input multiple labels into the large model as prompt words before executing Wensheng image processing for the first time. The large model can use the prompt words to guide the rapid batch generation of images in each subsequent execution of Wensheng image processing.
[0151] Steps (a1)-(a2) exemplarily illustrate the specific implementation process of the avatar digitization 818.
[0152] Since the technical concept is the same, step (a1) can also be regarded as an illustrative example of a specific implementation process of the aforementioned step S202 "obtaining the image reference information of the target character", and the relevant parts can refer to the corresponding description part of step S202. Step (a2) can also be regarded as an illustrative example of a specific implementation process of the aforementioned step S204 "performing image generation processing according to feature labels, obtaining the avatar of the target character, and obtaining the random number seed corresponding to the avatar", and the relevant parts can refer to the corresponding description part of step S204.
[0153] Step (a3): Generate a ControlNet basemap.
[0154] The main purpose of step (a3) is to control the body and improve the efficiency of image generation.
[0155] In the process of generating the controlnet base map, the pre-designed body sketch can be subjected to image editing processing to obtain the controlnet base map of the target character's body.
[0156] Alternatively, in the process of generating the controlnet base map, one or more images with high similarity to the pre-designed body sketch can be quickly obtained as the controlnet base map according to the pre-designed body sketch. The advantage of this is that it can save the time of drawing the draft body setting diagram. For example, the image search work does not rely on the professional skills of the art staff and can be handed over to other staff members besides the art staff.
[0157] The body sketch can reflect the target character's body proportions, clothing, posture and other characteristics.
[0158] After obtaining the controlnet base map, preferably, the first controlnet base map with a visual effect that better meets the user's needs can be obtained through the MJ's image generation function. This is because in the process of performing the image generation process, prompt words can be flexibly input and continuously adjusted, and further selected and refined according to the MJ output map, etc. Among them, the controlnet base map can be regarded as a part of the aforementioned concept map 820, and the first controlnet base map can be regarded as the aforementioned base map 822.
[0159] Step (a4): The first controlnet base map is subjected to image processing to obtain a second controlnet base map. The second controlnet base map is more detailed and unified in visual effect than the first controlnet base map.
[0160] In the process of performing image generation processing on the first controlnet base map to obtain the second controlnet base map, the first controlnet base map can be input into the SD model to perform image generation processing to obtain the second controlnet base map, and before performing the image generation processing, in the configuration information of the SD model, for the seed, the seed value obtained after executing step (a2) needs to be filled in, and for the prompt word, the prompt word describing the body clothing needs to be added on the basis of the avatar prompt word. The avatar prompt word is the multiple labels obtained after executing step (a1).
[0161] Step (a3) to step (a4) can be regarded as an exemplary illustration of a specific implementation process of the aforementioned step S206 "performing image generation processing according to feature labels, random number seeds and reference images to obtain a base map of the target character". The relevant parts can refer to the corresponding description part of step S206.
[0162] Step (a5): Fusion avatar seed value and the second controlnet base map.
[0163] In the process of fusing the avatar seed value and the second controlnet base map, you can perform the following operations: First, set the prompt words in the configuration information of the SD model. The prompt words include: avatar prompt words and body prompt words. In addition, you can also copy the prompt words in the Tile base map; set the random number seed in the configuration information of the SD model. Here you can fill in the seed value obtained after executing step (a2).
[0164] The prompt words in the Tile base map are the prompt words used in the image-to-image processing in the aforementioned step (a4).
[0165] Secondly, open ControlNet in the SD model and input the organized Tile base map.
[0166] Finally, set the SD model parameters and click Generate to obtain the final rendering, which is Figure 824. Its definition can refer to the target image of the target character mentioned above.
[0167] Step (a5) can be regarded as an exemplary illustration of a specific implementation process of the aforementioned step S208 "performing image generation processing according to feature labels, random number seeds and base map to obtain a target image of the target character". The relevant parts can refer to the corresponding description part of step S208.
[0168] The various operations in the implementation method of the above-mentioned software development process 816 are intended to facilitate understanding of the exemplary operations of the image generation method provided in the embodiment of the present application. In actual applications, the execution order of some operations may be adjusted according to various factors such as different image generation requirements or different image generation tools used, or some of the operations may be replaced with other operations that can achieve the same or similar effects. These situations are also within the protection scope of the image generation method provided in the embodiment of the present application.
[0169] The photo editing 826 includes but is not limited to error correction 828 , background processing 830 , and image segmentation 832 .
[0170] Since the technical concept is the same, the description in this embodiment is relatively simple, and the relevant parts may refer to the corresponding description of the method embodiment provided above.
[0171] An embodiment of an image generating device provided in this specification is as follows: In the above-mentioned embodiment, an image generating method is provided. Based on the same technical concept, the embodiment of the present application also provides an image generating device, which is described below in conjunction with the accompanying drawings.
[0172] Fig. 9 This is a schematic diagram of an image generation device provided in an embodiment of the present application. This embodiment provides an image generation device 900, including: An acquisition unit 902 is used to acquire image reference information of a target character; the image reference information includes a feature tag and a reference image; A generating unit 904 is used to perform image generation processing according to the feature tag to obtain an avatar of the target character and obtain a random number seed corresponding to the avatar; The generating unit 904 is further used to perform image generation processing according to the feature label, the random number seed and the reference image to obtain a base map of the target character; the base map is used to guide rapid batch generation of images; The generating unit 904 is further configured to perform image generation processing according to the feature label, the random number seed and the base map to obtain a target image of the target character.
[0173] Optionally, the acquisition unit 902 performs the following steps when acquiring the feature label of the target role: The character setting diagram is subjected to label extraction processing to obtain a text label describing the image characteristics of the target character; the character setting diagram is pre-configured for the target character.
[0174] Optionally, the feature tag includes a first text tag describing the head feature of the target character; when the generating unit 904 performs image generation processing according to the feature tag to obtain the head image of the target character, the generating unit 904 performs the following steps: According to the first text label, configuring the operating parameters of the first image generation model; The configured first image generation model is run to perform image generation processing to obtain the avatar.
[0175] Optionally, the feature label includes a first text label describing the head feature of the target character and a second text label describing the body feature of the target character; when the generation unit 904 performs image generation processing according to the feature label, the random number seed and the reference image to obtain the base image of the target character, the generation unit 904 performs the following steps: According to the first text label, the second text label and the random number seed, configuring the operating parameters of the second image generation model; The reference image is input into the configured second image generation model for image generation processing to obtain the base map.
[0176] The optional feature tags include a first text tag describing the head features of the target character and a second text tag describing the body features of the target character; when the generating unit 1304 performs image generation processing according to the feature tags, the random number seed and the base map to obtain the target image of the target character, the generating unit 1304 performs the following steps: According to the first text label, the second text label and the random number seed, configuring the operating parameters of the third image generation model; Generate a control signal of the third image generation model according to the base map; The configured third image generation model is run under the guidance of the control signal to perform image generation processing to obtain the target image.
[0177] Optionally, the base map includes a first image and a second image, wherein the first image corresponds to a first posture and the second image corresponds to a second posture; the target image includes a first target image and a second target image; when the generation unit 904 performs image generation processing according to the feature label, the random number seed and the base map to obtain the target image of the target character, the following steps are performed: Performing image generation processing according to the feature label, the random number seed and the first image to obtain the first target image; the first target image includes a target character in a first posture; An image generation process is performed according to the feature label, the random number seed and the second image to obtain the second target image; the second target image includes a target character in a second posture.
[0178] Optionally, the acquisition unit 902 performs the following steps when acquiring the random number seed corresponding to the avatar: The random number seed used in the image generation process of the avatar is read from the metadata of the avatar.
[0179] In an embodiment of the present application, an image generating device includes: an acquiring unit for acquiring image reference information of a target character; the image reference information includes a feature tag and a reference image; a generating unit for performing image generation processing according to the feature tag to obtain a headshot of the target character, and obtaining a random number seed corresponding to the headshot; the generating unit is also used to perform image generation processing according to the feature tag, the random number seed and the reference image to obtain a base map of the target character; the base map is used to guide rapid batch generation of images; the generating unit is also used to perform image generation processing according to the feature tag, the random number seed and the base map to obtain a target image of the target character. In this way, the random number seed corresponding to the avatar of the target character is consistent with the random number seed used in the image generation process of the base map, which is conducive to the facial image of the target character in the base map and the facial image of the target character in the avatar becoming consistent. Furthermore, the random number seed corresponding to the avatar of the target character is consistent with the random number seed used in the image generation process of the target image and the target image is guided by the base map during the generation process of the target image, so that the facial image of the target character in the target image can be consistent with the facial image of the target character in the avatar. Furthermore, when different base maps are used to guide image generation for the same target character, the facial images in each generated target image can be consistent. In this way, in an image generation scenario where the demand for the number of images is large and / or the image generation efficiency is relatively high, by adopting the image generation device provided by the embodiment of the present application, the facial images in multiple different target images of the same target character can be kept as consistent as possible during the batch generation of images.
[0180] Corresponding to the image generation method described above, based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the image generation method provided above. Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0181] like Fig.10As shown, the electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 1001 and memory 1002, and the memory 1002 may store one or more storage applications or data. Among them, the memory 1002 may be a short-term storage or a persistent storage. The application stored in the memory 1002 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 1001 may be configured to communicate with the memory 1002 and execute a series of computer executable instructions in the memory 1002 on the electronic device. The electronic device may also include one or more power supplies 1003, one or more wired or wireless network interfaces 1004, one or more input / output interfaces 1005, one or more keyboards 1006, etc.
[0182] In a specific embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the electronic device, and the one or more programs configured to be executed by one or more processors include the following computer executable instructions: Acquire image reference information of a target character; the image reference information includes a feature label and a reference image; Performing image generation processing according to the feature tag to obtain an avatar of the target character, and obtaining a random number seed corresponding to the avatar; Perform image generation processing according to the feature label, the random number seed and the reference image to obtain a base map of the target character; the base map is used to guide rapid batch generation of images; An image generation process is performed according to the feature label, the random number seed and the base map to obtain a target image of the target character.
[0183] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions. When the computer-executable instructions are executed by a processor, the following process is implemented: Acquire image reference information of a target character; the image reference information includes a feature label and a reference image; Performing image generation processing according to the feature tag to obtain an avatar of the target character, and obtaining a random number seed corresponding to the avatar; Perform image generation processing according to the feature label, the random number seed and the reference image to obtain a base map of the target character; the base map is used to guide rapid batch generation of images; An image generation process is performed according to the feature label, the random number seed and the base map to obtain a target image of the target character.
[0184] It should be noted that the embodiment of the computer-readable storage medium in this specification and the embodiment of the image generation method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.
[0185] Another embodiment of the present disclosure further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following process is implemented: Acquire image reference information of a target character; the image reference information includes a feature label and a reference image; Performing image generation processing according to the feature tag to obtain an avatar of the target character, and obtaining a random number seed corresponding to the avatar; Perform image generation processing according to the feature label, the random number seed and the reference image to obtain a base map of the target character; the base map is used to guide rapid batch generation of images; An image generation process is performed according to the feature label, the random number seed and the base map to obtain a target image of the target character.
[0186] The computer program product in the embodiment of the present disclosure can implement each process of the above-mentioned image generation method embodiment and achieve the same effects and functions, which will not be repeated here.
[0187] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0188] It should be understood by those skilled in the art that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the embodiments of the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0189] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable electronic device to produce a machine, so that the instructions executed by the processor of the computer or other programmable electronic device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0190] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable electronic device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0191] These computer program instructions may also be loaded onto a computer or other programmable electronic device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0192] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0193] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0194] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined in this article, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0195] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0196] Embodiments of the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0197] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0198] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.
Claims
1. An image generation method, characterized in that: include: Obtain image reference information of the target character; The image reference information includes a feature tag and a reference image; Performing image generation processing according to the feature tag to obtain an avatar of the target character, and obtaining a random number seed corresponding to the avatar; Perform image generation processing according to the feature label, the random number seed and the reference image to obtain a base image of the target character; The base map is used to guide the rapid batch generation of images; An image generation process is performed according to the feature label, the random number seed and the base map to obtain a target image of the target character.
2. The method according to claim 1, characterized in that Get the feature labels of the target role, including: The character setting diagram is subjected to label extraction processing to obtain a text label describing the image characteristics of the target character; the character setting diagram is pre-configured for the target character.
3. The method according to claim 1, characterized in that: The feature tag includes a first text tag describing the head feature of the target character; performing image generation processing according to the feature tag to obtain the head image of the target character includes: According to the first text label, configuring the operating parameters of the first image generation model; The configured first image generation model is run to perform image generation processing to obtain the avatar.
4. The method according to claim 1, characterized in that The feature label includes a first text label describing the head feature of the target character and a second text label describing the body feature of the target character; the image generation process is performed according to the feature label, the random number seed and the reference image to obtain the base image of the target character, including: According to the first text label, the second text label and the random number seed, configuring the operating parameters of the second image generation model; The reference image is input into the configured second image generation model for image generation processing to obtain the base map.
5. The method according to claim 1, characterized in that The feature label includes a first text label describing a head feature of the target character and a second text label describing a body feature of the target character; the image generation process is performed according to the feature label, the random number seed and the base map to obtain a target image of the target character, including: According to the first text label, the second text label and the random number seed, configuring the operating parameters of the third image generation model; Generate a control signal of the third image generation model according to the base map; The configured third image generation model is run under the guidance of the control signal to perform image generation processing to obtain the target image.
6. The method according to claim 1, characterized in that The base map includes a first image and a second image, wherein the first image corresponds to a first posture and the second image corresponds to a second posture; the target image includes a first target image and a second target image; and performing image generation processing according to the feature label, the random number seed and the base map to obtain the target image of the target character includes: Performing image generation processing according to the feature label, the random number seed and the first image to obtain the first target image; the first target image includes a target character in a first posture; An image generation process is performed according to the feature label, the random number seed and the second image to obtain the second target image; the second target image includes a target character in a second posture.
7. The method according to claim 1, characterized in that The obtaining of a random number seed corresponding to the avatar includes: The random number seed used in the image generation process of the avatar is read from the metadata of the avatar.
8. An image generating device, characterized in that: include: An acquisition unit, used for acquiring image reference information of a target character; The image reference information includes a feature tag and a reference image; A generating unit, configured to perform image generation processing according to the feature tag, obtain an avatar of the target character, and obtain a random number seed corresponding to the avatar; The generating unit is further used to perform image generation processing according to the feature label, the random number seed and the reference image to obtain a base map of the target character; the base map is used to guide rapid batch generation of images; The generating unit is further used to perform image generation processing according to the feature label, the random number seed and the base map to obtain a target image of the target character.
9. An electronic device, characterized in that: include: processor; and a memory configured to store computer executable instructions, which, when executed, cause the processor to perform the image generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the image generation method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the image generating method according to any one of claims 1 to 7.