Image generation method and related device

By using a hybrid trajectory input method that combines text and pattern trajectories and utilizes an AI model to generate images, the problem of high image generation difficulty caused by inaccurate user input is solved, achieving efficient and accurate image generation and improving the user experience.

WO2026232815A1PCT designated stage Publication Date: 2026-11-12HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/143411
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-07
Filing Date
2025-12-18
Publication Date
2026-11-12

AI Technical Summary

Technical Problem

Existing AI image generation technology struggles to generate images that meet user expectations when the user's input pattern trajectory is inaccurate, resulting in high image generation difficulty.

Method used

By using a hybrid trajectory input method that combines text and pattern trajectories, an AI model is used to generate images. This ensures that the positional and perspective relationships of the text semantic objects and pattern indicator objects in the generated images are consistent with the user input, thus simplifying the user's operation process.

Benefits of technology

It reduces the difficulty of image generation, improves the accuracy and efficiency of image generation, ensures that the generated images meet user expectations, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025143411_12112026_PF_FP_ABST
    Figure CN2025143411_12112026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides an image generation method and a related device, which are used for reducing difficulty in generating images. The method comprises: acquiring a first input, the first input comprising a first trajectory and a second trajectory, the first trajectory being a trajectory of text, and the second trajectory being a trajectory of a pattern; and, on the basis of the first input, generating a first image, the first image containing a first object and a second object, the first object being an object indicated by the semantics of the text, and the second object being an object indicated by the pattern.
Need to check novelty before this filing date? Find Prior Art

Description

An image generation method and related equipment

[0001] This application claims priority to Chinese Patent Application No. 202510585690.X, filed on May 7, 2025, entitled "An Image Generation Method and Related Equipment", the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of artificial intelligence (AI), and more particularly to an image generation method and related equipment. Background Technology

[0003] AI technology is booming, and AI-powered image generation is being widely applied in human work and entertainment. Currently, AI image generation is used in practical scenarios such as fun exploration and work-related needs. Regardless of the application scenario, it's essential to generate images that meet user expectations using AI tools, based on user needs.

[0004] In one image generation method, a user inputs a pattern, and an AI model generates a corresponding image based on the user's input pattern. The pattern generated by the AI ​​model is consistent with the user's input. In this approach, the image quality generated by the AI ​​model depends on the quality of the user's input pattern, requiring a high level of drawing ability from the user. If the trajectory of the user's input pattern is unclear or inaccurate, an accurate image cannot be generated, resulting in a high level of difficulty in image generation. Summary of the Invention

[0005] This application provides an image generation method and related equipment to reduce the difficulty of image generation.

[0006] In a first aspect, this application provides an image generation method, including:

[0007] Image generation methods utilize AI models to generate images from user-input mixed trajectories, resulting in an output image. Mixed trajectories refer to trajectories of different types, including text trajectories and pattern trajectories. For example, the first user input includes a first trajectory and a second trajectory; the first trajectory is a text trajectory, and the second trajectory is a pattern trajectory. A first image is generated based on the first input. This first image includes the object indicated by the first input, i.e., it includes a first object and a second object. The first object is the semantically indicated object of the text, and the second object is the object indicated by the pattern. The semantically indicated object of the text can also be understood as the object described by the text, or the object indicated by the content of the text. For example, the text "sheep" semantically indicates a sheep in nature. The object indicated by the pattern can be an optimized version of the user-input pattern or the pattern itself. Regardless of the context, the second object and the second trajectory of the user input appear to be the same type of object. For example, both could be a hat or grass.

[0008] In this embodiment, the AI ​​model generates a first image from the trajectory of text and the trajectory of a pattern in the first input. The first image includes a first object indicating the semantics of the text and a second object indicating the pattern. In practical applications, simple images can be generated from the trajectory of a pattern input by the user, while complex images can be generated from the trajectory of text input by the user. Replacing complex pattern trajectories with simple text trajectories reduces the difficulty of drawing for the user, thus reducing the difficulty of image generation.

[0009] In some alternative implementations of the first aspect, the positional relationship between the first object and the second object is consistent with the positional relationship between the first trajectory and the second trajectory. Alternatively, the perspective relationship between the first object and the second object is related to the order in which the first trajectory and the second trajectory are input, thereby ensuring that the generated image is consistent with or related to the user's input, further improving the accuracy of image generation.

[0010] In some optional implementations of the first aspect, the perspective relationship between the first and second objects is consistent with the perspective relationship between the first and second trajectories. This perspective relationship can be understood as the occlusion or overlay relationship between different layers. Maintaining consistency between the perspective relationship of the output object and the perspective relationship of the input trajectory ensures that the generated image meets the user's expectations, improving the practicality of the solution.

[0011] In some alternative implementations of the first aspect, the first input is a one-time input from the user. More specifically, it could be a one-time input from the user over a continuous period of time.

[0012] In this embodiment, the user inputs the trajectory of the text and the trajectory of the pattern at once, instead of inputting them separately, which reduces the user's waiting time during the image generation process and improves the efficiency of image generation.

[0013] In some optional implementations of the first aspect, after obtaining the user's first input, the first input is identified to determine the trajectory of the text and the trajectory of the pattern. Specifically, based on the temporal information of the first input, multiple input trajectories including the first input are determined. Then, based on the spatial information of the multiple input trajectories, the input trajectory with a character structure is determined as the first trajectory, and the input trajectories other than the first trajectory are determined as the second trajectory.

[0014] In this embodiment, based on the temporal information of the first input, multiple input trajectories included in the first input are determined, that is, which trajectories were input. Then, based on the spatial information of the multiple input trajectories, the trajectories of text and patterns other than text trajectories are identified. By utilizing the temporal and spatial dimensions of the input trajectories, the trajectories of text and patterns are accurately identified, improving the accuracy of image generation.

[0015] In some alternative implementations of the first aspect, the erroneous first trajectory can also be corrected. Specifically, in the case where the character structure of the identified first trajectory is incorrect, i.e., in the case where the character structure of the input text trajectory is incorrect, a first prompt interface is displayed, indicating that the character structure of the first trajectory is incorrect. Then, in response to the operation command for the first prompt interface, the first trajectory is corrected, and the character structure of the corrected first trajectory is correct.

[0016] In this embodiment, a reminder is given for the first trajectory with an incorrect character structure, and the correct first trajectory is obtained after correction, thereby making the semantics of the text indicated by the first trajectory accurate and further improving the accuracy of image production.

[0017] In some optional implementations of the first aspect, the semantics of the text may be ambiguous. In this scenario, before generating the first image, a candidate word interface is displayed. This interface includes multiple candidate word controls, each allowing the user to refine the semantics of the text. Responding to an operation command targeting a target candidate word control among the multiple candidate word controls, the first object is determined to be the image indicated by the target candidate word control. This achieves the refinement of the text's semantics. Ambiguity in the text's semantics includes situations where the meaning is unclear, inaccurate, or has multiple different meanings, making it difficult to determine the precise meaning of the text.

[0018] In this embodiment, for scenarios where the text semantics are ambiguous, a candidate word interface can be displayed, showing multiple candidate word controls that refine the text semantics. Responding to operation instructions for a target candidate word control among these multiple candidate word controls, the text semantics are refined to the semantics indicated by that target candidate word. In other words, through the candidate word interface, the precise meaning expressed by the text is determined, thereby ensuring that the first object included in the generated first image conforms to the user's expectations, further ensuring the accuracy of image generation.

[0019] In some alternative implementations of the first aspect, the height of the first object and the height of the first trajectory satisfy a first condition, and / or the width of the first object and the width of the first trajectory satisfy a second condition. The height of the second object and the height of the second trajectory satisfy a third condition, and / or the width of the second object and the width of the second trajectory satisfy a fourth condition.

[0020] In this embodiment, the size of the first object (including height and / or width) is related to the size of the first trajectory, and the size of the second object is related to the size of the second trajectory, so that the size of the generated first image is related to the size of the first input, which is more in line with the user's usage habits and improves the user experience.

[0021] In some alternative implementations of the first aspect, the primary color of the first object is the same as the color of the first trajectory, and / or, the primary color of the second object is the same as the color of the second trajectory.

[0022] In this embodiment, the color of the input trajectory can directly indicate the main color of the corresponding object in the generated image, eliminating the need to set the main color of the corresponding object through other means, thus simplifying the operation process and reducing the complexity of the technical solution.

[0023] In some optional implementations of the first aspect, the text trajectory can be used not only to indicate its semantically corresponding object but also to indicate itself, such that the output image includes the text itself. Specifically, a second user input is obtained, which includes a third, fourth, and fifth trajectory. The third trajectory is the text trajectory, the fourth trajectory is the pattern trajectory, and the fifth trajectory is the indicator trajectory, which indicates that the object indicated by the text is the text in the text trajectory. A second image is generated based on the second input, and the second image includes the third object and the fourth object. The third object is the object indicated by the text, i.e., the text in the text trajectory. The fourth object is the object indicated by the pattern.

[0024] In this embodiment, the object indicated by the indicator text is the text in the text trajectory, so that the generated image includes the text in the text trajectory, rather than the object indicated by the text semantics. This enriches the implementation methods and application scenarios of the technical solution of this application and improves the flexibility of the technical solution.

[0025] In some alternative implementations of the first aspect, the object of the text indication can also be determined in other ways. Specifically, a third user input is obtained, which includes a sixth trajectory and a seventh trajectory, where the sixth trajectory is the trajectory of text and the seventh trajectory is the trajectory of a pattern. A user instruction is obtained, which instructs that the object of the text indication is the text within the text trajectory. A third image is generated based on the third input and the instruction, the third image including a fifth object and a sixth object, where the fifth object is the object of the text indication and the sixth object is the object of the pattern indication.

[0026] In the embodiments of this application, there are multiple ways to determine that the object of the text indication is the text in the text trajectory, which enriches the implementation methods and application scenarios of the technical solution of this application and improves the flexibility of the technical solution.

[0027] Secondly, this application provides an image generation apparatus, comprising:

[0028] The acquisition unit is used for the user's first input, which includes a first trajectory and a second trajectory. The first trajectory is the trajectory of text, and the second trajectory is the trajectory of a pattern.

[0029] The processing unit is configured to generate a first image based on a first input. The first image includes a first object and a second object, wherein the first object is an object that is a semantically indicated text and the second object is an object that is a pattern indicated.

[0030] The image generation apparatus is used to perform the method shown in the first aspect or any possible implementation of the first aspect, as detailed above, and will not be repeated here.

[0031] Thirdly, this application provides an image generation device, including a processor and a memory, wherein the processor stores instructions that, when executed on the processor, implement the method shown in the first aspect or any possible implementation of the first aspect.

[0032] Fourthly, this application provides a chip including at least one processor and a communication interface, the communication interface and at least one processor being interconnected via a line, the at least one processor being used to run computer programs or instructions to perform the methods shown in the first aspect or any possible implementation of the first aspect.

[0033] Fifthly, this application provides a computer-readable storage medium storing instructions that, when executed on a processor, implement the method shown in the first aspect or any possible implementation of the first aspect.

[0034] Sixthly, this application provides a computer program product that, when executed on a processor, implements the method shown in the first aspect or any possible implementation of the first aspect.

[0035] The beneficial effects shown in any of the third to sixth aspects are similar to those of the first aspect or any possible implementation of the first aspect, and will not be repeated here. Attached Figure Description

[0036] Figure 1 is a schematic diagram of the system architecture provided in an embodiment of this application;

[0037] Figure 2 is a flowchart illustrating an image generation method provided in an embodiment of this application.

[0038] Figure 3 is a schematic diagram of an interface provided in an embodiment of this application;

[0039] Figure 4 is a schematic diagram of an interface provided in an embodiment of this application;

[0040] Figure 5 is another schematic diagram of an interface provided in an embodiment of this application;

[0041] Figure 6 is another interface diagram provided in an embodiment of this application;

[0042] Figure 7 is another schematic diagram of an interface provided in an embodiment of this application;

[0043] Figure 8 is another interface diagram provided in an embodiment of this application;

[0044] Figure 9 is another schematic diagram of an interface provided in an embodiment of this application;

[0045] Figure 10 is another schematic diagram of an interface provided in an embodiment of this application;

[0046] Figure 11 is another schematic diagram of an interface provided in an embodiment of this application;

[0047] Figure 12 is a schematic diagram of an image generation apparatus provided in an embodiment of this application;

[0048] Figure 13 is a schematic diagram of an image generation device provided in an embodiment of this application;

[0049] Figure 14 is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation

[0050] This application provides an image generation method and related equipment to reduce the difficulty of image generation.

[0051] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0052] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of units is not necessarily limited to those units, but may include other units not explicitly listed or inherent to those processes, methods, products, or apparatuses. Additionally, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can be expressed as: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0053] Please refer to Figure 1, which is a system architecture diagram provided in an embodiment of this application.

[0054] In the embodiment shown in FIG1, the image generation system includes an execution device 110, a training device 120, a database 130, a terminal device 140, and a data storage system 150. The execution device 110 includes a computing module 111 and an input / output (I / O) interface 112.

[0055] Data acquisition device 160 is used to acquire training datasets and store them in database 130. Training device 120 trains the AI ​​model 101 constructed in this application based on the training dataset maintained in database 130. The trained AI model 101 runs on execution device 110. Execution device 110 can access data, code, etc., in data storage system 150, and can also store data, code, etc., in data storage system 150.

[0056] The trained AI model 101 runs on the execution device 110, implementing the image generation method provided in this embodiment. Optionally, the AI ​​model 101 generates an image including objects with text semantic indications and objects indicated by pattern trajectories, based on the trajectory of text and the trajectory of patterns input by the user. Optionally, the AI ​​model 101 generates an image including text in the text trajectory and objects indicated by pattern trajectories, based on the trajectory of input text, the trajectory of patterns, and the trajectory of indicators. Optionally, the AI ​​model 101 generates an image including text in the text trajectory and objects indicated by pattern trajectories, based on the trajectory of text, the trajectory of patterns, and instructions input by the user. The specific implementation process will be described in detail later and will not be repeated here.

[0057] It should be noted that the training device 120 does not necessarily obtain training data entirely from the database 130; it can also obtain training data from the cloud or other devices for model training. This is not specifically limited here. The execution device 110 can be a terminal, such as a laptop or tablet, or it can be a cloud device or a server. This is not specifically limited here.

[0058] It should also be noted that Figure 1 is merely a schematic diagram of the system architecture provided in this application embodiment and does not constitute any limitation on the positional relationship between various devices, components, modules, etc. For example, in the embodiment shown in Figure 1, the data storage system 150 is an external memory relative to the execution device 110. In some optional embodiments, the data storage system 150 may also be integrated into the execution device 110. In the embodiment shown in Figure 1, the terminal device 140 is an external device relative to the execution device 110. In some optional embodiments, the terminal device 140 may also be integrated into the execution device 110; specific details are not limited here.

[0059] In the following description, a terminal device is used as the execution subject to introduce the image generation method provided in the embodiments of this application. The terminal device is equipped with an operating system that has a built-in AI model, or the terminal device connects to an AI model provided by a server via a network to implement the image generation method provided in the embodiments of this application.

[0060] It should be noted that the embodiments of this application do not limit the type of terminal device. The terminal device may include various handheld devices, vehicle-mounted devices, wearable devices, computing devices, or other processing devices connected to a wireless modem with wireless communication functions. The terminal device may also be called a terminal, and the terminal device may also be a cellular phone, a smartphone, a personal digital assistant (PDA) computer, a tablet computer, a handset, a laptop computer, a machine type communication (MTC) terminal, etc., without limitation here.

[0061] Please refer to Figure 2 below, which is a flowchart illustrating the image generation method provided in the embodiments of this application.

[0062] 201. Obtain the user's first input, which includes a first trajectory and a second trajectory. The first trajectory is a text trajectory, and the second trajectory is a pattern trajectory. The terminal device displays an image generation interface. The user inputs a mixed trajectory into this interface. The terminal device recognizes the mixed trajectory and obtains the first and second trajectories from it. A mixed trajectory refers to a trajectory input by the user that includes different types of trajectories in terms of form or structure, or a mixture of multiple types of trajectories. The first trajectory is a text trajectory with a character structure. A character structure refers to a structure that conforms to the form of characters, including characters from various languages, such as Chinese, English, and French. The second trajectory is a pattern trajectory, which is a trajectory other than the first trajectory included in the first input. The pattern formed by the second trajectory can be a regular shape or an irregular shape, determined based on the user's actual input.

[0063] Furthermore, the terminal device displays an image generation interface, responds to operation commands for the image generation interface, and obtains the first input. There are several possibilities for the terminal device to display the image generation interface. The following description is based on a schematic diagram; please refer to Figure 3, which is a schematic diagram of the interface provided in an embodiment of this application.

[0064] Optionally, the image generation interface can be accessed from the AI ​​painting application's interface. As shown in Figure 3(A), the user uses the AI ​​painting application, clicks on AI painting, and enters the image generation interface. This interface displays a blank canvas, on which the user inputs the painting trajectory. Then, by clicking the "Generate" button below, the terminal device generates the AI ​​image.

[0065] Optionally, the image generation interface can be accessed from the photo album application. As shown in Figure 3(B), when browsing images in the album, users can enter the image editing interface by long-pressing an image or clicking on the image's editing controls. The image editing interface includes multi-level menus containing AI creation controls. Users can click on these controls to enter the image generation interface, utilizing the AI ​​capabilities of the terminal device for secondary creation of the image.

[0066] Optionally, the image generation interface can also be accessed from other applications. Its implementation principle is similar to that in Figure 3(B), both of which can use AI capabilities to perform secondary creation on the image. Alternatively, in other painting applications, the image generation interface can be activated through plugins, jumps, or other means to complete the painting with the help of AI capabilities.

[0067] As illustrated in Figure 3, the image generation method provided in this application can generate an image based on user input on a blank canvas, or it can perform secondary creation on an existing image. Regardless of the scenario, the processing logic of the terminal device is the same: it generates an image corresponding to the user's input trajectory.

[0068] There are several possibilities for how a terminal device can acquire the first input. Optionally, the user can use an external tool such as a finger or stylus to move on the screen of the terminal device displaying the image generation interface, and the terminal device will recognize the movement trajectory to acquire the first input. Optionally, for terminal devices without touchscreens or touch-controlled screens, the user can use an external device such as a mouse to move on the image generation interface, allowing the terminal device to recognize the movement trajectory and acquire the first input. The implementation of the terminal device recognizing the movement trajectory refers to existing technical solutions, and the recognition result can be understood as the movement trajectory of the touch point. This process can also be understood as the terminal device responding to the user's operation command regarding the image generation interface and acquiring the first input.

[0069] In the technical solutions provided in this application embodiment, user input is typically submitted to the terminal device all at once after drawing is completed. That is, the first input is entered by the user in one go. Furthermore, the user inputs the trajectory of text and the trajectory of a pattern in a continuous period of time.

[0070] For example, please refer to Figure 4, which is a schematic diagram of the interface provided in an embodiment of this application.

[0071] As shown in Figure 4, the user draws a hat pattern on the blank canvas displayed in the image generation interface and writes the word "dragon" inside the hat. The user then clicks the "Generate" control, allowing the terminal device to capture the trajectory of the user's input. The user first draws the pattern and text, then clicks "Generate Space," which can be understood as the user inputting the trajectory of both the pattern and text in one go.

[0072] In this embodiment, the user inputs the trajectory of the text and the trajectory of the pattern at once, instead of inputting them separately, which reduces the user's waiting time during the image generation process and improves the efficiency of image generation.

[0073] 202. Generate a first image based on the first input. The first image includes a first object and a second object. The first object is an object that is a semantically indicated text, and the second object is an object that is a pattern indicated.

[0074] After acquiring the first input, the terminal device generates a first image based on the first input. The first image includes the object corresponding to the first input. Specifically, the first image includes a first object and a second object. The first object is the semantically indicated object of the text of the first trajectory, and the second object is the pattern indicated object of the second trajectory.

[0075] The object indicated by the pattern refers to the object displayed by the pattern that is of the same type as the object depicted by the pattern's trajectory. In other words, the second object can be a copy of the second trajectory or an optimization of the second trajectory. For example, in the embodiment shown in Figure 5, the second trajectory in Figure 5(A) is the trajectory of the pattern "grass". As shown in the first image in Figure 5(B), the second object (i.e., the grass pattern) in that image is a copy of the second trajectory. As another example, in the embodiment shown in Figure 6, the second trajectory is the trajectory of the user-drawn pattern "hat", while in the first image, the second object is a hat optimized from that trajectory.

[0076] The first image is generated based on the first input. Therefore, the relationship between the first object and the second object included in the first image should be consistent with the relationship between the first trajectory and the second trajectory included in the first input. This ensures that the image generated by the terminal device is consistent with the user's input and meets the user's expectations. The relationship between different objects mentioned above includes at least one of positional relationship or perspective relationship. The following description is in conjunction with schematic diagrams. Please refer to Figures 5 and 6, which are interface schematic diagrams provided in the embodiments of this application.

[0077] In some alternative implementations, the positional relationship between the first object and the second object is consistent with the positional relationship between the first trajectory and the second trajectory. Here, positional relationship refers to the relative positional relationship between different objects. It is understood that the positional relationship between different trajectories is something that an AI model can learn and recognize through training.

[0078] For example, as shown in Figure 5(A), the AI ​​model can identify that the trajectory of the user-inputted text "bird" is located in the middle of the trajectory of the pattern "grass". Therefore, regardless of whether the first image generated by the AI ​​model is as shown in Figure 5(B) or Figure 5(C), the first object "bird" in the first image is located in the middle of the second object "grass". As another example, as shown in Figure 6, the trajectory of the user-inputted text "dragon" is located in the middle of the trajectory of the pattern "hat", mainly on the curved surface of the hat's crown. Therefore, in the generated first image, the first object "bird" is located on the curved surface of the hat's crown in the second object "hat".

[0079] It should be noted that the case of the first object on the curved surface of the second object shown in the embodiment of Figure 6 can be understood as a secondary processing of the image corresponding to the first trajectory after its generation, making the processed image fit the image corresponding to the second trajectory more closely. This process is an internal implementation of the terminal device and is not perceived by the user. The embodiment shown in Figure 6 takes the example of the object indicated by the semantics of the text being located on the curved surface of the object indicated by the pattern. In practical applications, there may also be a scheme where the object indicated by the image is located on the curved surface of the object indicated by the semantics of the text. The implementation principle is similar to that of Figure 6 and will not be repeated here.

[0080] In this embodiment, the positional relationship between the first object and the second object is consistent with the positional relationship between the first trajectory and the second trajectory. This ensures that the generated image is consistent with the user's input, further improving the accuracy of image generation.

[0081] In some optional implementations, the perspective relationship between the first and second objects is consistent with the perspective relationship between the first and second trajectories. The perspective relationship referred to here can be understood as the occlusion or overlapping relationship between different objects. When the first and second trajectories overlap, the first and second objects also overlap, thus requiring the determination of the perspective relationship between different objects within the overlapping area. When inputting trajectories, users can represent the perspective relationship between different trajectories through operations such as coloring. The AI ​​model can learn and recognize the perspective relationships between trajectories.

[0082] For example, suppose in the example in Figure 5(A), the user not only drew the trajectory of the patterned grass but also filled in the grass, causing it to obscure the trajectory of the text "bird." The AI ​​model then identifies this perspective relationship and ensures that the perspective relationships of different objects in the generated first image are consistent with it. That is, it generates the first image shown in Figure 5(B).

[0083] In some alternative implementations, the perspective relationship between the first object and the second object depends on the order in which the first trajectory and the second trajectory are input. Typically, the trajectory input earlier is covered by the trajectory input later; therefore, the object corresponding to the earlier trajectory is also covered by the object corresponding to the later trajectory.

[0084] For example, suppose in Figure 5(A), the user first inputs the trajectory of the text "bird" and then inputs the trajectory of the pattern "grass". The result is the first image shown in Figure 5(B). In the first image, the pattern of the first object "bird" is obscured by the pattern of the second object "grass".

[0085] For example, suppose in Figure 5(A), the user first inputs the trajectory of the pattern "grass" and then inputs the trajectory of the text "bird". The result is the first image shown in Figure 5(C). In the first image, the pattern of the first object "bird" occludes the pattern of the second object "grass".

[0086] In this embodiment, the perspective relationship of the output object is consistent with the perspective relationship of the input trajectory or is related to the order in which the trajectory is input, ensuring that the generated image meets the user's expectations and improving the practicality of the solution.

[0087] In some alternative implementations, the perspective relationship between the first and second objects can also be determined based on aesthetic analysis results. Specifically, in scenarios where the first and second objects overlap, the terminal device can use an AI model to perform aesthetic analysis on each perspective relationship in the overlapping area, obtaining multiple aesthetic scores. The perspective relationship with the highest aesthetic score is then determined as the perspective relationship between the first and second objects in the first image. For example, in the embodiment shown in Figure 5, the aesthetic score of image (B) in Figure 5 is higher than that of image (C) in Figure 5. The terminal device determines the perspective relationship between the pattern "bird" and the pattern "grass" as shown in image (B) of Figure 5. That is, for the input shown in image (A) of Figure 5, the terminal device generates the image shown in image (B).

[0088] In some alternative implementations, the perspective relationship between the first and second objects can also be determined based on natural laws. For the perspective relationship of overlapping areas, the terminal device automatically determines it according to natural laws and then displays a first image that conforms to these laws. For example, in the embodiment shown in Figure 7, it is more natural for the dragon pattern to be located outside the hat than inside the hat, where it cannot be seen from the existing input perspective. Therefore, the terminal device determines the first image to display as shown in the right image of Figure 6.

[0089] In some optional implementations, the perspective relationship between the first object and the second object can also be specified by the user. Given multiple possible occlusion relationships between the first and second objects, the terminal device can display various possibilities for the user to choose from. Then, based on the user's specification, the perspective relationship between the first and second objects in the final displayed first image is determined. Taking the embodiment shown in Figure 5 as an example, for the input shown in Figure (A) of Figure 5, the terminal device can determine the first image in multiple ways. Optionally, the terminal device can use a split-screen mode on its screen, simultaneously displaying the image shown in Figure (B) of Figure 5 and the image shown in Figure (C) of Figure 5. When the user clicks on one of the images, the terminal device responds to the operation and determines that the first image is the image clicked by the user. Optionally, when displaying the image shown in Figure (B) of Figure 5, the terminal device also displays a prompt message to indicate that other generated images exist. The user can switch to displaying the image shown in Figure (C) of Figure 5. Then, the user clicks the save control on the interface displaying one of the images to confirm that the image is selected as the final generated image.

[0090] Understandably, the user is unaware of the aforementioned process of determining the positional and perspective relationships between the first and second objects. For the user, inputting the first trajectory and clicking the generate control results in the terminal device displaying the first image. However, given multiple possible perspective relationships, the terminal device may display multiple images simultaneously or sequentially to show different perspective relationships for the user to choose from.

[0091] It should also be noted that the first and second objects in the first image may themselves have multiple layers, or multiple sub-layers / sub-layers. Therefore, when determining the perspective relationship between different objects, it is possible to determine both the positional relationship of the main layer of different objects and the positional relationship of the sub-layers. The positional relationship of the main layer can be understood as the overall positional relationship of different objects, while the positional relationship of the sub-layers can be understood as the local positional relationship of different objects.

[0092] The preceding text introduced the various relationships between different input trajectories and between these trajectories and different output objects. In practical applications, the relationship between the input trajectory and the corresponding object in the output also has multiple aspects. These will be explained in detail below.

[0093] In some alternative implementations, the relationship between the size of the output object and the size of the input trajectory includes several possibilities: the height of the first object and the height of the first trajectory satisfy a first condition, and / or, the width of the first object and the width of the first trajectory satisfy a second condition. The height of the second object and the height of the second trajectory satisfy a third condition, and / or, the width of the second object and the width of the second trajectory satisfy a fourth condition.

[0094] The condition that the height of the first object and the height of the first trajectory satisfy the first condition means that the height of the first object and the height of the first trajectory are related. For example, the maximum height of the first object is the same as the maximum height of the first trajectory. Another example is that the maximum height of the first object is the product of the maximum height of the first trajectory and the coefficient N1. Yet another example is that the maximum height of the first object and the maximum height of the first trajectory satisfy other functions. The maximum height of the first trajectory refers to the distance between the top and bottom points of the first trajectory in the height direction of the image generation interface. The maximum height of the first object indicates the distance between the top and bottom points of the first object in the height direction of the image display interface.

[0095] The width of the first object and the width of the first trajectory satisfy the second condition, meaning that the width of the first object and the width of the first trajectory are related. For example, the maximum width of the first object is the same as the maximum width of the first trajectory. Another example is that the maximum width of the first object is the product of the maximum width of the first trajectory and the coefficient N². Yet another example is that the maximum width of the first object and the maximum width of the first trajectory satisfy other functions. The maximum width of the first trajectory refers to the distance between the top and bottom points of the first trajectory in the width direction of the image generation interface. The maximum width of the first object indicates the distance between the top and bottom points of the first object in the width direction of the image display interface.

[0096] The height of the second object and the height of the second trajectory satisfy the third condition, similar to the condition that the height of the first object and the height of the first trajectory satisfy the first condition, and will not be repeated here. The width of the second object and the width of the second trajectory satisfy the fourth condition, similar to the condition that the width of the first object and the width of the first trajectory satisfy the second condition, and will not be repeated here.

[0097] Furthermore, the aforementioned conditions can be understood as follows: the height of the input trajectory limits the height of the output object, and / or the width of the input trajectory limits the width of the output object.

[0098] In this embodiment, the size of the first object (including height and / or width) is related to the size of the first trajectory, and the size of the second object is related to the size of the second trajectory, so that the size of the generated first image is related to the size of the first input, which is more in line with the user's usage habits and improves the user experience.

[0099] In some alternative implementations, the primary color of the output object is related to the color of the input trajectory. For example, the primary color of the first object is the same as the color of the first trajectory, and / or, the primary color of the second object is the same as the color of the second trajectory. The primary color of an object refers to the overall color of the object, or the color that occupies most of the area within the object.

[0100] For example, in the embodiment shown in Figure 6, the user-inputted pattern of a hat is pink, and the pattern of the text "dragon" is black. Therefore, in the generated image, the first object (the dragon pattern) is black, and the second object (the hat pattern) is pink.

[0101] In this embodiment, the color of the input trajectory can directly indicate the main color of the corresponding object in the generated image, eliminating the need to set the main color of the corresponding object through other means, thus simplifying the operation process and reducing the complexity of the technical solution.

[0102] It should be noted that after the terminal device displays the first image, that is, after displaying the image generated based on user input, the user can still edit the image again. This includes modifying at least one of the following: the positional relationships, perspective relationships, size, color, or style of objects in the image; no specific limitations are specified here. Style includes 3D style, animation style, ink painting style, etc., but no specific limitations are specified here.

[0103] As explained above, in this embodiment, the AI ​​model generates a first image from the trajectory of the text and the trajectory of the pattern in the first input. This first image includes a first object indicating the semantics of the text and a second object indicating the pattern. In practical applications, simple images can be generated from the trajectory of the pattern input by the user, while complex images can be generated from the trajectory of the text input by the user. Replacing complex pattern trajectories with simple text trajectories reduces the difficulty of drawing for the user, thus reducing the difficulty of image generation.

[0104] The preceding text briefly introduced that input trajectories include text trajectories and pattern trajectories. In practical applications, terminal devices need to recognize user input to determine which trajectories are text trajectories and which are pattern trajectories. Taking the first input as an example, in summary, the terminal device determines multiple input trajectories included in the first input based on the temporal information of the first input. Then, based on the spatial information of the multiple input trajectories, it identifies the input trajectory with a character structure as the first trajectory and identifies the input trajectories other than the first trajectory as the second trajectory.

[0105] The timing information of the first input refers to the writing time of each trajectory included in the first input, including the start time, end time, and duration of each trajectory. During the drawing process, the trajectory input by the user is usually not formed in one stroke, but requires multiple inputs. Each continuously inputted segment of the trajectory is represented as a shape, a line, or a stroke. This means that there are breakpoints between multiple inputs, and only through multiple inputs can a complete meaning be expressed. Therefore, the set of user-input trajectories possesses timing characteristics, or timing attributes. Thus, when the terminal device acquires the input trajectory, it records the timing information of each trajectory segment, thereby determining which trajectories are included in the user-input trajectory set.

[0106] For example, in the embodiment shown in Figure 4, the user draws on a blank canvas over a continuous period of time. The first input trajectory draws a hat shape with the character "dragon" written inside. Based on timing information such as the start time and duration of each input trajectory, the terminal device determines that the set of the first input trajectories includes 11 input trajectories.

[0107] The terminal device can also distinguish between text trajectories and pattern trajectories from multiple input trajectories based on their spatial information. Spatial information refers to the shape characteristics of the trajectories and the relative positional relationships between different trajectories. Regardless of the language, written text has a character structure, while patterns do not. Therefore, based on the spatial information of the input trajectories, the input trajectory with a character structure can be identified as the first trajectory (i.e., the text trajectory), and the input trajectories other than the first trajectory are identified as the second trajectory (i.e., the pattern trajectory).

[0108] For example, in the embodiment shown in Figure 4, the terminal device identifies that the input trajectory set includes 11 trajectories. Based on the spatial information of these 11 trajectories, it identifies 5 of them as being concentrated in one area and having a character structure, which corresponds to the character "dragon". Therefore, the terminal device determines these 5 trajectories as the first trajectory and the other 6 trajectories as the second trajectory.

[0109] Optionally, for input trajectories identified as the first trajectory, the terminal device can add a label to mark these input trajectories as text input. For input trajectories identified as the second trajectory, they can be marked as doodle input.

[0110] In this embodiment, based on the temporal information of the first input, multiple input trajectories included in the first input are determined, that is, which trajectories were input. Then, based on the spatial information of the multiple input trajectories, the trajectories of text and patterns are identified. By utilizing the temporal and spatial dimensions of the input trajectories, the trajectories of text and patterns are accurately identified, improving the accuracy of image generation.

[0111] It can be understood that, in practical applications, the trajectory of the text input by the user may also have ambiguous situations such as typos, which leads to errors in the character structure recognized by the terminal device. In the technical solution of the present application, the terminal device further has a character error correction function. In general, the terminal device may further display a first prompt interface, where the first prompt interface indicates that the character structure of the first trajectory is incorrect. Then, in response to an operation instruction for the first prompt interface, the first trajectory is corrected, and the character structure of the corrected first trajectory is correct.

[0112] The case that the character structure of the first trajectory is incorrect includes that the character indicated by the first trajectory lacks strokes, or has redundant strokes, etc., such that the first trajectory resembles a character but has no character that completely matches it. The complete match means that the character structures are the same. In this scenario, the terminal device displays the first prompt interface to prompt the user to correct the first trajectory.

[0113] For example, please refer to FIG. 7, which is a schematic diagram of an interface provided by an embodiment of the present application. As shown in diagram (A) of FIG. 7, the terminal device determines that the character structure of the first trajectory is incorrect, and displays a first prompt interface 710. In the first prompt interface 710, it not only prompts that the character structure of the first trajectory is incorrect, but also performs automatic error correction. Specifically, the character "dragon" that is closest to the first trajectory is determined, and the user is prompted to confirm whether this character is the character expected to be input by the user. The first prompt interface further includes a control 711 and a control 712. When the user clicks the control 711, the terminal device responds to the operation instruction, and corrects the first trajectory to the trajectory of the character "dragon", thereby implementing character error correction.

[0114] In the embodiment shown in diagram (A) of FIG. 7, the terminal device has an automatic error correction capability, and when determining that the character structure of the first trajectory is wrong, it may automatically determine the first trajectory corresponding to the correct character structure. In practical applications, when the character structure of the first trajectory is wrong, the correction may also be performed in other manners.

[0115] In some optional implementations, when the character structure of the first trajectory is wrong, the terminal device may only display a prompt interface. The user corrects the first trajectory by himself / herself to obtain an input trajectory with a correct character structure. For example, as shown in diagram (B) of FIG. 7, the terminal device determines that the character structure of the first trajectory is incorrect, and displays a prompt interface 720, which is only used to prompt that the character structure of the currently input first trajectory is incorrect. After the prompt interface 720 is displayed for a period of time, it automatically enters an image generation interface, and then the user performs input on the image generation interface to obtain an input trajectory with a correct character structure. The duration for which the prompt interface 720 is displayed may be determined based on the requirements of practical applications, for example, may be set to the millisecond level, the second level, etc., which is not specifically limited herein.

[0116] In this embodiment, the terminal device provides a reminder for a first trajectory with an incorrect character structure and corrects it to obtain a correct first trajectory, thereby making the semantics of the text indicated by the first trajectory accurate and further improving the accuracy of image production.

[0117] After recognizing the trajectory of the text, the terminal device further analyzes the semantics of the text to determine the content of the first instruction input to the AI ​​model. The first instruction is used to instruct the AI ​​model to generate a semantic indication of the text within the first image generation area. The first instruction can also be understood as a prompt input to the AI ​​model. The first image generation area can also be understood as the first painting mask, or the area occupied by the first object. Therefore, this means that after determining the first trajectory, the terminal device also determines the first image generation area and the first instruction based on the first trajectory. The process of determining these two items is explained below. First, the implementation method for determining the first instruction is explained.

[0118] In some optional implementations, the first trajectory includes the trajectories of multiple texts. In this approach, the terminal device needs to determine whether the multiple texts contain phrases to clarify the semantics of the texts. In summary, the terminal device determines the first text and the second text from the multiple texts based on the temporal and spatial information of the trajectories of the multiple texts. Specifically, the temporal information of the first text's trajectory and the temporal information of the second text's trajectory satisfy a fifth condition, and / or, the spatial information of the first text's trajectory and the spatial information of the second text's trajectory satisfy a sixth condition. Then, semantic analysis is performed on the combination of the first text and the second text to obtain a first semantic analysis result. If the first semantic analysis result indicates that the combination of the first text and the second text is a phrase, then the object to be generated by the first instruction includes the object semantically indicated by the phrase, i.e., the first object is determined to include the object semantically indicated by the phrase. If the first semantic analysis result indicates that the combination of the first text and the second text does not belong to a phrase, and the semantics of both the first text and the second text are unambiguous, then the object to be generated by the first instruction includes the object semantically indicated by the first text and the object semantically indicated by the second text, i.e., the first object includes the image of the first text and the image of the second text.

[0119] Herein, that the time sequence information of the trajectory of the first text and the time sequence information of the trajectory of the second text satisfy a fifth condition means that the trajectory of the first text and the trajectory of the second text are continuously written within a period of time, which may be determined according to the interruption interval between the trajectory of the first text and the trajectory of the second text. For example, the interruption interval between the last trajectory in the trajectory of the first text and the first trajectory of the second text is less than or equal to a duration threshold. The duration threshold may be set based on the requirements of practical applications, which is not specifically limited herein. For example, it may be set with reference to the interruption interval of historically input phrases, or set with reference to the user's input habits, etc.

[0120] In addition, that the spatial information of the trajectory of the first text and the spatial information of the trajectory of the second text satisfy a sixth condition means that the trajectory of the first text and the trajectory of the second text are structurally adjacent, which may be determined according to the distance between the trajectory of the first text and the trajectory of the second text. For example, the closest distance between the trajectory of the first text and the trajectory of the second text is less than or equal to a distance threshold, or the center distance between the trajectory of the first text and the trajectory of the second text is less than or equal to the distance threshold. The distance threshold may be set based on the requirements of practical applications, which is not specifically limited herein. For example, it may be set with reference to the distance of historically input phrases, set with reference to the user's input habits, or determined in combination with the size of the image generation interface displayed by the terminal device, etc.

[0121] That the combination of the first text and the second text is a phrase means that the combination of the first text and the second text semantically acts as a whole, with clear semantics and a clearly pointed object. For example, for the text "lao" and the text "hu", although the semantics of the text "hu" points to an animal, the meaning of the text "lao" is unclear. In contrast, the text "laohu" (tiger) has clear semantics, so the combination of the text "lao" and the text "hu" is determined to be a phrase. It can be understood that for a plurality of texts identified as a phrase, the trajectories of the plurality of texts included in the phrase may be marked as a whole, or in other words, marked as one text input.

[0122] For example, please refer to Figure 8, which is a schematic diagram of an interface provided by an embodiment of the present application.

[0123] As shown in Figure 8, the text trajectories in the first trajectory include the trajectories of the text "tai", the text "yang", two texts of "yun" and three texts of "hua". The terminal device determines the first text as the text "tai" and the second text as the text "yang" from the plurality of texts. After semantic analysis, it is determined that the text "taiyang" (sun) is a phrase, then the content of the first instruction includes "draw a sun", or "generate an image of the sun", and other prompt words indicating that the object described by the first target is the sun.

[0124] It should be noted that the example above uses a phrase consisting of two characters, where both the first and second characters are single characters. In practical applications, phrases can include more characters, and the first or second character can contain multiple characters; this is not limited here. For example, the phrase "coconut tree" has three characters.

[0125] Optionally, in practical applications, in schemes where the temporal information of the trajectory of the first text and the temporal information of the trajectory of the second text satisfy the first condition, and / or the spatial information of the trajectory of the first text and the spatial information of the trajectory of the second text satisfy the second condition, the combination of the first text and the second text may not belong to the same phrase. That is, the combination of the first text and the second text cannot constitute a word. In this scheme, the objects of the image indicated by the first instruction are the objects described by the first text and the objects described by the second text, respectively.

[0126] For example, suppose the first text is "woman" and the second text is "man." The combination of the first and second texts is not a single word, and the semantics of both texts are unambiguous. Therefore, the content of the first instruction, "draw a woman and a man respectively," determines that the first image includes images of a woman and an image of a man.

[0127] In some alternative implementations, the semantics of the text may be ambiguous. In this scenario, before generating the first image, the terminal device may also display a candidate word interface, which includes multiple candidate word controls, each used to refine the semantics of the text. The terminal device responds to an operation instruction for a target candidate word control among the multiple candidate word controls, determining that the first object includes the object indicated by the target candidate word control.

[0128] Ambiguity in textual meaning refers to the unclear meaning of the text and the lack of a clearly defined object. This includes situations where the object described by the text does not exist, or where the semantic indication of the text suggests multiple possible objects. For example, in the embodiment shown in Figure 9, the semantics of the text "flower" are unclear, and there are multiple possible objects. After acquiring the trajectory of the text, the terminal device displays a candidate word interface to refine the semantics of the text and obtain an unambiguous object.

[0129] For clarity, the trajectory of the text "flower" shown in Figure 8 is listed separately. Please refer to Figure 9, which is a schematic diagram of the interface provided in an embodiment of this application. That is to say, Figure 9 is only to illustrate the various possibilities of the candidate word interface for ambiguous text and does not constitute a limitation on user input in actual applications.

[0130] As shown in Figure 9, the semantics of the text "flower" are ambiguous. The terminal device displays a candidate word interface, providing multiple candidate words for the user to choose from. Figure 9(A) shows six candidate word controls on the interface, indicating candidate words such as "wildflower," "lotus," "peach blossom," "plum blossom," "carnation," and "tulip," thus refining the semantics of the text "flower." When the user clicks on a candidate word control, the terminal device responds, determining that the first instruction is to draw the image corresponding to that candidate word control. Assuming the user selects the "wildflower" control, the terminal device treats this control as the target candidate word control, determining that the first instruction is "draw wildflower" or other content indicating that the object described by the first object is a wildflower. This determines that the first object includes the image of "wildflower."

[0131] It should be noted that, in this embodiment, the candidate word interface can be displayed in several ways. It can be displayed horizontally as shown in Figure 9(A), or vertically as shown in Figure 9(B). Other display methods that can show multiple candidate word controls include, for example, a circular display. The specific display method is not limited here. Furthermore, the number of candidate words included in the candidate word interface is not limited to the number shown in Figure 9; it can include more or fewer words. Sliding or rotating on the candidate word interface can also change the candidate word controls. The specific display method is not limited here.

[0132] The embodiment shown in Figure 9 illustrates a situation where the text is ambiguous. In practical applications, there are also scenarios where the text is unambiguous. For example, in the embodiment shown in Figure 8, the text "cloud" is semantically unambiguous, indicating a clear object. In this solution, the terminal device directly determines that the content of the first instruction is "draw cloud" or other content indicating that the object described by the first object is a cloud, thus determining that the first object includes the image of "cloud".

[0133] In this embodiment, for scenarios where the text semantics are ambiguous, a candidate word interface can be displayed, showing multiple candidate word controls that refine the text semantics. Responding to an operation instruction for a target candidate word control among these multiple candidate word controls, the text semantics are refined to the semantics indicated by that target candidate word control. In other words, through the candidate word interface, the precise meaning expressed by the text is determined, thereby ensuring that the first object included in the generated first image is an image that meets the user's expectations, further ensuring the accuracy of image generation.

[0134] In some alternative implementations, for ambiguous text, in addition to determining the precise meaning of the text based on the aforementioned candidate word interface, other methods can also be used to determine its meaning. The following uses ambiguous text as an example to illustrate the possible solutions:

[0135] In some optional implementations, the terminal device may display a prompt interface indicating that the meaning of the third text is unclear and requesting the user to supplement it. After a period of time, this prompt interface automatically transitions to an image generation interface, where the user then inputs the trajectory of the fourth text. The combination of the third and fourth texts is unambiguous. For example, if the user previously input the trajectory of the text "flower," and the terminal device, through semantic analysis, determines that the text is semantically ambiguous, it displays a prompt interface reminding the user to modify it. The user then inputs the trajectory of the text "lotus," which, together with the previously input text, forms the phrase "lotus flower." At this point, the terminal device determines that the content of the first instruction is "draw lotus flower" or other content indicating that the object described by the first image is a lotus flower, thus determining that the first image includes the image of a "lotus flower."

[0136] In some optional implementations, the terminal device can display a prompt interface to indicate that the meaning of the third text is unclear and prompt the user to re-enter it. After a period of time, the prompt interface automatically transitions to an image generation interface, where the user re-enters the trajectory of the third and fourth texts. For example, if the user previously entered the trajectory of the text "flower" on a blank canvas, and the terminal device, through semantic analysis, determines that the text is semantically ambiguous, it displays a prompt interface to remind the user to modify it. Then, a blank canvas is displayed, and the user enters the trajectory of the text "lotus" and the trajectory of the text "flower" on the blank canvas, forming the trajectory of the phrase "lotus flower". At this point, the terminal device determines that the content of the first instruction is "draw lotus flower" or other content indicating that the object described by the first image is a lotus flower, thus determining that the first image includes the image of "lotus flower".

[0137] Understandably, in situations where the third text is semantically ambiguous, whether the user continues to input the trajectory of the fourth text, or deletes the trajectory of the third text and then re-enters both the third and fourth text trajectories, can be set based on the needs of the actual application. For example, the position and size of the third text in the image generation interface can be referenced. Taking the embodiment shown in Figure 9 as an example, the text "flower" entered in the image generation interface is located in the middle of the blank canvas, and the text "flower" occupies most of the blank text area, making it difficult to input the trajectory of the fourth text on top of this. In this scenario, it is more in line with the actual application operation for the terminal device to automatically delete the trajectory of the text "flower" and then have the user re-enter the trajectory of the text "lotus".

[0138] In the embodiments of this application, there are multiple processing methods for semantically ambiguous text, which enriches the implementation methods and application scenarios of the technical solution of this application and improves the flexibility of the technical solution.

[0139] The examples in Figures 8 and 9 above illustrate a scheme for defining the content of a first instruction based on the semantics of the text. In practical applications, the color of the text's trajectory can also define the first instruction. Specifically, the terminal device further determines the color of the first trajectory, and the first instruction specifies that the primary color of the first object is the color of the first trajectory.

[0140] For example, assuming the first trajectory "grass" is green, then the content of the first instruction includes "draw green grass", or other content indicating that the first object is green grass. Based on this, the primary color of the first object "grass" is determined to be green.

[0141] For example, assuming the embodiment shown in Figure 8 has the first trajectory "sun" in red and the text trajectory "cloud" in white, then the content of the first instruction could include "draw a red sun and white clouds".

[0142] The previous section introduced the implementation method of determining the first instruction based on the first trajectory. The following section explains the implementation method of determining the first image generation region based on the first trajectory. In summary, the first image generation region is determined based on the height and / or width of the first trajectory. That is, the height of the first image generation region is determined based on the height of the first trajectory, and / or the width of the first image generation region is determined based on the width of the first trajectory.

[0143] The first image generation area can also be understood as the first painting mask, or the area occupied by the first image. The height of the first trajectory can be its maximum height, referring to the distance between the top and bottom points of the first trajectory along the height direction of the image generation interface. Furthermore, the distance between two parallel lines drawn through these two endpoints along the height direction of the image generation interface is the maximum height of the first trajectory. The width of the first trajectory can be its maximum width, referring to the distance between the leftmost and rightmost points of the first trajectory along the width direction of the image generation interface.

[0144] In some alternative implementations, the first image generation region can be defined only in the height direction; that is, the height of the first image generation region is determined based on the height of the first trajectory. For example, the maximum height of the first trajectory is the height of the first image generation region. Another example is that the product of the maximum height of the first trajectory and the coefficient N3 is the height of the first image generation region. Furthermore, the aspect ratio of the first image generation region can be preset, and after determining the height of the first image generation region, the width of the first image generation region can be determined based on the preset aspect ratio.

[0145] In some optional implementations, the first image generation region can be defined only in the width direction; that is, the width of the first image generation region is determined based on the width of the first trajectory. For example, the maximum width of the first trajectory is the width of the first image generation region. Another example is that the product of the maximum width of the first trajectory and the coefficient N4 is the width of the first image generation region. Furthermore, the aspect ratio of the first image generation region can be preset, and after determining the width of the first image generation region, the height of the first image generation region can be determined based on the preset aspect ratio.

[0146] In some optional implementations, the first image generation region is defined in both the height and width directions; that is, the width of the first image generation region is determined based on the height and width of the first trajectory. For example, the maximum height of the first trajectory is the height of the first image generation region, and the maximum width of the first trajectory is the width of the first image generation region. Another example is that the product of the maximum height of the first trajectory and a coefficient N3 is the height of the first image generation region, and the product of the maximum width of the first trajectory and a coefficient N4 is the width of the first image generation region. Here, N3 and N4 may be equal or unequal.

[0147] In addition to the aforementioned implementation methods, the height or width of the first image generation region can also be determined based on other functions related to the height or width of the first trajectory, which are not specifically limited here.

[0148] In this embodiment, the size of the first image generation area is related to the height and / or width of the first trajectory, so that the size of the generated first object is related to the input first trajectory, which is more in line with the user's usage habits and improves the user experience.

[0149] After determining the first instruction, the terminal device generates a first object in the first image generation area based on the first instruction. Similarly, for the trajectory of a pattern input by the user, the terminal device determines a second image generation area and a second instruction, with the second instruction instructing the generation of a second object in the second image generation area. The specific implementation method is similar to the principle of generating images from patterns in traditional technical solutions, and will not be elaborated here.

[0150] For example, suppose that in the embodiment shown in Figure 8, all three texts “flower” are refined to “lotus”. Then, for the refined input, the generated first image includes the semantic indications of the text: a sun, two clouds, and three lotus flowers, as well as the pattern indications: a tree and a river.

[0151] In this context, the center of the first object overlaps with the center of the first image generation region. For example, the center of the "sun" image is the center of the first image generation region determined based on the character "sun." The center of the "cloud" image, which is close to the sun, is the center of the first image generation region determined based on the character "cloud." Similarly, the center of the second image overlaps with the center of the second image generation region.

[0152] In the foregoing embodiments, the generated image based on the trajectory of user-input text includes an object that semantically indicates the text. In practical applications, for the input text trajectory, the object indicating the text can also be generated, that is, the trajectory of the text can be used as the trajectory of a pattern to directly generate the corresponding image. There are several possible implementation methods, which will be described below.

[0153] In some optional implementations, the terminal device determines that the object indicated by the text is text within the text trajectory based on the trajectory of the indicator input by the user. For example, the terminal device obtains a second input from the user, which includes a third, a fourth, and a fifth trajectory. The third trajectory is the trajectory of text, the fourth trajectory is the trajectory of a pattern, and the fifth trajectory is the trajectory of an indicator used to indicate that the object indicated by the text is text within the text trajectory. A second image is generated based on the second input. The second image includes a third object and a fourth object, where the third object is the object indicated by the text, and the fourth object is the object indicated by the pattern.

[0154] The indicator can be set by the user or preset by the system. There are various possibilities for the indicator, such as double quotes, single quotes, parentheses, and book titles. The specific form of the indicator is determined based on the actual application and is not limited here. The terminal device can specify the form of the indicator in the application tutorial or user guide. Furthermore, the indicator can be modified by the user.

[0155] The object of text indication is the text within the text trajectory, meaning that the object of text indication is the text itself, rather than the object of text semantic indication. For example, in the previously illustrated embodiment, the text "sun" semantically indicates the object of the sun as a natural object. The text itself refers to the two characters "sun".

[0156] For example, please refer to Figure 10, which is a schematic diagram of the interface provided in an embodiment of this application. In the embodiment shown in Figure 10, the indicator is represented by double quotation marks. The user's second input includes the trajectory of the text (dragon), the trajectory of the pattern (hat), and the trajectory of the indicator (double quotation marks). The terminal device determines that the object indicated by the text is the word "dragon" based on the trajectory of the indicator. In this scheme, the second image generated by the terminal device is no longer a dragon drawn on a hat as shown in the right figure of Figure 6, but rather the word "dragon" written on a hat. Furthermore, the second image does not include the indicator.

[0157] In this embodiment, the object indicated by the indicator text is the text in the text trajectory, so that the generated image includes the text in the text trajectory, rather than the object indicated by the text semantics. This enriches the implementation methods and application scenarios of the technical solution of this application and improves the flexibility of the technical solution.

[0158] In some optional implementations, the terminal device can also determine that the object indicated by the text is text within a text trajectory by interacting with the user. For example, the terminal device obtains a third input from the user, which includes a sixth trajectory and a seventh trajectory, where the sixth trajectory is the trajectory of text and the seventh trajectory is the trajectory of a pattern. It then obtains a user instruction indicating that the object indicated by the text is text within the text trajectory. Based on the third input and the instruction, a third image is generated, which includes a fifth object and a sixth object, where the fifth object is the object indicated by the text and the sixth object is the object indicated by the pattern.

[0159] There are several possible ways for the terminal device to obtain user instructions, which will be described below. For example, please refer to Figure 11, which is a schematic diagram of the interface provided in an embodiment of this application.

[0160] As shown in Figure 11, the user's third input includes the trajectory of text (dragon) and the trajectory of a pattern (hat). After acquiring these two trajectories, the terminal device displays a selection interface 1100 to prompt the user to select the object to be drawn from the text trajectory. The selection interface 1100 includes controls 1101 and 1102. Control 1101 indicates the text, and control 1102 indicates the pattern. In the scenario where the user clicks control 1101, the terminal device acquires the user's instruction, which indicates that the object indicated by the text is the text in the text trajectory, that is, the object to be drawn from the text trajectory is text. Therefore, the third image generated by the terminal device is no longer a dragon drawn on a hat as shown in the right figure of Figure 6, but rather the word "dragon" written on the hat. In the scenario where the user clicks control 1102, the terminal device determines that the third image includes the semantically indicated object of the text, that is, the third image includes a dragon drawn on a hat.

[0161] The embodiment shown in Figure 11 illustrates how the selection interface is displayed after the user inputs the trajectory of the text and the trajectory of the pattern. In practical applications, this operation can also be performed beforehand. That is, before the user inputs the trajectory, the user is prompted to set whether the object to be drawn by the text trajectory is text or a semantically indicated pattern. The implementation principle is similar to that in Figure 11 and will not be described in detail here.

[0162] In the embodiments of this application, there are multiple ways to determine that the object of the text indication is the text in the text trajectory, which enriches the implementation methods and application scenarios of the technical solution of this application and improves the flexibility of the technical solution.

[0163] It should be noted that the interface diagrams provided in this application are merely examples and do not limit the layout of the actual application interface. In practical applications, the interface may include more or fewer controls, and the layout of the interface may also have various possibilities, which are not limited here.

[0164] Please refer to Figure 12, which is a schematic diagram of the structure of an image generation apparatus provided in an embodiment of this application. As shown in Figure 12, the image generation apparatus 1200 includes an acquisition unit 1201 and a processing unit 1202. Optionally, the image generation apparatus 1200 further includes a display unit 1203.

[0165] In some optional implementations, the acquisition unit 1201 is used to acquire a first input from the user, the first input including a first trajectory and a second trajectory, the first trajectory being a trajectory of text and the second trajectory being a trajectory of a pattern.

[0166] The processing unit 1202 is configured to generate a first image based on a first input. The first image includes a first object and a second object. The first object is an object that is a semantically indicated text, and the second object is an object that is a pattern indicated.

[0167] In some alternative implementations, the positional relationship between the first object and the second object is consistent with the positional relationship between the first trajectory and the second trajectory.

[0168] In some alternative implementations, the perspective relationship between the first object and the second object is consistent with the perspective relationship between the first trajectory and the second trajectory.

[0169] In some alternative implementations, the first input is a one-time input by the user within a continuous period of time.

[0170] In some optional embodiments, the processing unit 1202 is further configured to:

[0171] Based on the timing information of the first input, determine the multiple input trajectories included in the first input.

[0172] Based on the spatial information of multiple input trajectories, the input trajectory with a character structure is determined as the first trajectory from the multiple input trajectories, and the input trajectory other than the first trajectory is determined as the second trajectory from the multiple input trajectories.

[0173] In some alternative embodiments, the image generating apparatus 1200 further includes a display unit 1203.

[0174] Display unit 1203 is used to display a first prompt interface, which indicates that the character structure of the first trajectory is incorrect.

[0175] The processing unit 1202 is also used to respond to the operation command for the first prompt interface, correct the first trajectory, and the character structure of the corrected first trajectory is correct.

[0176] In some alternative embodiments, the image generating apparatus 1200 further includes a display unit 1203.

[0177] The display unit 1203 is used to display a candidate word interface if the semantics of the text are ambiguous. The candidate word interface includes multiple candidate word controls, each of which is used to refine the semantics of the text.

[0178] The processing unit 1202 is further configured to respond to an operation instruction for a target candidate word control among a plurality of candidate word controls, and determine that the first object includes the object indicated by the target candidate word control.

[0179] In some alternative implementations, the height of the first object and the height of the first trajectory satisfy a first condition, and / or the width of the first object and the width of the first trajectory satisfy a second condition.

[0180] The height of the second object and the height of the second trajectory satisfy the third condition, and / or the width of the second object and the width of the second trajectory satisfy the fourth condition.

[0181] In some alternative implementations, the primary color of the first object is the same as the color of the first trajectory, and / or, the primary color of the second object is the same as the color of the second trajectory.

[0182] In some optional implementations, the acquisition unit 1201 is also used to acquire a second input from the user. The second input includes a third trajectory, a fourth trajectory, and a fifth trajectory. The third trajectory is a text trajectory, the fourth trajectory is a pattern trajectory, and the fifth trajectory is an indicator trajectory. The indicator is used to indicate that the object indicated by the text is the text in the text trajectory.

[0183] The processing unit 1202 is further configured to generate a second image based on the second input. The second image includes a third object and a fourth object, wherein the third object is an object indicated by text and the fourth object is an object indicated by a pattern.

[0184] In some optional implementations, the acquisition unit 1201 is further configured to:

[0185] Obtain the user's third input, which includes a sixth trajectory and a seventh trajectory. The sixth trajectory is the trajectory of text, and the seventh trajectory is the trajectory of a pattern.

[0186] Obtain the user's instructions; the instructions are text within a text track.

[0187] The processing unit 1202 is also configured to generate a third image based on the third input and the instruction. The third image includes a fifth object and a sixth object, wherein the fifth object is a text-indicated object and the sixth object is a pattern-indicated object.

[0188] The image generation apparatus 1200 is used to implement the image generation method provided in the embodiments of this application, as detailed above, and will not be repeated here.

[0189] Please refer to Figure 13, which is a schematic diagram of the structure of an image generation device provided in an embodiment of this application. The image generation device 1300 includes a processor 1301, a memory 1302, a communication interface 1303, and a bus 1304.

[0190] The processor 1301, memory 1302, and communication interface 1303 communicate via bus 1304, or via other means such as wireless transmission. The memory 1302 stores program code, and the processor 1301 can call the program code stored in the memory 1302 to implement the image generation method provided in this application embodiment, which will not be described in detail here.

[0191] It should be understood that in the embodiments of this application, the processor 1301 may be a CPU, or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0192] The memory 1302 may include read-only memory and random access memory, and provides instructions and data to the processor 1301. The memory 1302 may also include non-volatile random access memory. For example, the memory 1302 may also store device type information.

[0193] The memory 1302 can be volatile memory or non-volatile memory, or it can include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0194] In addition to the data bus, bus 1304 can also include a power bus, control bus, and status signal bus. However, for clarity, all buses are labeled as bus 1304 in the diagram. Bus 1340 can be a Peripheral Component Interconnect Express (PCIe) bus, an Extended Industry Standard Architecture (EISA) bus, a unified bus (Ubus or UB), a Compute Express Link (CXL) bus, a Cache Coherent Interconnect for Accelerators (CCIX) bus, etc. Bus 1304 can be divided into address bus, data bus, control bus, etc.

[0195] The image generation device 1300 may also include one or more communication interfaces and one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0196] In some optional implementations, the execution device or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip to execute the image generation method provided in this application embodiment.

[0197] Please refer to Figure 14, which illustrates an embodiment of the chip in this application. This chip can be represented as a neural network processor 1400. The neural network processor 1400 is mounted as a coprocessor on the main CPU, and tasks are assigned by the host CPU. The core of the neural network processor 1400 is the arithmetic circuit 1403. The controller 1404 can control the arithmetic circuit 1403 to extract data from the weight memory 1402 or the input memory 1401 and perform calculations.

[0198] In some implementations, the arithmetic circuit 1403 internally includes multiple process engines (PEs). In some implementations, the arithmetic circuit 1403 can be a two-dimensional pulsating array. The arithmetic circuit 1403 can also be a one-dimensional pulsating array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1403 is a general-purpose matrix processor.

[0199] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1402 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1401 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 1408.

[0200] Unified memory 1406 is used to store input and output data. Weight data is directly transferred to weight memory 1402 via direct memory access controller (DMAC) 1405. Input data is also transferred to unified memory 1406 via DMAC.

[0201] The bus interface unit 1410 (BIU) is used to enable interaction between the main CPU, DMAC, and instruction fetch buffer 1409 (IFB) via a bus. The instruction fetch buffer 1409 is used to store instructions used by the controller 1404.

[0202] The vector computation unit 1407 includes multiple arithmetic processing units that further process the output of the computation circuit as needed, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computations in non-convolutional / fully connected layers of neural networks, such as pixel-level summation and upsampling of feature planes.

[0203] In the aforementioned embodiments, the operations involving neural network layers in determining the trajectory of text and the trajectory of patterns, and generating the corresponding image of the input, can be performed by the arithmetic circuit 1403 or the vector calculation unit 1407.

[0204] The processor mentioned above can be a central processing unit, a microprocessor, or one or more integrated circuits used to control the execution of a program in the first aspect of the method.

[0205] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0206] In some optional implementations, this application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computer device, the at least one computer device performs the image generation method described above.

[0207] In some optional embodiments, this application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform the image generation method described above.

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

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

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

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

[0212] 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, server, 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.

Claims

1. An image generation method, characterized in that, include: Obtain the user's first input, which includes a first trajectory and a second trajectory, wherein the first trajectory is the trajectory of text and the second trajectory is the trajectory of a pattern; A first image is generated based on the first input. The first image includes a first object and a second object. The first object is the semantically indicated object of the text, and the second object is the object indicated by the pattern.

2. The method according to claim 1, characterized in that, The positional relationship between the first object and the second object is consistent with the positional relationship between the first trajectory and the second trajectory.

3. The method according to claim 1 or 2, characterized in that, The perspective relationship between the first object and the second object is consistent with the perspective relationship between the first trajectory and the second trajectory; or, The perspective relationship between the first object and the second object is related to the order in which the first trajectory and the second trajectory are input.

4. The method according to any one of claims 1 to 3, characterized in that, The first input is a one-time input from the user.

5. The method according to any one of claims 1 to 4, characterized in that, After obtaining the user's first input, the method further includes: Based on the timing information of the first input, determine the multiple input trajectories included in the first input; Based on the spatial information of the multiple input trajectories, the input trajectory with a character structure is determined as the first trajectory from the multiple input trajectories, and the input trajectory other than the first trajectory from the multiple input trajectories is determined as the second trajectory.

6. The method according to claim 5, characterized in that, The method further includes: The first prompt interface is displayed, indicating that the character structure of the first trajectory is incorrect; In response to the operation command for the first prompt interface, the first trajectory is corrected, and the character structure of the corrected first trajectory is correct.

7. The method according to any one of claims 1 to 6, characterized in that, Before generating the first image based on the first input, the method further includes: If the semantics of the text are ambiguous, a candidate word interface is displayed. The candidate word interface includes multiple candidate word controls, each of which is used to refine the semantics of the text. In response to an operation instruction for a target candidate word control among the plurality of candidate word controls, it is determined that the first object includes the object indicated by the target candidate word control.

8. The method according to any one of claims 1 to 7, characterized in that, The height of the first object and the height of the first trajectory satisfy a first condition, and / or the width of the first object and the width of the first trajectory satisfy a second condition; The height of the second object and the height of the second trajectory satisfy a third condition, and / or the width of the second object and the width of the second trajectory satisfy a fourth condition.

9. The method according to any one of claims 1 to 8, characterized in that, The primary color of the first object is the same as the color of the first trajectory, and / or the primary color of the second object is the same as the color of the second trajectory.

10. The method according to any one of claims 1 to 9, characterized in that, The method further includes: Obtain the user's second input, which includes a third trajectory, a fourth trajectory, and a fifth trajectory. The third trajectory is a text trajectory, the fourth trajectory is a pattern trajectory, and the fifth trajectory is an indicator trajectory. The indicator is used to indicate that the object indicated by the text is the text in the text trajectory. A second image is generated based on the second input. The second image includes a third object and a fourth object, wherein the third object is the object indicated by the text, and the fourth object is the object indicated by the pattern.

11. The method according to any one of claims 1 to 9, characterized in that, The method further includes: Obtain the user's third input, which includes a sixth trajectory and a seventh trajectory, wherein the sixth trajectory is the trajectory of text and the seventh trajectory is the trajectory of a pattern; Obtain the user's instruction, wherein the instruction indicates that the object of the text pointer is the text in the text trajectory; A third image is generated based on the third input and the instruction. The third image includes a fifth object and a sixth object, wherein the fifth object is the object indicated by the text and the sixth object is the object indicated by the pattern.

12. An image generation apparatus, characterized in that, include: The acquisition unit is used to acquire the user's first input, which includes a first trajectory and a second trajectory, wherein the first trajectory is the trajectory of text and the second trajectory is the trajectory of a pattern; The processing unit is configured to generate a first image based on the first input, the first image including a first object and a second object, the first object being an object semantically indicated by the text, and the second object being an object indicated by the pattern.

13. The apparatus according to claim 12, characterized in that, The positional relationship between the first object and the second object is consistent with the positional relationship between the first trajectory and the second trajectory; or, The perspective relationship between the first object and the second object is related to the order in which the first trajectory and the second trajectory are input.

14. The apparatus according to claim 12 or 13, characterized in that, The perspective relationship between the first object and the second object is consistent with the perspective relationship between the first trajectory and the second trajectory.

15. The apparatus according to any one of claims 12 to 14, characterized in that, The first input is a one-time input from the user.

16. The apparatus according to any one of claims 12 to 15, characterized in that, The processing unit is further configured to: Based on the timing information of the first input, determine the multiple input trajectories included in the first input; Based on the spatial information of the multiple input trajectories, the input trajectory with a character structure is determined as the first trajectory from the multiple input trajectories, and the input trajectory other than the first trajectory from the multiple input trajectories is determined as the second trajectory.

17. The apparatus according to claim 16, characterized in that, The device also includes a display unit: The display unit is used to display a first prompt interface, which indicates that the character structure of the first trajectory is incorrect. The processing unit is further configured to respond to operation instructions for the first prompt interface, correct the first trajectory, and ensure that the character structure of the corrected first trajectory is correct.

18. The apparatus according to any one of claims 12 to 17, characterized in that, The device also includes a display unit: The display unit is used to display a candidate word interface if the semantics of the text are ambiguous. The candidate word interface includes multiple candidate word controls, wherein each candidate word control is used to refine the semantics of the text. The processing unit is further configured to respond to an operation instruction for a target candidate word control among the plurality of candidate word controls, and determine that the first object includes the object indicated by the target candidate word control.

19. The apparatus according to any one of claims 12 to 18, characterized in that, The height of the first object and the height of the first trajectory satisfy a first condition, and / or the width of the first object and the width of the first trajectory satisfy a second condition; The height of the second object and the height of the second trajectory satisfy a third condition, and / or the width of the second object and the width of the second trajectory satisfy a fourth condition.

20. The apparatus according to any one of claims 12 to 19, characterized in that, The primary color of the first object is the same as the color of the first trajectory, and / or the primary color of the second object is the same as the color of the second trajectory.

21. The apparatus according to any one of claims 12 to 20, characterized in that, The acquisition unit is further configured to acquire a second input from the user, the second input including a third trajectory, a fourth trajectory and a fifth trajectory, the third trajectory being a text trajectory, the fourth trajectory being a pattern trajectory, and the fifth trajectory being an indicator trajectory, the indicator being used to indicate that the object indicated by the text is the text in the text trajectory; The processing unit is further configured to generate a second image based on the second input, the second image including a third object and a fourth object, the third object being the object indicated by the text, and the fourth object being the object indicated by the pattern.

22. The apparatus according to any one of claims 12 to 20, characterized in that, The acquisition unit is further configured to: Obtain the user's third input, which includes a sixth trajectory and a seventh trajectory, wherein the sixth trajectory is the trajectory of text and the seventh trajectory is the trajectory of a pattern; Obtain the user's instruction, wherein the instruction indicates that the object of the text pointer is the text in the text trajectory; The processing unit is further configured to generate a third image based on the third input and the instruction, the third image including a fifth object and a sixth object, the fifth object being the object indicated by the text, and the sixth object being the object indicated by the pattern.

23. An image generation device, characterized in that, Includes a processor, which is coupled to a memory; The memory stores instructions that, when executed on the processor, cause the communication device to perform the method of any one of claims 1 to 11.

24. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a processor, cause the method of any one of claims 1 to 11 to be implemented.

25. A computer program product, characterized in that, When the computer program product is executed on a computer, the method of any one of claims 1 to 11 is implemented.