Image generation methods, systems, electronic devices, storage media, and program products

By analyzing layout types and design templates to generate target layout diagrams, the problem of artificial intelligence models being unable to accurately recognize natural language instructions is solved, achieving efficient local adjustments and stable generation results.

CN123118818APending Publication Date: 2026-11-17阿里巴巴(中国)网络技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611232758.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

When generating product layout diagrams, artificial intelligence models cannot accurately identify specific image elements in natural language instructions, resulting in the need to regenerate each time an adjustment is made, which is inefficient and the effect is difficult to guarantee.

Method used

By parsing the layout type in the product image generation information, the corresponding design template is obtained. The layout type and design template are then input into the image generation model to generate the target layout image. The image elements and structural areas correspond one-to-one and are independent of each other, supporting subsequent local adjustments.

Benefits of technology

It improves the efficiency of layout generation, supports local adjustments, reduces computing resource consumption and time costs, and ensures the stability of the generated results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118818A_ABST
    Figure CN123118818A_ABST
Patent Text Reader

Abstract

This application provides an image generation method, system, electronic device, storage medium, and program product. The method, in response to obtaining product image generation information, parses the layout type in the product image generation information and determines a corresponding design template based on the layout type. The design template includes vector information of at least one structural region. Therefore, the layout type and the design template are input into an image generation model to obtain a target layout image output by the image generation model. This target layout image includes at least one image element, which corresponds one-to-one with and is independent of the at least one structural region. This allows for adjustments based on the structural region after a subsequent adjustment request, improving the generation efficiency of the target layout image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an image generation method, system, electronic device, storage medium, and program product. Background Technology

[0002] With the development of computer technology, the layout design process in the printing industry has shifted from the traditional manual design of product layouts to an automated design process using artificial intelligence models. However, when using AI models to design product layouts, the models cannot generate a layout that meets user needs in one go and typically require multiple adjustments.

[0003] However, since the adjustment information received by the artificial intelligence model is natural language instruction, the artificial intelligence model cannot accurately identify the specific image elements expressed by the natural language instruction. As a result, each adjustment actually regenerates a new product layout, which makes the efficiency of generating product layout low and the effect poor. Summary of the Invention

[0004] To overcome the problems existing in related technologies, embodiments of this application provide an image generation method, system, electronic device, storage medium, and program product.

[0005] According to a first aspect of the embodiments of this application, an image generation method is provided, applied to a server, the method comprising: In response to obtaining product image generation information, the layout type in the product image generation information is parsed; A corresponding design template is determined based on the layout type; wherein the design template includes vector information of at least one structural region; The layout type and the design template are input into the image generation model to obtain the target layout image output by the image generation model; the target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other.

[0006] According to a second aspect of the embodiments of this application, an image generation method is provided, applied to a client, the method comprising: Send product image generation information to the server; The server generates a target layout image based on the product image to provide information feedback; wherein the target layout image is generated based on the method described in the first aspect; the target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other.

[0007] According to a third aspect of the embodiments of this application, an image generation apparatus is provided, applied to a server, the apparatus comprising: The parsing module is used to parse the layout type in the product image generation information in response to obtaining the product image generation information; The acquisition module is used to determine the corresponding design template according to the layout type; wherein the design template includes vector information of at least one structural region; The generation module is used to input the layout type and the design template into the image generation model and obtain the target layout image output by the image generation model; the target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other.

[0008] According to a fourth aspect of the embodiments of this application, an image generation apparatus is provided, applied to a client, the apparatus comprising: The sending module is used to send product image generation information to the server; The layout image acquisition module is used to acquire the target layout image generated by the server based on the product image for information feedback; wherein the target layout image is generated based on the method described in the first aspect; the target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other.

[0009] According to a fifth aspect of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, the computer program being executed by the processor to cause the electronic device to perform the method as described in the first or second aspect.

[0010] According to a sixth aspect of the embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon, the program being executed by a processor to implement the method as described in the first or second aspect.

[0011] According to a seventh aspect of the embodiments of this application, a computer program product is provided, including instructions that, when executed on a computer, cause the computer to perform the method as described in the first or second aspect.

[0012] The technical solutions provided in this application embodiment may include the following beneficial effects: The image generation method in this embodiment, in response to obtaining product image generation information, parses the layout type in the product image generation information and obtains a design template corresponding to the layout type; wherein, the design template includes vector information of at least one structural region; therefore, by inputting the layout type and the design template into the image generation model, the target layout image output by the image generation model is obtained. The target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other. After obtaining an adjustment request, adjustments can be made according to the structural region, thereby improving the generation efficiency of the target layout image.

[0013] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly described below. It should be understood that those skilled in the art can obtain other drawings based on these drawings without any creative effort.

[0015] Figure 1 This is a schematic diagram of a scene corresponding to the image generation method provided in the embodiments of this application; Figure 2 This is an exemplary flowchart corresponding to the image generation method provided in the embodiments of this application; Figure 3 An exemplary flowchart corresponding to yet another image generation method provided in the embodiments of this application; Figure 4 This is an exemplary schematic diagram of the image generation apparatus provided in the embodiments of this application; Figure 5 This is an exemplary schematic diagram of yet another image generation apparatus provided in the embodiments of this application; Figure 6 An exemplary schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0016] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings.

[0017] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments and is not intended to limit the technical solutions of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise.

[0018] It should also be understood that although the terms "first," "second," etc., may be used in the following embodiments to describe a certain type of object, the objects should not be limited to these terms. These terms are used to distinguish the specific implementation objects of that type of object.

[0019] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0020] The technical scenarios of the embodiments of this application are described below.

[0021] With the development of computer technology, the layout design process in the printing industry has shifted from the traditional manual design of product layouts to automated design using artificial intelligence models. In this process, AI models typically generate a complete layout image in one go based on the user's input text description. However, due to the complexity and subjectivity of user needs, AI models often cannot fully meet user expectations in a single generation. The generated layout may deviate in terms of element layout, color scheme, text-image ratio, or style presentation. Therefore, users usually need to make multiple adjustment requests to gradually approach the ideal design effect.

[0022] However, when responding to user adjustment requests, the AI ​​models typically receive natural language instructions. For example, commands to enlarge the logo, move the title text to the left, or change the background color to a warmer tone. Because AI models lack the ability to persistently recognize image elements, they cannot accurately identify the specific image elements described in the natural language instructions, as well as their precise position, size, and attributes in the current layout. In other words, AI models cannot establish a mapping between the natural language references to the logo, title text, and background and the specific pixel regions or layer objects in the previously generated results.

[0023] This results in the AI ​​model being unable to make localized modifications to specific elements in the previously generated result whenever a user requests an adjustment. Instead, it must take the user's adjustment instructions along with the original textual requirements as new input and re-execute the entire generation process. Each adjustment is essentially a regeneration, rather than a localized correction of an existing result.

[0024] The aforementioned adjustment method is inefficient because each adjustment requires computing power and time resources comparable to the initial generation, and users typically need multiple rounds of adjustments to achieve a satisfactory result. This results in high accumulated time and computational costs. Furthermore, the generated quality is difficult to guarantee, as each regeneration may introduce new uncertainties. For example, elements that were previously satisfactory may undergo unexpected changes during regeneration. For instance, a user might simply want to enlarge the logo, but the regenerated background color, font, and even the overall composition could differ from the previous version, requiring even more rounds to restore the previously satisfactory design.

[0025] In view of this, embodiments of this application propose an image generation method that can be applied to an image generation system. For example... Figure 1 The image shown is an image generation system that implements the image generation method. Figure 1 As shown, the image generation system includes a client 101 and a server 102, which are connected via a network. The network can be a wired or wireless network, such as the Internet, a local area network, a mobile communication network, or any combination thereof.

[0026] Client 101 can be a hardware device, such as a mobile phone, personal computer, tablet computer, wearable device, smart home device, or other electronic device with communication capabilities. Client 101 can also be software deployed on an electronic device, such as an application (APP), mini program, web client, or software module. Client 101 serves as an online service portal for users. Users can log in to their online service portal through electronic devices or applications and send product image generation information to server 102 through this portal. The product image generation information can include text information, voice information, image information, or any combination of the above. When the product image generation information is voice information or image information, client 101 can also incorporate or call a voice recognition module or image recognition module to convert the voice or image into text information before sending it to server 102.

[0027] Server 102 can be an application, service, instance, functional module of software, virtual machine, container, or cloud server, or a hardware device or hardware chip with data processing capabilities. Server 102 can be a standalone server or a server cluster, distributed system, or cloud computing platform composed of multiple servers. After receiving product image generation information sent by client 101, server 102 executes the image generation method provided in this application embodiment, specifically including: parsing the layout type in the product image generation information; obtaining a design template corresponding to the layout type; wherein the design template includes vector information of at least one structural region; calling the image generation model to generate a target layout image according to the layout type; the target layout image includes at least one image element, and at least one image element corresponds one-to-one with at least one structural region and is independent of each other. Server 102 can send the generated target layout image back to client 101 so that client 101 can perform subsequent operations based on the target layout image, such as user adjustments to the target layout image.

[0028] The server-side 102 can also deploy relevant tools and models during the process of generating the target layout image to generate the target layout image based on the product image generation information. For example, the server-side 102 can deploy two-dimensional or three-dimensional visualization models according to the layout type of the layout image to generate a layout image that conforms to the layout type. It can also deploy natural language recognition models to identify relevant natural language text in the product image generation information to determine the user's design intent. The server-side 102 can also deploy relevant image processing tools, such as target image recognition tools, image cutout tools, and image generation tools. When the product image generation information includes a reference image, the target image recognition tool can identify the necessary image elements in the reference image, the image cutout tool can extract these image elements, and the image generation tool can then use these image elements to generate the image in the subsequent image generation tool.

[0029] It should be understood that the above description of the functional layers of the image generation system is merely illustrative and does not constitute a limitation on the functional layers of the image generation system in the embodiments of this application. In actual implementation scenarios, the image generation system may include more or fewer functional layers, and each layer may contain more or fewer functional modules. The embodiments of this application do not limit this.

[0030] It should be understood that Figure 1 The schematic diagram of the application scenario is only a schematic representation of the image generation system involved in the embodiments of this application, and does not constitute a limitation on the technical solutions of the embodiments of this application.

[0031] In the above operating environment, the embodiments of this application provide as follows: Figure 2 The image generation method shown is applied to, for example, the image generation method of, Figure 1The corresponding server is 102. The image generation method includes the following steps: In step S201, in response to obtaining product image generation information, the layout type in the product image generation information is parsed.

[0032] For example, product image generation information refers to the raw input data submitted by the user to trigger the image generation task. This information may include natural language text descriptions, reference image materials, structured parameters, or any combination of the above. For example, the natural language text description could be "Design a 10-ounce coffee paper cup for me"; the reference image materials could be logos, product images, or design reference images; and the structured parameters could be category codes, specifications, etc. The layout type refers to the category classification of the packaging or printed material indicated by the product image generation information. The layout type determines the basic physical structural characteristics of the product, such as the conical unfolding structure of a paper cup, the folding structure of a paper bag, the die-cutting structure of a paper box, and the planar structure of a label. Different layout types correspond to different die-cutting templates, size ratios, safety zone rules, and bleed requirements. In this embodiment, the layout type is the decision-making basis for all subsequent processing steps (template loading, tool filtering, geometric constraint injection).

[0033] After obtaining the product image generation information, it is analyzed to identify the layout type the user intends to design. The layout type determines the physical structure, dimensional specifications, and process constraints that subsequent designs must follow, serving as the fundamental input for the entire image generation process. During the analysis of the product image generation information, the type of information included can be used to determine the type of information. When multiple types of information exist, multiple different types of models can be used for joint analysis.

[0034] For example, natural language text descriptions can utilize natural language processing models to perform semantic analysis and entity recognition, extracting publication type keywords. For instance, if a user inputs "Design a 10-ounce coffee paper cup for me," semantic analysis identifies "paper cup" as the publication type and further identifies "10 ounces" as a specification parameter. Reference image materials can be analyzed using image processing models. The analysis results from the image processing model and the natural language processing model are then fused to obtain relevant publication type information. This application's embodiments do not limit the above-described process of analyzing product image generation information; those skilled in the art can determine the appropriate method based on the specific circumstances.

[0035] In step S202, the corresponding design template is determined according to the layout type.

[0036] The design template includes vector information for at least one structural region.

[0037] For example, after parsing the layout type from the product image generation information, the corresponding design template is further obtained from a pre-set template library or template registration center based on the layout type. This design template is a pre-built industrial-grade structural drawing for a specific layout type (e.g., paper cups, paper bags, paper boxes, labels, etc.). Its content includes at least one structural area and the vector information corresponding to each structural area. A structural area refers to a local planar region with a clear functional semantic, enclosed by cut lines, fold lines, or trimming lines in the unfolded drawing of the design template. For example, a paper cup unfolded drawing may include the front area of ​​the cup body, the bottom area, and the seam area; a paper box unfolded drawing may include the front panel, back panel, side panels, dust flaps, adhesive flaps, etc. Each structural area can carry specific image elements (such as a logo, main visual element, or text) and is constrained by the geometric and technological boundaries of that area. Vector information refers to graphic data described using geometric primitives (points, lines, paths, curves) and coordinate systems. Vector information does not lose its quality when scaled and can be directly read by programs to calculate coordinate values, calculate areas, and determine containment relationships. In the context of packaging templates, vector information can include the outline path of structural regions, tool coordinates, polyline positions, bleed area offsets, safe area shrinkage, aspect ratios, etc.

[0038] The die-cutting line is a solid line that completely cuts through the material during die-cutting, determining the outer contour of the finished product. The crease / folding line is a dashed or dotted line that does not cut through the material, only creating creases, determining the folding position. The trim line has a similar meaning to the die-cutting line, indicating the final trimming boundary. The bleed line is a reference boundary extending a certain distance (e.g., 3 mm) beyond the trim line; background color blocks or patterns should extend to this line to prevent white areas from showing due to trimming deviations. The safety zone is a reference boundary recessed a certain distance (e.g., 3 to 5 mm) within the trim line; core graphics (text, logos, barcodes) should be placed within this zone to prevent them from being cut off.

[0039] Traditional raw image processing solutions typically only output bitmaps, lacking structural vector information such as die lines, safe areas, and bleed areas, making them unsuitable for direct entry into the die-cutting and printing process. This step, by loading a design template with structural region vector information before generation, ensures that the layout of text and graphics in the subsequent layout drawing is constrained by structured boundaries.

[0040] In step S203, the layout type and the design template are input into the image generation model to obtain the target layout image output by the image generation model.

[0041] The target layout diagram includes at least one image element, and the at least one image element corresponds one-to-one with at least one structural region and is independent of each other.

[0042] For example, an image generation model refers to a machine learning model or combination of models capable of generating or synthesizing visual content based on input product images. In this embodiment, the image generation model can be a single large model or an execution chain composed of multiple sub-models and tools, including a diffusion model, a generative adversarial network (GAN), or a vector rendering engine as a set of scheduled tools. The diffusion model or GAN is responsible for generating bitmap visual content under given regions and constraints; the vector rendering and typography tools are responsible for regularizing and encapsulating the generated content according to the geometric priors of the die-cutting template. All models and tools are uniformly orchestrated through a scheduling layer to jointly constitute the image generation model. For example, it may include a generation model, an object detection model, a matting model, and a typography model.

[0043] Image elements refer to independent data units in a target layout image that carry specific visual content. These can include, but are not limited to, the following types: background patterns, brand logos, product photos, decorative graphics, text titles, barcodes or QR codes, auxiliary lines or color blocks, etc. Each image element is an independent object in its data structure, possessing its own set of attributes (such as position coordinates, size, rotation angle, layer, transparency, scaling ratio, etc.). The target layout image is a complete design draft obtained after filling various structural areas in the design template with graphics and visual design. The target layout image contains at least one image element, and these image elements form a one-to-one mapping relationship with at least one structural area in the design template. Furthermore, each image element is independent in its data structure; image elements corresponding to different structural areas are decoupled from each other at the data level. Modifications to one image element (such as scaling, moving, replacing, or deleting) will not automatically affect the state of other image elements. The independence between image elements is the data prerequisite for supporting partial editing and version management.

[0044] In the implementation process, after obtaining the design template corresponding to the layout type, the layout type and the design template can be input into the image generation model to obtain the target layout image output by the image generation model. The image generation model can assign a unique structural region identifier to each structural region in the design template. When filling content, the image generation model also assigns an element identifier to each generated image element and binds the element identifier to the corresponding region identifier to obtain the target layout image; alternatively, the target layout image can be stored in a layered file format, with each structural region corresponding to an independent layer. When generating content, the image generation model places image elements belonging to a certain structural region in the corresponding layer, and the visibility and editability of the layers are independent of each other.

[0045] In addition to establishing the correspondence between image elements and structural regions, when generating image elements for each structural region in the target layout image, the image generation model can output a request to the diffusion model's image generation tool. Input parameters include user intent, a reference image, and information such as the designable area size and aspect ratio of the structural region. Under these size constraints, the diffusion model outputs a bitmap, which is then scaled / cropped to the designable area using the adjustment tool, and a visual preview and bounding box parameters are returned. When it is determined that the logo in the reference image needs to be processed, a request to the object detection and matting tool is output. The matting tool returns a alpha channel bitmap and a subject bounding box. This application does not limit the method of generating the target layout image described above; those skilled in the art can set it according to actual conditions.

[0046] As can be seen, in the embodiments of this application, in response to obtaining product image generation information, the layout type in the product image generation information is parsed, and the corresponding design template is determined according to the layout type; wherein, the design template includes vector information of at least one structural region; therefore, the layout type and the design template are input into the image generation model to obtain the target layout image output by the image generation model. The target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other. After obtaining an adjustment request, adjustments can be made according to the structural region, thereby improving the generation efficiency of the target layout image.

[0047] In some embodiments, adjustments to the target layout may also be made in response to receiving an adjustment instruction by reading the image element description information and adjustment request contained in the adjustment instruction; determining the image element to be adjusted indicated by the image element description information, wherein the image element to be adjusted is any one of at least one image element; and adjusting the image element to be adjusted according to the adjustment request.

[0048] For example, an adjustment instruction refers to a request submitted by a user after viewing the target layout image to modify the design content. Adjustment instructions can be obtained in various forms, including but not limited to natural language text (such as "make the logo bigger"), voice input (converted to text after speech recognition), and structured operation instructions generated through visual adjustment components (such as dragging a slider or clicking a button).

[0049] Image element description information refers to the information fragments used in adjustment instructions to identify and locate the image elements to be adjusted. This image element description information can be the semantic name of the element (such as "Logo", "Title", "Background Image"), the description of the relative position of the element in the layout diagram (such as "the icon in the upper left corner" or "the image in the middle"), the description of the appearance features of the element (such as "the red circle"), or the unique identifier of the element (such as element identification). The accuracy and clarity of the image element description information will affect the efficiency and success rate of subsequent element location.

[0050] An adjustment request is a segment of information in an adjustment instruction that specifies the operation to be performed on the image element to be adjusted. An adjustment request can include two parts: adjustment items and adjustment methods. Adjustment items can include background image adjustment, size adjustment, shape adjustment, and position adjustment. The adjustment method refers to the specific adjustment parameters corresponding to the above adjustment items, such as the target background image to be replaced, the size to be adjusted, and the specific position to be adjusted.

[0051] An image element to be adjusted refers to a specific image element that the system identifies from at least one image element in the target layout image, based on its description information, and that requires adjustment. The image element to be adjusted can be any image element in the target layout image, including but not limited to logo elements, background elements, text elements, and decorative graphic elements.

[0052] During implementation, each image element can be pre-assigned a semantic tag (such as "Logo", "Main Title", "Background Image", "Subtext"). Upon receiving an adjustment instruction, semantic analysis is performed on the image element description information to extract keywords. Then, elements with matching semantic tags are searched in the image element list. For example, if a user says "enlarge the Logo", the keyword "Logo" is extracted, and elements with the semantic tag "Logo" are searched in the element list. For instance, determining the image element to be adjusted, as indicated by the image element description information, includes: if the adjustment instruction is a natural language instruction, extracting key phrases from the natural language instruction (key phrases are phrases describing image features); matching the key phrases with the features of each image element in at least one image element; and identifying image elements whose similarity meets preset conditions as the image elements to be adjusted.

[0053] Of course, adjustment instructions can also be obtained through visual adjustment components. Users can directly click, select, or drag the corresponding image elements that need to be adjusted on the target layout image, and the image elements to be adjusted can be directly determined based on the user's interaction. For example, if a user clicks on the logo in the layout image and then drags the control points on its edge to scale it, determining the image element to be adjusted as indicated by the image element description information includes: if the adjustment instruction is an image element identifier, then matching the image element to be adjusted corresponding to the image element identifier in at least one image element.

[0054] In addition to the two methods for determining the image elements to be adjusted mentioned above, it can also support both natural language and visual interaction. When the user uses natural language, semantic matching can be attempted first; when the confidence level of semantic matching is lower than a preset threshold, a clarification request can be sent to the user (such as "Which logo are you referring to? There are two logos in the layout image"), or the system can switch to visual interaction mode to allow the user to select manually. This can take into account the usage habits of different users and the interaction needs in different scenarios, so as to maintain a high positioning accuracy.

[0055] During the adjustment of image elements according to adjustment requests, the requests can be parsed into structured parameterized instructions, directly modifying the attribute parameters of the image elements to be adjusted. For example, "enlarge the logo by 20%" is parsed as "multiply the logo's scaling parameter by 1.2," and "move the title 10 pixels to the left" is parsed as "subtract 10 from the title's X coordinate." This achieves high-precision adjustments, executes quickly, and does not affect other elements. Alternatively, when the content involved in the adjustment request changes, an image generation tool can be invoked, new conditions can be input to regenerate the image elements to be adjusted, and the newly generated image elements can then replace the original image elements.

[0056] For example, adjusting the image element to be adjusted according to the adjustment request includes: determining at least one adjustment item and the adjustment method matching each adjustment item from the adjustment request; the at least one adjustment item includes background image adjustment, size adjustment, shape adjustment, and position adjustment; for any adjustment item, adjusting the image element to be adjusted according to the adjustment method corresponding to the adjustment item.

[0057] In some embodiments, adjusting the image element to be adjusted according to the adjustment method corresponding to the adjustment item includes: determining the display style after the adjustment item is adjusted; determining the new display features of the adjusted image element according to the display style; rendering the adjusted image element according to the new display features; and combining the adjusted image element with at least one unadjusted image element to obtain a new target layout.

[0058] For example, a display style refers to a macroscopic description of the appearance of an image element after adjustment. A display style may include, but is not limited to, descriptions of the element's size, position coordinates, rotation angle, color value, transparency, shape changes, and content replacement. The display style translates user intent into a more structured design description. For instance, if the adjustment request is "enlarge the logo by 20%", the corresponding display style could be described as "the width and height of the logo are both increased to 1.2 times their original size."

[0059] Display features refer to the specific set of parameters used to actually render image elements. Display features are a further quantification and refinement of the display style, and are data that the rendering engine can directly read and execute. Display features may include, but are not limited to, pixel coordinate values ​​(X-axis coordinates, Y-axis coordinates), size values ​​(width, height), scaling ratio, rotation angle (degrees or radians), color values ​​(RGB values, hexadecimal color codes), transformation matrices, etc. Display features are unambiguous, computable numerical parameters.

[0060] Based on the adjustment request, the display style that the image element to be adjusted should present after adjustment is calculated. This display style describes the appearance of the image element after adjustment. Next, based on this display style, new display features corresponding to the adjusted image element are determined. These display features are a specific set of parameters used for actual rendering. Based on the parameter data in the display features, the image element is transformed from a data structure into a visualized pixel image or vector graphic, generating the adjusted image element.

[0061] After multiple adjustments, if the relevant content of historical adjustment instructions is not saved, users may not be able to recall previously generated layout images, resulting in a poor user experience. Therefore, the method also includes: generating version snapshots corresponding to the adjustment instructions, the version snapshots including the adjustment instruction version identifier, the adjustment instruction, and the adjusted product layout image; checking whether the number of stored version snapshots is greater than a preset number; if the number of stored version snapshots is greater than the preset number, deleting the target version snapshot from the stored version snapshots in chronological order of storage time; and storing the version snapshots corresponding to the adjustment instructions so that when an adjustment instruction corresponding to a version snapshot is obtained, the product layout image corresponding to the version snapshot can be output.

[0062] For example, a version snapshot refers to a data set that records the design state resulting from a particular adjustment after the operation is completed. A version snapshot can contain structured data across multiple dimensions. In this embodiment, a version snapshot includes at least: an adjustment instruction version identifier, the adjustment instruction (the original adjustment request content issued by the user in this round, such as "enlarge the Logo by 20%), and the adjusted product layout image (the complete layout file obtained after this adjustment or its reference address in storage). A version snapshot may further include: comparison information before and after the adjustment, the identifiers of the modified elements and their new and old attribute values, the adjustment timestamp, and the parent version identifier (pointing to the previous version on which this adjustment is based). A version snapshot is the smallest data unit supporting multiple rounds of editing and version rollback. The preset quantity refers to the maximum number of version snapshots that can be retained simultaneously, and can be flexibly set according to the needs of the actual application scenario.

[0063] During implementation, a fixed-length version snapshot queue can be maintained, with the queue length equal to a preset number (e.g., 3). Each time a new version snapshot is added, it is appended to the end of the queue. If the queue length exceeds the preset number, the first element at the head of the queue (i.e., the oldest version snapshot) is automatically removed.

[0064] In some embodiments, invoking an image generation model to generate a target layout image according to a layout type includes: determining the display features of image elements based on vector information of any structural region; rendering image elements based on the display features; and combining at least one image element to form the target layout image after rendering at least one image element.

[0065] For example, the coordinates of the safe zone boundary in the vector information of the structural region can be read to directly restrict the display features of the image element within the safe zone. Specifically, the anchor point coordinates of the image element are set at the center of the safe zone or a preset alignment position, and the width and height of the image element are set to not exceed a certain proportion (such as 90%) of the width and height of the safe zone, to ensure that the image element is completely within the safe zone and will not touch the clipping line or be die-cut off.

[0066] It is also necessary to consider the vector information of multiple adjacent structural regions simultaneously to jointly determine the display characteristics of image elements. For example, although the front and side areas of a paper cup are structurally separate, they may visually require a continuous pattern. By reading the vector information of the two structural regions, calculating the relative positions and boundary relationships of the adjacent structural regions in the unfolded diagram, a continuous image element spanning the two regions can be generated, or the patterns can be rendered separately in the two regions while maintaining continuity, to obtain the target layout.

[0067] In traditional solutions, while AI models can generate visual content based on text descriptions when generating layout diagrams, they cannot precisely control the layout relationships (such as alignment, spacing, and arrangement direction) between multiple graphics. This results in the generated layout diagrams deviating from user expectations in terms of layout details and not matching the design template corresponding to the layout type. During production, related image elements may be directly cropped out, or different image elements may overlap. Therefore, before rendering image elements based on display features, the process includes: reading the design intent from the product image generation information; if the design intent represents image elements including at least two graphics, extracting the expected layout relationship of at least two graphics from the design intent; if it is determined that the current layout relationship of at least two graphics does not match the expected layout relationship, generating a correction instruction based on the difference between the expected and current layout relationships; and adjusting the layout relationship of at least two graphics based on the correction instruction to make the layout relationship of at least two graphics meet the expected layout relationship.

[0068] For example, design intent refers to the user's expectation of the overall or partial visual effect of the layout image expressed through the information generated by the product image. This can be extracted from the user's natural language description, such as "logo and title arranged horizontally," "two images aligned vertically," or "text wrapped around the image." It can also be inferred implicitly from reference images uploaded by the user; for example, if the logo is in the upper left corner and the title is in the lower right corner of a reference image, it can be inferred that the user desires a similar layout. A graphic refers to an independent visual unit contained within an image element. An image element can contain one or more graphics. For example, a "logo" image element might contain two graphics: a "graphic logo" and "brand name text"; a "main visual" image element might contain two graphics: a "product image" and a "decorative graphic." Graphics are more granular visual units than image elements, possessing independent shape, size, and positional attributes.

[0069] The intended layout relationship refers to the user's expectation in the design intent regarding the relative position and arrangement of at least two graphics. Intended layout relationships may include, but are not limited to, alignment relationships (left alignment, right alignment, center alignment, top alignment, bottom alignment), arrangement direction (horizontal arrangement, vertical arrangement, wrapping arrangement), spacing relationships (fixed spacing, equal spacing), containment relationships (one graphic is inside another graphic), and stacking relationships (one graphic is above or below another graphic).

[0070] After generating the target layout image or during the generation process, the layout relationships between multiple graphics in the layout image are further verified and corrected. Specifically, firstly, the user's design intent is read from the product image generation information submitted by the user. This design intent describes the user's expectations for the overall or partial visual effect of the layout image. If the design intent indicates that an image element contains at least two graphics, and these graphics have a expected layout relationship (e.g., horizontal alignment, vertical alignment, center alignment, wrapping, etc.), then a specific description of the expected layout relationship is extracted from the design intent. Subsequently, the actual layout relationship of these at least two graphics in the current layout image (i.e., the current layout relationship) is detected. If the current layout relationship does not match the expected layout relationship, the difference between the two is calculated, and a correction instruction is generated based on this difference. Finally, the layout relationship of these at least two graphics is adjusted based on the correction instruction so that the adjusted layout relationship meets the requirements of the expected layout relationship.

[0071] In traditional solutions, the AI ​​model outputs a flat bitmap where all visual content is merged into a single entity, lacking any identifying information to distinguish or reference specific elements. When a user needs to manipulate a particular element (e.g., adjust, delete, or replace), the element cannot be located. This embodiment assigns a unique identifier to each image element and establishes a mapping relationship with its structural regions, making each image element an independent object that can be programmatically referenced. This lays the data foundation for subsequent local editing, version management, and rollback operations. For example, after rendering the image elements based on display features, the process includes: generating configuration information for the image elements based on vector information, including the image element identifier; and constructing a mapping relationship between the image element identifier and the structural regions of the image elements.

[0072] For example, configuration information is generated for each image element. This configuration information includes at least an image element identifier, used to uniquely identify the image element. A mapping relationship is constructed between the image element identifier and the structural region corresponding to the image element. This mapping relationship can record which structural region each image element belongs to, and which image element corresponds to each structural region. Through this mapping relationship, the corresponding image element can be quickly located based on the structural region in subsequent operations, or the structural region to which the image element belongs can be found in reverse order based on the image element.

[0073] In some embodiments, before calling the image generation model to generate the target layout image according to the layout type, an initial toolset matching the layout type can be selected from a preset toolset; wherein, the initial toolset includes the calling interface description and input parameter description of each tool; the initial toolset is used as the callable toolset of the image generation model, and other tools other than the callable toolset are removed to avoid making incorrect tool calls.

[0074] As can be seen, the image generation method in the above embodiments, in response to obtaining product image generation information, parses the layout type in the product image generation information and obtains a design template corresponding to the layout type; wherein, the design template includes vector information of at least one structural region; therefore, when the image generation model is called to generate a target layout image according to the layout type, the target layout image includes at least one image element, and at least one image element corresponds one-to-one with at least one structural region and is independent of each other, and can be adjusted according to the structural region after obtaining an adjustment request, thereby improving the generation efficiency of the target layout image.

[0075] Corresponding to the above image generation method, this application embodiment also provides an image generation method applied to a client, such as... Figure 3 As shown, the method includes: In step S301, product image generation information is sent to the server; In step S302, the target layout image generated by the server based on the product image is obtained; wherein the target layout image is generated based on the image generation method of the server mentioned above; the target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other.

[0076] In some embodiments, the method further includes: sending an adjustment instruction to the server; the adjustment instruction includes image element description information and an adjustment request. The adjustment instruction is a request from a user, input through an input device, to the client to modify design content based on a target layout image.

[0077] For example, the specific implementation of the image generation method applied to the client can be found in the implementation method of the corresponding image generation method on the server side, and will not be repeated here.

[0078] The above-mentioned image generation method can also be implemented by software modules to achieve the corresponding functions. Corresponding to the image generation method in the above-mentioned server, this application embodiment can also provide an image generation device.

[0079] like Figure 4 As shown, an image generation device is provided for use on a server. The device may include: a parsing module 41, an acquisition module 42, and a generation module 43.

[0080] For example: parsing module 41 is used to parse the layout type in the product image generation information in response to obtaining product image generation information; The acquisition module 42 is used to determine the corresponding design template according to the layout type; wherein the design template includes vector information of at least one structural region; The generation module 43 is used to input the layout type and the design template into the image generation model and obtain the target layout image output by the image generation model; the target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other.

[0081] As can be seen, by adopting the embodiments of this application, in response to obtaining product image generation information, the layout type in the product image generation information is parsed, and a design template corresponding to the layout type is obtained; wherein, the design template includes vector information of at least one structural region; therefore, by inputting the layout type and the design template into the image generation model, the target layout image output by the image generation model is obtained. The target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other. After obtaining an adjustment request, adjustments can be made according to the structural region, thereby improving the generation efficiency of the target layout image.

[0082] The above-described image generation method can also be implemented through software modules to achieve the corresponding functions. Corresponding to the image generation method in the client described above, this application embodiment can also provide an image generation device.

[0083] like Figure 5 As shown, an image generation device is provided for use on a client. The device may include a sending module 51 and a layout image acquisition module 52.

[0084] For example: the sending module 51 is used to send product image generation information to the server; The layout image acquisition module 52 is used to acquire the target layout image generated by the server based on the product image for information feedback; wherein the target layout image is generated based on the method described in the first aspect; the target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other. Understandable, Figure 4 and Figure 5 The division of the various modules is merely a logical functional division. In actual implementation, the functions of these modules can be integrated into the hardware entity of the electronic device.

[0085] Please refer to Figure 6 , Figure 6 An electronic device is provided, and this disclosure also provides an electronic device for performing some or all of the steps of the above-described image generation method. Please refer to... Figure 6The electronic device includes a processor 600, a memory 601, a bus 602, and a communication interface 603, wherein the processor 600, the communication interface 603, and the memory 601 are connected via the bus 602; the memory 601 stores a computer program that can run on the processor 600, and the processor 600 can be equivalent to a CPU, executing the aforementioned provisions of this disclosure when running the computer program. Figure 2 or Figure 3 The image generation method provided in any of the embodiments, during the execution of the aforementioned method, interacts with the corresponding client through the communication interface 603 to exchange data and instructions.

[0086] The memory 601 may include high-speed random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 603 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0087] Bus 602 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. Memory 601 is used to store programs, and the processor 600 executes the programs after receiving execution instructions. Figure 2 or Figure 3 The illustrated embodiments reveal that the image generation method can be applied to, or implemented by, the processor 600.

[0088] The processor 600 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 600 or by instructions in software form. The processor 600 may be a general-purpose processor, including a CPU, a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 601. Processor 600 reads the information in memory 601 and, in conjunction with its hardware, completes the steps of the above method.

[0089] The electronic device provided in this disclosure and the image generation method provided in this disclosure are based on the same inventive concept and have the same beneficial effects as the methods they employ, operate, or implement.

[0090] This application also provides a computer-readable storage medium storing instructions for image generation, which, when run on a computer, cause the computer to perform some or all of the steps in the method described in the foregoing embodiments.

[0091] This application also provides a computer program product including instructions for image generation, which, when run on a computer, causes the computer to perform some or all of the steps in the methods described in the foregoing embodiments.

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

[0093] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

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

[0095] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0096] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, smartphone, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0097] Although alternative embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make further changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0098] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above description is only a specific embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of this application should be included within the scope of protection of this invention.

Claims

1. An image generation method, characterized in that, Applied to the server side, the method includes: In response to obtaining product image generation information, the layout type in the product image generation information is parsed; A corresponding design template is determined based on the layout type; wherein the design template includes vector information of at least one structural region; The layout type and the design template are input into the image generation model to obtain the target layout image output by the image generation model; the target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other.

2. The method according to claim 1, characterized in that, The method further includes: In response to receiving an adjustment instruction, the image element description information and adjustment request contained in the adjustment instruction are read; Determine the image element to be adjusted indicated by the image element description information, wherein the image element to be adjusted is any one of the at least one image element; The image elements to be adjusted are adjusted according to the adjustment request.

3. The method according to claim 2, characterized in that, The step of determining the image element to be adjusted indicated by the image element description information includes: If the adjustment instruction is a natural language instruction, extract the key phrases from the natural language instruction, where the key phrases refer to phrases describing image features; The key phrase is matched with the features of each image element in the at least one image element; Image elements whose similarity meets the preset conditions are identified as the image elements to be adjusted.

4. The method according to claim 2, characterized in that, The step of determining the image element to be adjusted indicated by the image element description information includes: If the adjustment instruction is an image element identifier, then match the image element to be adjusted that corresponds to the image element identifier among the at least one image element.

5. The method according to any one of claims 2-4, characterized in that, The step of adjusting the image elements to be adjusted according to the adjustment request includes: Determine at least one adjustment item and a matching adjustment method for each adjustment item from the adjustment request; the at least one adjustment item includes background image adjustment, size adjustment, shape adjustment, and position adjustment; For any adjustment item, the image element to be adjusted is adjusted according to the adjustment method corresponding to the adjustment item.

6. The method according to claim 5, characterized in that, The step of adjusting the image element to be adjusted according to the adjustment method corresponding to the adjustment item includes: Determine the display style after the adjustment item is modified; Based on the aforementioned display style, determine the new display characteristics of the adjusted image elements; Render the adjusted image elements according to the new display features; The adjusted image elements are combined with the unadjusted image elements from the at least one image element to obtain a new target layout.

7. The method according to claim 2, characterized in that, The method further includes: Generate a version snapshot corresponding to the adjustment instruction, the version snapshot including the adjustment instruction version identifier, the adjustment instruction, and the adjusted product layout image; Check if the number of stored version snapshots is greater than the preset number; If the number of stored version snapshots is greater than the preset number, then the target version snapshot is deleted from the stored version snapshots in chronological order of storage time. Store the version snapshot corresponding to the adjustment instruction so that when an adjustment instruction corresponding to the version snapshot is obtained, the product layout image corresponding to the version snapshot can be output.

8. The method according to claim 1, characterized in that, The step of inputting the layout type and the design template into the image generation model and obtaining the target layout image output by the image generation model includes: The display features of the image elements are determined based on the vector information of any structural region; The image elements are obtained by rendering based on the display features; After rendering the at least one image element, the at least one image element is combined to form the target layout image.

9. The method according to claim 8, characterized in that, Before the image element is rendered based on the display features, the method further includes: Read the design intent from the product drawing generation information; If the design intent represents that the image element includes at least two graphics, extract the expected layout relationship of the at least two graphics from the design intent; If it is determined that the current layout relationship of the at least two graphics does not match the expected layout relationship, a correction instruction is generated based on the difference between the expected layout relationship and the current layout relationship. The layout relationship of the at least two graphics is adjusted based on the correction instructions so that the layout relationship of the at least two graphics satisfies the expected layout relationship.

10. The method according to claim 8, characterized in that, After obtaining the image element based on the display features, the process further includes: Configuration information for the image element is generated based on the vector information, and the configuration information includes the image element identifier of the image element; Construct a mapping relationship between the image element identifier and the structural region of the image element.

11. An image generation method, characterized in that, Applied to a client, the method includes: Send product image generation information to the server; The server generates a target layout image based on the product image to provide information feedback; the target layout image includes at least one image element, and the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other; wherein the target layout image is generated based on the method described in any one of claims 1-10.

12. The method according to claim 11, characterized in that, The method further includes: An adjustment instruction is sent to the server; the adjustment instruction includes image element description information and an adjustment request.

13. An image generation system, characterized in that, The system includes: The client is used to send product image generation information to the server; The server is used to parse the layout type in the product image generation information; determine the corresponding design template according to the layout type; wherein the design template includes vector information of at least one structural region; input the layout type and the design template into the image generation model to obtain the target layout image output by the image generation model; the target layout image includes at least one image element, wherein the at least one image element corresponds one-to-one with the at least one structural region and is independent of each other.

14. An electronic device comprising a memory, a processor, and a computer program stored in the memory, wherein the processor, when executing the computer program, implements the method of any one of claims 1-12.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by a processor to implement the method as described in any one of claims 1-12.

16. A computer program product, characterized in that, Includes instructions that, when executed on a computer, cause the computer to perform the method as described in any one of claims 1-12.