Image generation method and device, program product and storage medium

By displaying pattern patterns and preset arrangement methods on the user's page, obtaining the target patterns and arrangement methods specified by the user, generating matching pattern images, solving the complexity of pattern design in the existing technology, and achieving rapid generation of personalized patterns The effect of the image.

CN118941656AInactive Publication Date: 2024-11-12DIVINE VISION (SHENZHEN) CULTURE TECH CO LTD

Patent Information

Application Number
CN202410825871.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-11-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, pattern designers need to operate complex image editing tools, which leads to cumbersome process of designing pattern images, which brings inconvenience to users.

Method used

By displaying pattern patterns and preset layout methods on the user's page, obtaining the target pattern and layout methods specified by the user, generating matching pattern images, disassembly and generate them into both layout methods and pattern patterns, and displaying and Provided to the user to specify, simplify operations to quickly generate personalized pattern images.

Benefits of technology

It significantly reduces user operations, helps users quickly generate personalized pattern images, and improves design efficiency and creativity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941656A_ABST
    Figure CN118941656A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image generation method and device, a program product and a storage medium. According to one embodiment of the invention, the method comprises the following steps: displaying at least one preset arrangement mode of a pattern and at least one preset pattern of the pattern in a user page; obtaining a target arrangement mode and a target pattern specified by a user; generating a pattern image containing a target pattern, wherein the target pattern is arranged according to the target arrangement mode; wherein the pattern of the target pattern is matched with the target pattern. According to the embodiment of the invention, a user can be helped to quickly generate a personalized pattern image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image generation method, device, program product and storage medium. Background Art

[0002] A pattern is a decorative design that usually consists of repeated geometric shapes, natural forms, cultural symbols or other elements. Patterns are widely used in art, architecture, textiles, ceramics, metal crafts, prints and many other fields. In different cultures and historical periods, there are patterns with different forms and styles. At present, in the fields of design, pattern designers usually use image editing tools to design pattern images. This way of creating pattern images requires designers to operate image editing tools to draw patterns. The drawing process requires cumbersome operations and requires designers to have relevant knowledge of patterns, which brings more inconvenience to users. Summary of the invention

[0003] To overcome the problems existing in the related art, this specification provides an image generation method, device, program product and storage medium.

[0004] According to a first aspect of an embodiment of this specification, there is provided an image generation method, the method comprising:

[0005] Displaying at least one pattern and at least one preset arrangement mode on the user page;

[0006] Obtain the target pattern and target arrangement specified by the user;

[0007] A pattern image is generated, which includes a target pattern and the target pattern is arranged according to the target arrangement mode; wherein the target pattern matches the target pattern pattern.

[0008] According to a second aspect of an embodiment of this specification, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method embodiment described in the first aspect are implemented.

[0009] According to a third aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method embodiment described in the first aspect are implemented.

[0010] According to a fourth aspect of the embodiments of this specification, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method embodiment described in the first aspect are implemented.

[0011] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0012] In the embodiment of the specification, at least one pattern, at least one preset arrangement mode, and at least one preset style are displayed in the user page; the target pattern and the target arrangement mode specified by the user are obtained; a pattern image containing the target pattern and arranged in accordance with the target arrangement mode is generated; wherein the target pattern matches the target pattern. In the embodiment, the generation of the pattern image is creatively decomposed into two, the arrangement mode and the pattern pattern, and by displaying the two and providing the user with the function of specifying the two, the user can quickly obtain the pattern image through a simple specifying operation, thereby significantly reducing the user operation and helping the user to quickly generate a personalized pattern image.

[0013] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 is a flowchart of an image generating method according to an exemplary embodiment of the present specification.

[0015] Figure 2 It is an application scenario diagram of an image generation method shown in this specification according to an exemplary embodiment.

[0016] Figure 3A It is a schematic diagram of a user page shown in this specification according to an exemplary embodiment.

[0017] Figure 3B It is a schematic diagram of a custom arrangement method shown in this specification according to an exemplary embodiment.

[0018] Figure 3C It is a schematic diagram of a pattern according to an exemplary embodiment of the present specification.

[0019] Figure 3D It is a schematic diagram of importing a custom pattern according to an exemplary embodiment of this specification.

[0020] Figure 3E It is a schematic diagram of a pattern image shown in this specification according to an exemplary embodiment.

[0021] Figure 4 It is a hardware structure diagram of a computer device where an image generating device is located according to an exemplary embodiment of this specification. DETAILED DESCRIPTION

[0022] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.

[0023] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0024] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0025] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0026] In order to help users quickly generate personalized pattern images, this embodiment provides an image generation method, such as Figure 1 As shown, Figure 1 is a flowchart of an image generation method according to an exemplary embodiment of the present specification, which may include the following steps:

[0027] In step 102, at least one pattern and at least one preset arrangement are displayed on the user page.

[0028] In step 104, a target pattern and a target arrangement mode specified by a user are obtained.

[0029] In step 106, a pattern image is generated which includes a target pattern and the target pattern is arranged in a target arrangement manner.

[0030] Among them, the target pattern matches the target pattern pattern.

[0031] As an example, see Figure 2 , Figure 2 A schematic diagram of an application scenario provided for an embodiment of the present specification, wherein the interactive system includes a server and at least one client. Exemplarily, the client can access the server through a network to use services provided by the server, including but not limited to image design services, image generation services, or image download services, etc.

[0032] The server side can be a program installed in a background device to provide services to users. Exemplarily, as shown in the figure, the background device can be a server, which can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0033] The client may be a program installed in a user device to provide services to the user, and the client 200 includes but is not limited to an application APP, a web page, a small program, a plug-in or a component, etc. As shown in the figure, the user device includes but is not limited to a smart phone, a personal digital assistant, a tablet computer, a personal computer, a laptop computer, a virtual reality terminal device, an augmented reality terminal device, etc.

[0034] The image generation method provided in the embodiments of this specification can be executed by either the server or the client, or by the cooperation of the two (each of which executes a part of the steps), and this embodiment does not impose any restrictions on this. Taking the client execution as an example, the client can execute all the steps in the aforementioned image generation method embodiment to generate a pattern image; or, the image generation method can be implemented jointly by the client and the server. For example, after the client executes steps 102 and 104, it sends the acquired data to the server, and the server generates a pattern image and sends it to the client. In actual applications, the execution subject of each step in the image generation method of this embodiment can be flexibly set as needed, and this embodiment does not limit this.

[0035] As an example, considering the characteristics of pattern images, this embodiment decomposes the generation of pattern images into two parts: arrangement method and pattern pattern. Users can quickly obtain pattern images through simple specified operations, thereby significantly reducing user operations and helping users quickly generate personalized pattern images.

[0036] As an example, the arrangement mode can be the layout and distribution of fingerprint patterns in the image, which can be regular, symmetrical, free, irregular, etc. For example, patterns can be arranged in a flat pattern to form a repeated pattern; or arranged in a staggered order to form a more dynamic and random effect; or it can be a multi-pattern arrangement, that is, a combination of two or more different patterns. And so on.

[0037] As an example, a pattern may refer to the specific shapes, lines and elements that constitute the pattern, which may be geometric figures, natural forms (such as flowers, animals), cultural symbols or other abstract designs. A pattern is a basic element in a pattern image, and a pattern image may contain at least one pattern.

[0038] In some other examples, at least one preset style may also be displayed in the user page. The method may also include: obtaining a target style specified by the user; wherein the target pattern conforms to the target style.

[0039] As an example, the style can be a fingerprint style, or it can be the use of visual elements such as color, texture, and brushstrokes based on the pattern; for example, it can include the original style that maintains the original, unmodified appearance of the pattern, or it can include other styles involving specific color processing, texture effects or artistic techniques, such as tie-dye style, watercolor style or dark pattern style, etc., to meet different design needs and aesthetic preferences. For a pattern, choosing different styles can correspond to different pattern images.

[0040] In this embodiment, the generation of pattern images can be further broken down into styles, that is, the pattern patterns can be stylized, and one pattern pattern can be converted into multiple different styles. A style selection function can be provided to users in the user page, so that users can specify the required style, so that one pattern pattern can be derived into pattern images of different styles, which can help users generate diverse pattern images.

[0041] As an example, the user page used to display a preset arrangement, a preset pattern or a preset style in step 102 may be one or multiple (at least two), that is, one user page may be used to display the arrangement scheme, pattern and style at the same time, or at least two pages may be used to display the three. This embodiment does not limit this.

[0042] As an example, a plurality of preset arrangement modes, a plurality of preset patterns, and a plurality of preset styles may be prepared in advance to be displayed on the user page and provided for selection by the user.

[0043] For step 104, the target pattern and target arrangement specified by the user can be obtained in a variety of ways. As other examples, the target style specified by the user can also be obtained as needed. These three different data can be obtained at the same time, or there can be a certain order, which is not limited in this embodiment. As an example, one or more user interfaces of the client may provide interactive elements corresponding to each of the three data, so that the user can use these interactive elements to specify the corresponding data. The interactive elements of this embodiment may refer to page components that can interact with the user on the user page. The interactive elements allow the user to perform operations, obtain information or interact with the content, including but not limited to radio buttons, check boxes, drop-down menus, sliders, text boxes or buttons, etc.

[0044] As an example, one or more of the following types of interactive elements may be provided in one or more user pages:

[0045] Display one or more preset layout modes and layout interaction elements for users to select a layout mode;

[0046] A pattern interaction element that displays one or more preset patterns and a pattern for the user to select a pattern;

[0047] A style interaction element that displays one or more preset styles and allows users to select a style.

[0048] like Figure 3A As shown, it is a schematic diagram of a user page shown in this specification according to an exemplary embodiment. In the figure, one user page providing the above three types of interactive elements at the same time is taken as an example. Of course, in actual applications, these three types of interactive elements can also be displayed separately through different user pages.

[0049] Figure 3A In the example, the arrangement of interactive elements can display a variety of preset arrangement methods; as an example, the preset arrangement methods can include the two types of arrangement methods shown in the figure: a single-pattern arrangement method and a multi-pattern arrangement method, the single-pattern arrangement method represents the arrangement method of a single pattern, and the multi-pattern arrangement method represents the arrangement method of at least two patterns.

[0050] As an example, the preset arrangement can be as follows Figure 3AIn the display method shown in the figure, a circle can be used to represent a pattern, and multiple circles can be arranged in a rectangle to represent the arrangement of the pattern; in actual applications, other shapes can be used to represent patterns and other methods can be used to represent the preset arrangement, which is not limited in this embodiment. For the convenience of illustration, three different single pattern arrangement methods are shown in the figure, for example, an arrangement method representing a pattern laid flat in an image, an arrangement method representing a pattern in a staggered order in an image, and an arrangement method representing the same pattern in an image arranged in different sizes.

[0051] A preset arrangement of multiple patterns refers to an arrangement of at least two different patterns. The figure shows two different arrangements, i.e., two different patterns (represented by a black circle and a blue circle respectively in the figure) are arranged in an image in contrasting arrangements of different sizes. In actual applications, other arrangements can be displayed as needed, and this embodiment does not limit this.

[0052] As an example, an arrangement interaction element may be provided in the user page, and the arrangement interaction element may include a first selection element for the user to select an arrangement mode and a second selection element for the user to select an arrangement density. The target arrangement mode may be determined based on the arrangement mode selected by the user through the first selection element and the arrangement density selected by the user through the second selection element.

[0053] Based on this, the user can be allowed to customize the desired arrangement through two selection elements. The first selection element allows the user to select a preset arrangement, and the user selection function can be implemented by checking options, and the user can select a certain arrangement as the target arrangement by checking options. In actual applications, other interactive elements can also be used, and this embodiment does not limit this.

[0054] The second selection element allows the user to select the arrangement density of the pattern. The arrangement density can affect the density of the pattern in the final generated pattern image, and may include options such as sparse, moderate, and dense. The user can adjust the distribution density of the pattern in the image according to his or her preferences. The arrangement density represents the number of patterns in the pattern image to be generated. The higher the number, the higher the pattern density. A variety of implementation methods can be used to allow users to select the arrangement density of the pattern. As an example, the second selection element can use interactive elements such as a slider, and other interactive elements can be set as needed in actual applications. This is not limited in this embodiment.

[0055] Based on this, the user can select the arrangement mode and arrangement density respectively through the above two selection elements to determine the final arrangement mode, that is, combine the arrangement mode and arrangement density selected by the user to form the target arrangement mode required by the user.

[0056] As an example, a pattern interaction element may be provided in the user page, and the pattern interaction element may display a variety of preset patterns, such as Figure 3A The various types of patterns shown in the embodiment include patterns of various types of patterns, such as Baoxiang pattern, Huagai pattern, Twisted branch pattern, Dunhuang flower and grass pattern, or linked bead and animal pattern, etc. In actual applications, other patterns can also be displayed, which is not limited in this embodiment. As an example, the pattern interaction element can include a check option to implement a user selection function, and the user can select a certain pattern as the target pattern by checking the option. In actual applications, other interactive elements can also be used, which is not limited in this embodiment.

[0057] As an example, different types of patterns can have many different patterns; Figure 3C As shown in the figure, the user can click the drop-down option to display more patterns under the Huagai pattern type, such as the three different patterns of Huagai 1, Huagai 2 and Huagai 3 shown in the figure.

[0058] As an example, the user may select one or more preset patterns as target patterns. This embodiment does not limit the number of target patterns.

[0059] As another example, a user page may also provide a custom layout of interactive elements; the target layout may be obtained in the following manner:

[0060] If it is detected that the custom layout interactive element is triggered, after displaying the preset drawing page, obtaining the position information and size information of each pattern representing at least one pattern drawn by the user in the preset drawing page in the image;

[0061] The target arrangement mode is determined based on the position and size information of each pattern in the image.

[0062] As an example, a custom layout of interactive elements could be Figure 3A The "Paint Arrangement" check option shown in the figure is used as an entry to trigger the user to customize the arrangement mode; in other examples, it can also be other interactive elements such as clicking a button or selecting a menu option, which is not limited in this embodiment. A preset drawing page for users to customize their design can be provided, such as Figure 3B A blank canvas is shown on which the user can edit a custom layout of the pattern.

[0063] As an example, Figure 3B It is shown that the user draws two blue circles. The size of the canvas can represent the size of the pattern image to be generated. The two blue circles represent two identical pattern patterns. The size and position of the two blue circles represent the arrangement.

[0064] As an example, Figure 3B The figure also shows prompts for users to customize the layout, such as "the four sides are the connection points of the pattern, it is better to draw half of it", "the stroke size affects the final rendering effect" or "the same color is one pattern". A sliding bar for users to select the stroke size can also be provided. By adjusting the stroke size, the size of the circle can be adjusted, that is, the size of the pattern in the image can be adjusted.

[0065] As an example, an option for users to select a brush color may also be provided. As an example, this embodiment uses circles to represent patterns, and circles of different colors represent different patterns. If the user selects a multi-pattern arrangement, the user can draw at least two circles of different colors on the canvas, and can adjust the size of the circles and the position of different circles in the canvas. Based on this, the position information and size information of each pattern drawn by the user in the image can be obtained through the preset drawing page, thereby obtaining the target arrangement. As an example, the user can also click on the right side to modify the drawing, and return to the smear page to redraw. As an example, Figure 3B Taking the smearing arrangement method of a pattern as an example, the user can select the pattern through the pattern interaction elements shown in the user page mentioned in the aforementioned embodiment. For example, taking the user selecting "Baoxiang pattern" as an example, the "Baoxiang pattern" represented by the blue graphic is displayed in the upper right corner of the canvas. Optionally, the canvas also provides pattern interaction elements here, specifically the "Modify" control on the canvas. The user can modify the selected pattern through the "Modify" control in the upper right corner.

[0066] In addition, if the user selects a multi-pattern smearing arrangement mode in the user page mentioned in the above embodiment, a "select pattern" control corresponding to the rose-red circle in the figure can also be provided to allow the user to select the pattern image corresponding to the rose-red circle. Figure 3A In the case where "Baoxiang Hua Pattern" and "Huagai Pattern" are selected, when displaying the canvas, corresponding patterns can be set for the brushes corresponding to the two different patterns, and the above-mentioned "Modify" control or "Select Pattern" control can also be used to provide the user with the function of modifying the pattern or selecting the pattern. The above-mentioned embodiment is only for illustration, and other functions can be flexibly realized as needed in actual applications, which is not limited in this embodiment.

[0067] Therefore, this embodiment can allow users to freely combine different arrangement modes, increase the flexibility and creativity of users when designing pattern images, and allow users to freely combine and arrange patterns to create personalized design works.

[0068] Pattern resources of various patterns can be prepared in advance in various ways; for example, pattern resources of patterns authorized by users can be obtained. Alternatively, they can be generated by AIGC (Artificial Intelligence Generated Content). As an example, at least one type of preset patterns is displayed in the user page, and each type of pattern can include one or more pattern patterns generated by the pattern generation model corresponding to the pattern.

[0069] Among them, the pattern generation model corresponding to each type of pattern can be obtained by training the general image generation model with the pattern pattern samples corresponding to this type of pattern in the following way: obtaining a description text of the pattern pattern sample, the description text is used to describe at least one pattern information in the pattern pattern sample; inputting the description text into the general image generation model, and training the general image generation model with the optimization goal of minimizing the difference between the image generated by the general image generation model and the pattern pattern sample.

[0070] The specific structure of the image generation model of this embodiment can be constructed by itself as needed, and the existing pre-trained image generation model can be improved as needed. Optionally, the image generation model can include the following types of models: Generative Adversarial Networks (GAN) model, flow-based generation model or diffusion model, etc., which is not limited in this embodiment.

[0071] In practical applications, general image generation models can be obtained through various methods to obtain existing models, or they can be built by themselves. As an example, an image generation model can be a model that generates images based on text. General image generation models can be obtained by pre-training with a large amount of data. Pre-trained models are not designed and optimized for specific tasks. In order to adapt pre-trained models to specific application scenarios and task requirements, fine-tuning is required to improve the performance of the model on specific tasks.

[0072] Taking the GAN model as an example, the function of the generator is to receive a latent vector (usually random noise) as input and generate samples similar to the training data. As an example, the description text is input into the image generation model, and the feature extraction network in the image generation model can extract feature vectors from the description text. The feature vectors are then input into the generator, and the generator generates images based on the feature vectors. The goal of the generator is to generate realistic samples based on the feature vectors, so that the discriminator cannot accurately distinguish between the generated samples and the real samples. The generator can be regarded as a generative model that generates new samples similar to the training data by learning the distribution characteristics of the training data.

[0073] The role of the discriminator is to receive samples (which can be real samples or samples generated by the generator) as input and predict the authenticity of the samples. The goal of the discriminator is to classify samples and determine whether the samples are real or generated. The discriminator can be regarded as a discriminative model that learns how to distinguish between real samples and generated samples and provides feedback signals for the generated samples to the generator. For example, the real samples here refer to the aforementioned pattern samples. The discriminator generates feedback signals of samples based on the samples generated by the generator and the pattern samples to the generator.

[0074] The generator and the discriminator compete and collaborate with each other through adversarial training. The goal of the generator is to deceive the discriminator so that the generated samples are closer and closer to the real samples, so that the discriminator cannot accurately distinguish them. The goal of the discriminator is to classify the samples as accurately as possible, making the difference between the real samples and the generated samples more obvious. Through the iterative adversarial training process, the generator and the discriminator continuously adjust their parameters to reach a balance point, and finally the generator can generate realistic samples, while the discriminator cannot accurately distinguish between real and generated samples.

[0075] The adversarial training mechanism between the generator and the discriminator enables GAN to learn the distribution of real data and generate diverse and creative samples. The game process between the generator and the discriminator promotes the learning and improvement of the model, making the generated samples more and more realistic.

[0076] As an example, considering that different types of patterns are quite different, this embodiment designs a corresponding image generation model for each type of pattern. The image generation model for each type of pattern can be obtained by fine-tuning the general image generation model using the pattern pattern samples of this type of pattern. This embodiment does not limit the types of patterns, including but not limited to Baoxiang flower patterns, Huagai patterns, tangled branches patterns, Dunhuang flower and grass patterns, linked beads and animal patterns, tiger patterns, flower and bird patterns or auspicious cloud patterns, etc.; each type of pattern can have different patterns, and the details of the patterns may be different, but they all have similar patterns, colors, shapes or structures, etc. This embodiment can obtain a variety of different pattern samples of each type of pattern for use as training samples for the model. These pattern samples can be obtained in a variety of ways, such as obtaining pattern images through user authorization, obtaining pattern images from existing pattern books through authorization, etc. This embodiment does not limit this.

[0077] In some examples, LoRA can be used to fine-tune the general image generation model; LoRA in this embodiment is a parameter efficiency fine-tuning method. LoRA can freeze the weight parameters of the pre-trained general image generation model and add additional LoRA weight matrices to the general image generation model. Since the number of parameters of these newly added LoRA weight matrices is small, training these newly added parameters can not only reduce the cost of model training, but also obtain similar effects as fine-tuning the full model.

[0078] As an example, this embodiment can obtain a description text of a pattern sample, where the description text is used to describe at least one pattern information in the pattern sample; the description text can be input into a universal image generation model, and the universal image generation model can be trained with the optimization goal of minimizing the difference between the image generated by the universal image generation model and the pattern sample.

[0079] As an example, the pattern information contained in the description text includes but is not limited to the pattern name, the dynasty to which the pattern belongs, the pattern structure, the main shape, the background color, the color of the main shape, etc. The description text contains the pattern information of the pattern, so that the model can learn the pattern knowledge of this type of pattern, and thus can generate a new pattern of this type of pattern based on the learned pattern knowledge.

[0080] As an example, here are some descriptions of some patterns:

[0081] Dunhuang floral pattern: a bouquet of flowers on an orange background with leaves and flowers at the bottom of the painting;

[0082] The pattern of the nest: the main colors are orange, green and yellow, with two ducks decorated in a circle and an orange background;

[0083] Baoxiang pattern: Baoxiang flower pattern, covering, central symmetrical pattern, composed of central rosette and radiating petal shapes, main background colors are dark cyan, light green and orange, white background;

[0084] Twine pattern: A continuous pattern on both sides, consisting of peony flowers and stems and leaves covering and interweaving, with a deep red beige background.

[0085] The description text can be obtained in a variety of ways, such as being pre-marked manually, being obtained from authorized pattern-related books, or being generated through AIGC, thereby reducing manpower and material resources.

[0086] As an example, obtaining the description text of the pattern sample may include:

[0087] The pattern sample and the prompt text are input into a preset image generation text model to obtain the pattern information of the pattern sample generated by the image generation text model under the prompt of the prompt text; wherein the prompt text is used to indicate the type of pattern information that the image generation text model needs to generate.

[0088] In this embodiment, an image-generated text model can be used to generate descriptive text for pattern samples. The image-generated text model in this embodiment can be a pre-trained model based on visually generated text, such as the Blip (Bootstrapping Language-Image Pre-training for Unifified Vision-Language Understanding and Generation) model; this model can realize image-to-text generation, and the model can output text based on the input image.

[0089] Wherein, the prompt text of the present embodiment is an initial text or text fragment provided to the image generation text model, which is intended to stimulate the model to generate corresponding output. Through the prompt text, the image generation text model can be clearly told what task it is expected to perform. In the present embodiment, the prompt text can be used to indicate the type of pattern information required to be generated by the image generation text model, including but not limited to the name of the pattern, the dynasty to which the pattern belongs, the pattern structure, the main shape, the background color, the color of the main shape, etc. In other examples, the prompt text can also include other information, such as the format information of the description text output by the indicating model can also be included, so that the image generation text model generates the description text according to the format information prompted in the prompt text, or, it can also include one or more reference examples for the image generation text model to generate the description text with reference to the reference examples in the prompt text. As an example, different types of patterns can correspond to different prompt texts due to the differences in patterns.

[0090] As an example, taking the Baoxiang pattern as an example, the description text may specifically include:

[0091] Format information: describes the layout and pattern information of the input pattern image. The description information is separated by commas, without breaking lines or paragraphs, and without adding useless explanatory information.

[0092] Pattern information includes: dynasty, elements in the pattern, pattern hierarchy, main shapes in the pattern, and patterns with repeated main colors.

[0093] The dynasty categories include Tang Dynasty, Song Dynasty, Wei and Jin Dynasty, Ming Dynasty or Qing Dynasty, etc. In this embodiment, considering that different cultural and historical periods have different forms and styles of patterns, the dynasty category information contained in the description text of this embodiment can enable the image generation model to learn the artistic style of the patterns of each dynasty or the characteristics of the pattern patterns, etc., which are consistent with the characteristic information or historical knowledge of the dynasty, thereby ensuring that the generated pattern patterns are consistent with the characteristics of the dynasty, and improving the accuracy of the generated pattern patterns.

[0094] The arrangement methods include single mode, double-sided continuation pattern, quadrilateral continuation pattern, etc.; the elements in the pattern include specific pattern names, such as Baoxiang flower, white flower pattern, Hui pattern, cloud pattern, etc., which must adhere to the historical basis and knowledge in the literature.

[0095] Categories of major shapes, including shapes in specific named patterns, such as natural symbols in the shapes of flowers, mountains, water, fruits, vegetables, geometric figures, people, animals, etc. Names of specific animals, fruits, and vegetables.

[0096] As an example, the pattern resources of the patterns obtained through the above-mentioned methods can be stored in a resource library. Due to factors such as the size limitation of the user page, only part of the pattern can be displayed on the user page. The user page can be provided with a function to allow users to import more patterns, so that when the user page only displays part of the pattern, more patterns can be imported from the resource library and displayed on the user page for users to choose.

[0097] In some examples, a custom pattern interaction element may also be provided in the user page, and the target pattern may include a custom pattern imported by the user and received through the custom pattern interaction element.

[0098] As an example, a custom pattern interactive element could be something like Figure 3A The "Import" control shown in FIG. 1 is used as an entry to trigger the user to import a custom pattern, and can display the following Figure 3D In the page shown in, the user can import one or more images as the target pattern. In actual applications, the custom pattern interaction element can also be implemented in other ways, which are not limited in this embodiment. As an example, the target pattern can include a preset pattern (one or more) selected by the user, and / or a custom pattern (one or more) imported by the user. Based on this, this embodiment allows the user to import a custom pattern pattern, so that the user can generate a pattern image using a custom pattern.

[0099] As an example, the user page also provides a style interaction element, which can display a variety of preset styles, such as Figure 3AIn the embodiment of the present invention, there are many different styles shown in the figure, such as original picture, tie-dye, watercolor or dark pattern, etc. In actual application, other styles can also be displayed for user selection, which is not limited in this embodiment. As an example, the style interaction element can include a check option to realize the user selection function, and the user can select a style as the target style by checking the option. In actual application, other interactive elements can also be used, which is not limited in this embodiment.

[0100] In some examples, the preset style may include: an original image style and at least one other style; each other style corresponds to a pattern style generation model;

[0101] If the target style is one of the other styles, the target pattern may be obtained by inputting the target pattern pattern into a pattern style generation model corresponding to the target style, and then converting the target pattern pattern into an image conforming to the target style by the pattern style generation model.

[0102] As an example, the original image style refers to a style that maintains the original, unmodified appearance of the pattern. When the user selects the original image style as the target style, the target pattern specified by the user is not modified, and the pattern image is directly generated based on the target pattern.

[0103] For other styles, as an example, assuming there are n other styles, a corresponding pattern style generation model can be set for each style, that is, there can be n pattern style generation models; after the target pattern is input into the pattern style generation model, the model can convert the target pattern into an image that conforms to the style corresponding to the model.

[0104] For example, assuming there is a pattern style generation model corresponding to the tie-dye style and a pattern style generation model corresponding to the watercolor style, if the target pattern is input into the pattern style generation model corresponding to the tie-dye style, the model can convert the target pattern into a tie-dye style image; if the target pattern is input into the pattern style generation model corresponding to the watercolor style, the model can convert the target pattern into a watercolor grid image.

[0105] As an example, the pattern style generation model corresponding to each other style can be obtained by fine-tuning the general image generation model; images of each style can be prepared as training samples of the model of that style, and the LoRA method can also be used for fine-tuning. As an example, the samples used to train the pattern style generation model are not limited to pattern image samples, and images with a style corresponding to the pattern style generation model can be used. For example, samples of the pattern style generation model corresponding to the tie-dye style can include pattern image samples of the tie-dye style, and can also include image samples of other content in the tie-dye style, such as tie-dye style clothing images, tie-dye style tablecloth images, and other images with tie-dye style.

[0106] In some examples, various style images of a default pattern can be displayed in the user page for the user to select a style. The default pattern can be any one of the aforementioned multiple preset patterns. In practical applications, there can be many preset patterns prepared in advance, and various styles of images corresponding to each preset pattern can be prepared in advance. For example, there are m preset patterns and n+1 different styles (original style + n other styles). The original style does not require style conversion of the pattern, so n other style images can be generated for each of the m preset patterns. Alternatively, it is also possible not to generate in advance. After the user specifies the pattern, the user-specified pattern is input into the model corresponding to each of the n other styles, and each other style image of the user-specified pattern is obtained and displayed to the user for the user to select a style. Alternatively, it is also possible that after the user specifies the pattern and specifies the style, the user-specified pattern is input into the model corresponding to the user-specified style to obtain the image of the style corresponding to the specified pattern.

[0107] As an example, Figure 3A As shown in , a "Start Generate" button is provided in the user page. After the user specifies the arrangement mode, pattern pattern and style, the user can click the button; the background can detect that the button is triggered by the user, obtain the arrangement mode, pattern and style specified by the user, and generate a pattern image for the user. The generated pattern image can be displayed in the user page for the user to view, for example Figure 3E As shown in the page, the user page can also provide functions such as downloading, and the user can download the pattern image to the local computer.

[0108] As an example, the model involved in the image generation method of this embodiment can be deployed in the server, for example, Figure 2 In the server connected to the merchant's client, the merchant's client can receive the user's input and send it to the server, and the server runs the image generation method of this embodiment and sends the generated pattern image to the client. In other examples, the model involved in the image generation method of this embodiment can also be deployed in the merchant's client, and this embodiment does not impose any limitation on this.

[0109] As can be seen from the above embodiments, the generation of pattern images is creatively decomposed into two parts, namely, arrangement mode and pattern, and by displaying the two and providing the user with the function of specifying the two, the user can quickly obtain the pattern image through simple specifying operations, thus significantly reducing the user operation and helping the user to quickly generate a personalized pattern image. Optionally, the generation of pattern images can be further decomposed into styles, that is, the pattern pattern can also be stylized, and one pattern pattern can be converted into multiple different styles. A style selection function can be provided to the user in the user page, so that the user can specify the desired style, so that one pattern pattern can derive pattern images of different styles, which can help the user generate a variety of pattern images.

[0110] In this embodiment, advanced AI technology is used to generate pattern images, which can not only efficiently generate high-quality ancient patterns, but also be customized according to user needs. This technological innovation makes the creation and application of ancient patterns more convenient and diversified. The platform allows users to freely combine and arrange patterns from different dynasties, breaking the traditional fixed pattern. Users can flexibly adjust the arrangement and combination of patterns according to their personal preferences and creative needs, thereby realizing personalized artistic design.

[0111] The pattern image generated in this embodiment can have a variety of applications. As an example, a virtual image can be designed based on the pattern image, such as generating clothing accessories for the virtual image based on the pattern image. For example, a virtual image specified by a user can be obtained, and clothing accessories specified by the user to be generated can be obtained. The decorations here include but are not limited to clothes, shoes, headwear or necklaces, hand ornaments, etc., all items worn on the body or used for decoration, so that a virtual image and clothing accessories containing the pattern image can be automatically generated for the user. In other examples, physical product development can be carried out based on the pattern image. For example, users can design clothing, interior decoration or handicrafts based on the pattern image, such as applications in the fields of fabric printing, embroidery, brocade, porcelain, etc.

[0112] Corresponding to the above-mentioned embodiments of the image generating method, this specification also provides embodiments of an image generating apparatus and a computer device used therein.

[0113] The embodiments of the image generation device of this specification can be applied to computer devices, such as servers or terminal devices. The device embodiments can be implemented by software, hardware, or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory and running them. From the hardware level, if Figure 4 The figure is a hardware structure diagram of the computer device where the image generating device of this manual is located, except Figure 4 In addition to the processor 410, network interface 420, memory 430, and non-volatile memory 440 shown, the computer device where the image generating apparatus is located in the embodiment may also include other hardware according to the actual function of the computer device, which will not be described in detail.

[0114] As an example, this specification also provides an image generating device, which may include:

[0115] A display module, used to: display at least one pattern and at least one preset arrangement mode on a user page;

[0116] The acquisition module is used to: acquire the target pattern and target arrangement mode specified by the user;

[0117] An image generation module is used to: generate a pattern image including a target pattern and wherein the target pattern is arranged according to the target arrangement mode; wherein the target pattern matches the target pattern pattern.

[0118] The implementation process of the functions and effects of each module in the above-mentioned image generating device is specifically described in the implementation process of the corresponding steps in the above-mentioned image generating method, which will not be repeated here.

[0119] Accordingly, an embodiment of the present specification also provides a computer program product, including a computer program, which implements the steps of the aforementioned image generation method embodiment when executed by a processor.

[0120] Accordingly, an embodiment of the present specification also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the image generation method embodiment when executing the program.

[0121] Accordingly, an embodiment of the present specification further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the embodiment of the image generating method are implemented.

[0122] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0123] The above embodiments can be applied to one or more computer devices, where the computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. The hardware of the computer device includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0124] The computer device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0125] The computer device may also include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.

[0126] The network where the computer device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0127] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0128] The step division of the above methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the protection scope of this application.

[0129] Although this specification includes many specific implementation details, these should not be interpreted as limiting the scope of any invention or the scope of protection claimed, but are mainly used to describe the features of the specific embodiments of specific inventions. Certain features described in multiple embodiments in this specification may also be implemented in combination in a single embodiment. On the other hand, the various features described in a single embodiment may also be implemented separately in multiple embodiments or in any suitable sub-combination. In addition, although features may work in certain combinations as described above and even initially claim protection, one or more features from the claimed combination may be removed from the combination in some cases, and the claimed combination may point to a sub-combination or a variation of a sub-combination.

[0130] The description of "specific examples" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.

[0131] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention claimed herein. The specification is intended to cover any variations, uses or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not claimed in the specification. The specification and examples are to be considered exemplary only, and the true scope and spirit of the specification are indicated by the following claims.

[0132] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.

[0133] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. A method for generating an image, the method comprising: Displaying at least one pattern and at least one preset arrangement mode on the user page; Obtain the target pattern and target arrangement specified by the user; A pattern image is generated, which includes a target pattern and the target pattern is arranged according to the target arrangement mode; wherein the target pattern matches the target pattern pattern.

2. According to the method of claim 1, the user page also displays at least one preset style; The method further comprises: Acquire a target style specified by a user; wherein the target pattern conforms to the target style.

3. According to the method of claim 1, the user page provides an arrangement interaction element, the arrangement interaction element includes a first selection element for the user to select an arrangement mode and a second selection element for the user to select an arrangement density; The target arrangement is determined based on the arrangement selected by the user through the first selection element and the arrangement density selected by the user through the second selection element.

4. According to the method of claim 1, the at least one preset arrangement displayed in the user page includes: At least one single pattern arrangement, wherein the single pattern arrangement represents an arrangement of a single pattern; and At least one multi-pattern arrangement, wherein the multi-pattern arrangement represents an arrangement of at least two patterns.

5. According to the method of claim 1, the user page provides a custom arrangement of interactive elements; the target arrangement is obtained by: If it is detected that the custom layout interactive element is triggered, after displaying the preset drawing page, obtaining the position information and size information of each pattern representing at least one pattern drawn by the user in the preset drawing page in the image; The target arrangement mode is determined based on the position and size information of each pattern in the image.

6. According to the method of claim 1, at least one type of pattern is displayed in the user page, each type of pattern includes one or more pattern patterns generated by the pattern generation model corresponding to the pattern type, and the pattern generation model corresponding to each type of pattern is obtained by training the general image generation model with the pattern pattern samples corresponding to the pattern type in the following manner: Acquire a description text of the pattern sample, wherein the description text is used to describe at least one pattern information in the pattern sample; The description text is input into the universal image generation model, and the universal image generation model is trained with the optimization goal of minimizing the difference between the image generated by the universal image generation model and the pattern sample.

7. The method according to claim 6, wherein obtaining the description text of the pattern sample comprises: The pattern sample and prompt text are input into a preset image generation text model to obtain the pattern information of the pattern sample generated by the image generation text model under the prompt of the prompt text; wherein the prompt text is used to indicate the type of pattern information that needs to be generated by the image generation text model.

8. The method according to claim 1, wherein a custom pattern interaction element is provided in the user page, and the target pattern comprises a custom pattern imported by the user and received through the custom pattern interaction element.

9. The method according to claim 2, wherein the preset style includes the original image style and at least one other style; each other style corresponds to a pattern style generation model; If the target style is one of the other styles, the target pattern is obtained by inputting the target pattern pattern into a pattern style generation model corresponding to the target style, and the pattern style generation model converts the target pattern pattern into an image that conforms to the target style.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

11. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the methods of claims 1 to 9.

Citation Information

Patent Citations

  • Sichuan embroidery dermatoglyphic pattern design technology based on computer-aided design

    CN106202607A

  • Method for simulating ethnic batik patterns by computer

    CN111368390A

  • Conductive film random grid pattern generating method and application thereof

    WO2021042522A1

Cited By

  • Turga image generation method based on diffusion model

    CN120411281A