AI diffusion model pattern generation platform and generation method

By integrating LoRA, ControlNet, and CLIP algorithms, the AI ​​diffusion model pattern generation platform solves the problems of high fine-tuning costs and insufficient controllability in existing technologies. It achieves low-cost customization of exclusive styles and efficient, controllable pattern generation, which is suitable for design scenarios such as textiles and wallpapers.

CN121120818APending Publication Date: 2025-12-12SHANGHAI UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202511210174.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-27
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing technologies for pattern generation suffer from high fine-tuning costs, insufficient controllability, and lack of technology integration, making it difficult to meet the needs for customization and controllability. In particular, in specific pattern generation scenarios, existing diffusion models are prone to deviations when they require full fine-tuning and rely on text prompts to control the generation results.

Method used

By integrating LoRA low-rank fine-tuning, ControlNet structural condition control, and CLIP similarity evaluation algorithms, an AI diffusion model pattern generation platform is constructed. This platform enables low-cost customization of exclusive styles with a small number of samples and precise control over pattern structure and style. The platform includes a visualization interaction module, an image generation module, and a pattern mapping module. It utilizes LoRA fine-tuning to generate lightweight weights, ControlNet structural control, and CLIP scoring for selection, ultimately generating patterns that meet user needs.

Benefits of technology

It enables low-cost customization of exclusive styles, with a highly controllable generation process, significantly improved design efficiency, support for multi-scenario design needs, and the generated patterns accurately match design requirements and can be directly applied to textiles, wallpapers, and other carriers, reducing the user's operating threshold and improving the controllability of the generated effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120818A_ABST
    Figure CN121120818A_ABST
Patent Text Reader

Abstract

The invention discloses an AI diffusion model pattern generation platform and method, the generation platform comprises a visual interaction module, an image generation module and a pattern mapping module, and the image generation module comprises a training sub-module and a reasoning sub-module; the generation method comprises the following steps: preprocessing a text input by a user and an optional structure image, and outputting standardized data; a semantic embedding vector is generated through text coding; carrying out LoRA fine tuning to obtain a style weight module; a ControlNet structure condition is injected; performing diffusion sampling to generate candidate patterns; performing CLIP scoring to screen an optimal pattern; and outputting the optimal pattern and previewing the carrier map. According to the platform and the method provided by the invention, the LoRA low-rank fine tuning, the ControlNet structure condition control and the CLIP similarity evaluation algorithm are fused, so that the effects of customizing the special style pattern with a small number of samples at low cost and accurately controlling the structure and style of the pattern are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision and graphics, and particularly relates to an AI diffusion model pattern generation platform and a generation method. BACKGROUND

[0002] With the development of generative artificial intelligence technology, diffusion models (such as DDPM and DDIM) have made breakthrough progress in the field of general image generation by virtue of the image generation logic of gradually adding noise and denoising, and can output artistic images with excellent visual effects.

[0003] However, in the specific pattern generation scene, the existing technology still has significant defects and cannot meet the core needs of customization and controllability in the design field. First, if the existing technology needs to adapt the diffusion model to a specific pattern style, it usually needs to perform full-scale fine-tuning on the model (i.e., update all weight parameters of the model). Full-scale fine-tuning not only consumes a large amount of computing resources (such as multiple high-performance GPUs and hundreds of GB of video memory), but also requires users to provide large-scale training samples, which ordinary design users or small and medium-sized teams cannot afford, resulting in extremely low feasibility of model customization for exclusive style patterns. Second, existing diffusion models rely on text prompts (Prompts) to control the generation content, but the ambiguity of text semantics easily leads to deviations between the generated results and expectations: either the pattern structure is out of control, or the details do not meet the design requirements. Some technologies try to introduce reference images to assist generation, but lack precise extraction and injection mechanisms for structural features of reference images, and cannot guarantee the consistency of generated patterns and reference structures.

[0004] In recent years, LoRA technology and ControlNet technology have provided feasible paths for low-cost fine-tuning and structure control. That is, LoRA realizes lightweight fine-tuning by freezing the original model weights and only training a small number of low-rank matrices, and ControlNet fuses structural conditions into the generation process through an additional branch network; at the same time, CLIP scoring can be used to evaluate the matching degree between the generated image and the text / image input, i.e., the matching degree between the pattern and the prompt word, and the input image style. However, the existing technology does not integrate the above three core technologies (LoRA+ControlNet+CLIP) into the pattern generation scene, resulting in the inability to achieve the three of low-cost customized style, precise structure control, and automatic selection of high-quality results simultaneously, and the inability to form a closed-loop pattern design solution.

[0005] In addition, although mainstream commercial generation platforms such as Midjourney and ChatGPT can generate high-quality images, they use closed-source architecture, and users cannot fine-tune the underlying model or inject their own style elements, which greatly limits the customization ability of the model. At the same time, although the platform provides preliminary generation filtering mechanisms, there is still a significant gap in meeting the precise structure control and style filtering required for professional design, resulting in the need for multiple debugging and post-processing before the generated patterns can be put into actual application.

[0006] In summary, the existing technology has obvious shortcomings in the customization, controllability and engineering application of pattern generation, and there is an urgent need for an integrated platform and method that integrates low-rank fine-tuning, structure control and intelligent filtering to solve the low efficiency and uncontrollable effect of pattern design in specific fields. SUMMARY

[0007] In view of the defects of high fine-tuning cost, insufficient controllability and lack of integration of existing technologies in pattern generation, the purpose of the present application is to provide an AI diffusion model pattern generation scheme that integrates LoRA low-rank fine-tuning, ControlNet structure condition control and CLIP similarity evaluation algorithm to achieve low-cost customization of exclusive style patterns with a small amount of samples and precise control of pattern structure and style effects.

[0008] To achieve the above-mentioned purpose, the first aspect of the present application provides an AI diffusion model pattern generation platform, which comprises:

[0009] A visual interaction module for receiving and preprocessing text prompt information and pattern structure image information input by the user through a graphical interface provided by the visual interaction module;

[0010] An image generation module for generating an optimal pattern based on the interaction information provided by the visual interaction module;

[0011] A pattern mapping module for mapping the optimal pattern to a carrier through target detection, edge detection and positive film superposition technology, supporting user parameter adjustment preview and preview image export;

[0012] Wherein:

[0013] The image generation module comprises a training submodule and an inference submodule;

[0014] The training submodule is based on LoRA+Stable Diffusion technology, which inserts a low-rank matrix in the U-Net layer to optimize the matrix learning of exclusive styles with a small amount of samples, and outputs lightweight LoRA weights for the inference submodule to call;

[0015] The inference sub-module generates a candidate pattern by integrating the text vector, the LoRA weight, and the ControlNet structure condition tensor, and sampling through back diffusion, and filters out the optimal pattern through CLIP scoring and transmits the optimal pattern to the pattern mapping module.

[0016] In some embodiments of the first aspect of the application, the inference sub-module comprises a LoRA fine-tuning unit, which is based on a pre-trained model and freezes the original weight matrix W0 of the pre-trained model;

[0017] In the pre-trained model, trainable low-rank matrices A and B are inserted into the key layers to construct a weight increment AW = AxB, so that the actual working weight of the model is the sum of the original weight matrix and the weight increment, that is, W = W0 + AW.

[0018] During training, only the low-rank matrices A and B are gradient optimized to learn the incremental features of specific pattern styles, and after training is completed, a lightweight LoRA weight module is output.

[0019] In some embodiments of the first aspect of the application, the training sub-module comprises a ControlNet structure control unit, a diffusion generation unit, a CLIP scoring screening unit, a style transfer unit, and a parameter automatic optimization unit.

[0020] The ControlNet structure control unit converts the preprocessed structure image into a three-dimensional structure condition feature tensor and superimposes it to the diffusion model feature layer.

[0021] The diffusion generation unit is used to fuse text guidance, LoRA weight, and structure condition, and generate candidate pattern images through back diffusion sampling;

[0022] The CLIP scoring screening unit is used to calculate the semantic similarity of the candidate pattern and the text prompt, and screen the optimal result in combination with the structure matching degree and the visual quality;

[0023] The style transfer unit is used to extract the style features of the preset style or the user reference image, and transfer them to the target pattern through feature fusion;

[0024] The parameter automatic optimization unit is used to monitor the quality indicators of the intermediate generated images in real time during the diffusion sampling process.

[0025] In some embodiments of the first aspect of the application, the diffusion generation unit aligns the text semantics and image features through an attention calculation formula in the cross-attention module of the U-Net network;

[0026] The attention calculation formula is

[0027] Wherein: Q is an image feature, d is a feature dimension, K and V are keys and values of attention calculation respectively, and K=V=E text , the E text is a text semantic embedding vector generated by a CLIP text encoder;

[0028] The diffusion generation unit adds random noise x T to the sampling process step by step in the reverse diffusion sampling process using the forward process calculation formula.

[0029] The forward process calculation formula is

[0030] Wherein: the random noise x T obeys normal distribution, and T is the total number of diffusion steps.

[0031] In some embodiments of the first aspect of the application, the CLIP score screening unit calculates the CLIP similarity by a similarity formula to obtain the CLIP score;

[0032] The similarity formula is

[0033] Wherein: E text is a text semantic embedding vector generated by a CLIP text encoder, and E img is an image semantic embedding vector generated by a CLIP image encoder, the similarity calculation score ranges from 0 to 1, and the higher the CLIP score, the higher the matching degree.

[0034] In some embodiments of the first aspect of the application, the style migration unit is connected with the visualization interaction module and the diffusion generation unit and supports the input of platform preset styles and user customized styles.

[0035] The preset style calls a pre-stored style feature vector for processing, and the user customized style extracts a style feature through a deep learning neural network.

[0036] In the style migration process, the style migration unit adopts a feature fusion method to fuse the style feature with the content feature of the target pattern.

[0037] In some embodiments of the first aspect of the application, the quality indicators include clarity and text matching degree, the diffusion generation unit adjusts the diffusion step number and the text prompt guide coefficient in real time through the parameter automatic optimization unit in the sampling process, increases the diffusion iteration step number automatically if the clarity of the intermediate generated image is low, and increases the text guide coefficient if the text matching degree is low.

[0038] In some embodiments of the first aspect of the application, the pattern mapping module comprises a pattern mapping preview unit and an output unit;

[0039] The pattern mapping preview unit supports the loading of textile, home, stationery and cultural and creative product carriers, and performs pattern mapping according to the surface properties of the carriers when loaded;

[0040] The output unit supports JPG, PNG and TIFF format export.

[0041] To achieve the above-mentioned purpose, the second aspect of the application provides an AI diffusion model pattern generation method, which comprises:

[0042] Step S1: input preprocessing, receiving text prompts and structure images, analyzing text semantics and extracting structure edge features;

[0043] Step S2: text encoding, generating text semantic embedding vectors through a CLIP text encoder;

[0044] Step S3: LoRA fine-tuning, inserting a low-rank matrix to train a style-specific weight;

[0045] Step S4: ControlNet structure condition injection, converting structure features into a conditional tensor and superimposing it on the diffusion model;

[0046] Step S5: diffusion sampling generation, fusing text embedding, LoRA weight and structure condition, and iteratively denoising to generate candidate patterns;

[0047] Step S6: CLIP score screening, calculating semantic similarity and structure matching degree, and screening the optimal pattern;

[0048] Step S7: result output and mapping preview, outputting the optimal pattern image, loading a preset carrier model and mapping the optimal pattern image to the carrier model to generate an application preview image.

[0049] In some embodiments of the second aspect of the application, the step S3 comprises:

[0050] S3.1: pre-trained model loading and weight freezing, loading a pre-trained Stable Diffusion model and freezing its original weight matrix W0;

[0051] S3.2: low-rank matrix insertion, inserting a low-rank matrix at a key layer of the model And Determining the actual working weight of the model W=W0+A×B;

[0052] S3.3: Low-rank matrix training, only gradient optimization is performed on the low-rank matrices A and B using a small number of pattern samples, and the optimization target is that the gradient of the loss function with respect to the original weight W0 is 0;

[0053] S3.4: LoRA weight output and management, output a lightweight LoRA weight module containing only low-rank matrices A and B, and the lightweight LoRA weight module supports dynamic loading, unloading and multi-module mixing.

[0054] In some embodiments of the second aspect of the application, the step S4 comprises:

[0055] S4.1: Structure feature receiving and checking, receiving standardized structure feature data, checking whether the dimensions and resolutions are suitable for the ControlNet branch network, and automatically adjusting if not suitable;

[0056] S4.2: Structure feature conversion, converting the standardized structure feature data into a structure condition feature tensor C through the convolution function G of the ControlNet branch network l l ;

[0057] S4.3: Feature superposition and compatibility processing, superimposing C l and the original feature F l of the corresponding layer of the U-Net to obtain F l ′=F l +C l , and if there is no structure input signal, then C l =0

[0058] In some embodiments of the second aspect of the application, the step S5 comprises:

[0059] S5.1: Multi-source input integration, integrating standardized text semantic data, LoRA weight module and superimposed features to ensure that the data format is suitable for the diffusion model;

[0060] S5.2: Initial noise generation, generating random noise x distributed according to T ;

[0061] S5.3: Reverse diffusion iterative sampling, dynamically adjusting the diffusion step number and the text guide coefficient through the parameter automatic optimization unit during the sampling process;

[0062] S5.4: Candidate pattern output, generating multiple candidate pattern images and passing them to the CLIP scoring screening unit;

[0063] The step S6 specifically comprises:

[0064] ​S6.1: Candidate image and text semantic input integration, receiving candidate pattern image, calling semantic embedding vector E generated in step S2 text ;

[0065] S6.2: CLIP similarity and multi-dimensional index calculation, generating image semantic embedding vector E img and calculating CLIP similarity, while calculating structure matching degree and visual quality index;

[0066] S6.3: Comprehensive score ranking and optimal image screening, calculating comprehensive score according to preset weight, ranking candidate images from high to low according to score, supporting user-defined screening threshold, screening out optimal pattern image and passing to output unit.

[0067] The advantages of the implementation of the present application are as follows:

[0068] First, the customization threshold is low and supports exclusive style generation: the present application uses LoRA fine-tuning mechanism, which only needs to train a small amount of low-rank matrix to make the pre-trained model learn the specific pattern style, greatly reducing the customization cost of exclusive style model, while the existing full-tuning needs thousands of samples and multiple high-performance GPUs, which ordinary users cannot realize. At the same time, the LoRA weight module is small in size and can be saved and loaded dynamically, and users can quickly switch among various exclusive styles without maintaining multiple complete model copies.

[0069] Second, the generation process is highly controllable and accurately matches the design requirements: the present application realizes controllable generation through the dual mechanism of text guidance and structure control, wherein the text guidance ensures that the pattern theme is consistent with the description through CLIP text embedding; the structure control converts the outline sketch provided by the user into a feature tensor through ControlNet, forcing the generated pattern to follow the preset structure. The dual mechanism of the present application can greatly improve the matching degree of pattern structure and avoid the problem of structure out of control.

[0070] Third, full-link integration, design efficiency is significantly improved: the present application integrates input processing, model fine-tuning, diffusion generation, intelligent screening and map preview functions, users do not need to switch between multiple tools, and can complete all operations from creative input to application preview in the same platform. Among them, the CLIP automatic screening and batch generation function can reduce the manual screening workload; at the same time, the parameter automatic optimization unit can avoid user repeated parameter adjustment and trial and error, shorten the single pattern design time.

[0071] Finally, it is practical to land, covering multiple scene design requirements: the application adds a pattern map preview function, supports mapping the generated pattern to a preset carrier such as textiles, wallpaper, and cultural and creative products, and users can intuitively evaluate the effect of the pattern in actual application without the help of professional 3D software; at the same time, the generated pattern image supports high-resolution export and can be directly used for printing, production and other downstream links, bridging the last mile from design to landing, and meeting the actual design and production needs. BRIEF DESCRIPTION OF DRAWINGS

[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0073] Figure 1 The structure diagram of an AI diffusion model pattern generation platform of the present application;

[0074] Figure 2 The flowchart of an AI diffusion model pattern generation method of the present application;

[0075] Figure 3 The platform preset style pattern image interface diagram of the present application;

[0076] Figure 4 The platform preset carrier type image interface diagram of the present application;

[0077] Figure 5 The platform AI generation interface diagram of the present application;

[0078] Figure 6 The structure diagram of the training sub-module of the present application;

[0079] Figure 7 The structure diagram of the reasoning sub-module of the present application;

[0080] Figure 8 The effect comparison diagram of the platform generated folk style pattern and other platform generated effects of the present application. DETAILED DESCRIPTION

[0081] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0082] Figure 1 A schematic diagram of the structure of an AI diffusion model pattern generation platform according to the present invention is shown. Figure 1 As shown, the pattern generation platform includes a visualization interaction module, an image generation module, and a pattern mapping module.

[0083] In this embodiment of the invention, the visualization interaction module enables real-time interaction between the platform's graphical interface and the user. Through this module, users can view the generated results, adjust parameters (such as prompt word weights, sampling steps, and style intensity), and provide feedback for modification. As an interface for both platform input and output, this module is responsible for receiving, parsing, and preprocessing the user's generation requirements, providing standardized input data for subsequent modules. The received information includes text prompts and pattern structure image information.

[0084] This module can be implemented with a web UI, using the Vue.js framework for the front end and Flask for the back end to communicate with the core algorithm module. Figure 5 As shown, through the graphical interface provided by this module, when the user inputs the text prompts "folk style, green and black dog, border composition", and adjusts the prompt word guidance coefficient to 7 and the iteration step to 20, the interface displays the generated result in real time and can preview it.

[0085] In addition, this module also performs format conversion and feature extraction operations on user-provided structural images (such as using edge detection algorithms to convert hand-drawn grass images). Figure Two The algorithm converts data into a clear edge map, removes background noise, and retains core contour features, ultimately outputting structural feature data that can be recognized by the ControlNet structural control unit. Simultaneously, this module can semantically segment text information and tag key descriptive words, providing clear semantic input for subsequent CLIP text encoding. If the user does not provide a structural image, the subsequent generation process is based solely on text prompts.

[0086] In this embodiment of the invention, the image generation module is the core generation engine of the platform, which includes a training submodule and an inference submodule, realizing the entire process from style customization training to pattern inference generation.

[0087] like Figure 6 As shown, the training submodule is based on LoRA+Stable Diffusion technology. By loading a pre-trained Stable Diffusion model and fixing the parameters of AutoEncoder and TextEncoder, a trainable low-rank matrix is ​​inserted only in the cross-attention layer of the U-Net network. The gradient of the low-rank matrix is ​​optimized using a small number of pattern samples, and a lightweight LoRA weight module is output to achieve low-cost customization of the exclusive style.

[0088] In the embodiment of the present application, the training sub-module includes a LoRA fine-tuning unit, which realizes exclusive style low-rank fine-tuning through the LoRA fine-tuning unit and outputs lightweight LoRA weights.

[0089] The LoRA fine-tuning unit is a core module for realizing low-cost customization of user-exclusive pattern styles. The core logic is to perform lightweight adaptation on the pre-trained model, which greatly reduces the training cost and threshold while ensuring the original general generation capability of the model.

[0090] During fine-tuning, the module first loads the pre-trained model and freezes the original weight matrix thereof. The original weight matrix is W0, m is the input feature dimension, and n is the output feature dimension.

[0091] In the embodiment of the present application, the pre-trained model can be Stable Diffusion F.1 basic model, which includes multiple key components and layers. These components are the basis for image generation, but the prior art has not fully utilized their functions in the pattern generation scene and has not deeply integrated with LoRA and ControlNet technologies:

[0092] U-Net: This is the core component of Stable Diffusion, responsible for the denoising process. U-Net contains multiple convolutional layers, attention layers (Attention Layers), and timestep embedding layers. Among them, the attention layer (especially the self-attention mechanism) plays a key role in capturing the global dependencies of the image, which can help the model understand the correlation between different regions of the image, and then generate images with coherent details and reasonable structures. In pattern generation, the denoising process of U-Net directly determines the clarity, detail richness, and overall structural integrity of the pattern, but the prior art has not optimized and adapted the attention layer and convolutional layer of U-Net according to the repetitive regularity and symmetric structure of the pattern.

[0093] VAE (Variational Autoencoder): It includes an encoder and a decoder, which are used to convert images into latent space representations and reconstruct images from latent space. The encoder can compress high-resolution images into low-dimensional latent vectors, reducing computational complexity and capturing the core features of the image; the decoder restores the latent vector to a visual image, which is a key link to realize the transition from abstract features to specific visual presentation. In pattern generation, the encoding quality of VAE directly affects the expression ability of the latent space features, and the decoding process determines the visual restoration degree of the pattern, but the prior art has not optimized the encoding and decoding parameters of VAE according to the texture repetition and color consistency requirements of the pattern.

[0094] CLIP Text Encoder: used to encode text prompts into text embeddings to guide image generation. This component can convert natural language descriptions into vectors that the model can understand, and through cross-attention mechanisms, it can fuse image features with the U-Net to make the generated results match the text description. In pattern generation, the encoding accuracy of the CLIP Text Encoder determines the matching degree of the text prompt and the pattern theme, style, and elements. However, existing technologies only rely on basic text encoding functions and do not optimize the encoding logic with professional terms such as "symmetrical composition", "continuous pattern", and "scroll pattern", which can easily lead to deviations between text semantics and generated patterns.

[0095] wherein two sets of trainable low-rank matrices and are inserted into the cross-attention layer of the U-Net network of the pre-trained Stable Diffusion model (i.e., the projection layer of image-text feature interaction) to construct a weight increment, and by calculating the weight increment ΔW = A × B, the actual working weight of the model is represented as W = W0 + ΔW.

[0096] During the training phase, only the low-rank matrices A and B are optimized for gradients, where the optimization target is the gradient of the loss function L with respect to the original weight W0, i.e. In this way, only a small number of pattern training samples are needed to enable the module to learn the incremental features of a specific style, and the training process can be completed on a consumer-level GPU with about 11 GB of single-card memory.

[0097] After training, the module only outputs the LoRA weight module containing A and B, with a small volume (only tens of MB) and supporting dynamic loading / unloading and multi-module mixing. When used, different style LoRA modules can be quickly switched according to needs; or by setting a mixing coefficient in the range of 0-1, the style features of multiple LoRA modules can be interpolated and fused to generate a composite style pattern. After removing the LoRA module, the model can immediately restore its original general generation capability. This achieves a balance between style customization and model versatility, avoiding the defects of high cost of full-scale fine-tuning and inability to customize styles on commercial platforms in existing technologies.

[0098] As Figure 7As shown, the reasoning submodule is based on the CLIP+U-Net+VAE technology, integrates the text semantic embedding vector output by the visual interaction module, the LoRA weight of the training submodule (if any) and the structure condition tensor of the ControlNet structure control unit, generates initial random noise, and then performs reverse diffusion iterative sampling through the DDIM algorithm. During the sampling process, the parameter automatic optimization unit dynamically adjusts the diffusion step number and the text guide coefficient to generate multiple candidate patterns. Then, the CLIP scoring screening unit calculates multi-dimensional indicators (CLIP similarity, structure matching degree, visual quality) to screen out the optimal pattern. Meanwhile, the style transfer unit supports quickly extracting pre-set or user-customized style features and fusing them with the content features of the candidate patterns without retraining the LoRA, realizing style transfer optimization. Finally, the optimal pattern is transmitted to the pattern mapping module.

[0099] In the embodiment of the application, the reasoning submodule includes a ControlNet structure control unit, a diffusion generation unit, a CLIP scoring screening unit, a style transfer unit and a parameter automatic optimization unit.

[0100] The ControlNet structure control unit is the core module for realizing accurate control of the structure during pattern generation, which is used to convert the user's preset pattern structure features (such as outline, layout) into condition signals recognizable by the model, and integrate them into the diffusion generation process to constrain the pattern structure, solving the defect that the existing technology is difficult to control the details of the pattern structure relying only on text prompts.

[0101] Firstly, this module receives the preprocessed structure features (such as the edge map obtained by binarizing the user's hand-drawn sketch) output by the visual interaction module, which is denoted as S. Through the convolution processing function G l of its branch network (l represents the corresponding layer number of the diffusion model U-Net network), the control features (the calculation formula is C l =G l (S)) are calculated and added to the original features of the corresponding layers of U-Net, so as to convert the two-dimensional structure image S into a three-dimensional structure condition feature tensor matching the feature dimension of U-Net.

[0102] Then, the structure condition feature tensor C l is added to the original image features F l of the corresponding layers of the U-Net network to perform element-level addition operation, and the superimposed features F l ′=F l +C l are obtained. Through this operation, the diffusion model is forced to refer to the preset structure when generating the pattern, ensuring that the outline and layout of the generated result are consistent with the user's needs.

[0103] Meanwhile, the module has good compatibility. If the user does not provide a structure image or does not need a structure constraint, the module will make the structure condition feature tensor C l = 0 through a zero convolution mechanism, so that the superimposed feature F l ' = F l does not interfere with the normal generation process of the diffusion generation unit, thus meeting the precise requirements of the structure controllable scenario and adapting to the flexible scenario relying only on text generation, and providing key technical support for the platform to realize high controllability pattern generation.

[0104] Among them, the diffusion generation unit as the generation engine of the platform, combines the style parameters fine-tuned by LoRA, the structure conditions of ControlNet and the text semantic guidance, and generates high-quality candidate pattern images through diffusion sampling algorithm.

[0105] Firstly, the module inputs the text prompt parsed by the visual interaction module into the CLIP text encoder, generates a multi-dimensional text semantic embedding vector E text , which can accurately map the semantic information of the text description. Among them, the model of CLIP encoder is CLIP-ViT-B / 32, of course, other models can also be selected according to needs.

[0106] In the cross-attention module of U-Net network, E text is taken as the key (K) and value (V) of attention calculation (i.e. K = V = E text ), and the image feature is taken as the query (Q), and the alignment of text semantics and image features is realized through the attention calculation formula: (wherein, Q is the image feature, and d is the feature dimension), so as to ensure that the theme, color and elements of the generated pattern are consistent with the text description.

[0107] In the process of reverse diffusion sampling, random noise (wherein, T is the total number of diffusion steps) is used as the initial input; the forward process represented by the formula is used to add noise to x T step by step (i.e. at step t, x t-1 is scaled by the coefficient and Gaussian noise with variance β t is added), which is used for training; the superimposed feature F l ' of the model weight W fine-tuned based on LoRA, according to the formula (wherein

[0108] β i is the forward diffusion noise variance, and ∈ θ is the noise prediction network, The noise is removed step by step and the clear pattern is generated from t=T to t=1; during the iteration process, the text guidance and the structure condition are fused in real time to ensure that each step of sampling meets the user's demand. In this embodiment, the reverse diffusion sampling algorithm adopts the DDIM algorithm.

[0109] At the same time, this module supports generating multiple candidate images at a time, and the number of generated images can be customized by the user, providing enough candidate samples for the subsequent screening module.

[0110] Among them, the CLIP score screening unit automatically screens out the optimal pattern with the highest matching degree with the user's demand through an objective scoring mechanism, reducing the user's workload and ensuring the output quality.

[0111] Firstly, the module inputs the candidate pattern image output by the diffusion generation unit into the CLIP image encoder to generate the image semantic embedding vector E text consistent with E img .

[0112] Then, the CLIP similarity is calculated, specifically through the formula The semantic similarity of each candidate image and the text prompt is calculated. The score range is 0-1, and the higher the score, the higher the matching degree.

[0113] In the screening process, in addition to the CLIP score, the module can also combine the structure matching degree (calculating the edge coincidence rate of the generated image and the structure feature) and the visual quality index for comprehensive evaluation, calculate the comprehensive score according to the CLIP score, the structure matching degree and the visual quality, and screen the image with the highest comprehensive score as the optimal result.

[0114] At the same time, this module can sort the candidate images according to the comprehensive score from high to low, and mark the score details of each image, which is convenient for users to intuitively understand the screening basis, and also supports users to manually select the result that does not have the highest score but meets the subjective preference.

[0115] Among them, the style transfer unit is connected with the visual interaction module and the diffusion generation unit, and is an important supplementary module for the platform to enrich the pattern expressiveness and reduce the threshold of style customization. Its core function is to directly apply a certain target style to a specified pattern image without training the LoRA model. Through this module, even if the user lacks a large number of training samples, the pattern can also be quickly given a specific style to meet the design requirements.

[0116] This module supports two kinds of style source input, including platform preset styles and user customized styles. Among them, the user customized style is the style of the reference image uploaded by the user; the platform preset style (such as Figure 3 as shown) includes folk style, illustration, fresh and natural, digitalization, and pop and Memphis style.

[0117] After input, the module extracts features from the style source. Among them, the platform preset style directly calls the pre-stored style feature vector for processing; the user customized style extracts high-level style features through a deep learning neural network (such as VGG-19).

[0118] In the style transfer process, a feature fusion transfer strategy is adopted to fuse the style features and the content features of the target pattern, and the generated structure is optimized through style loss and content loss to output the style transferred pattern.

[0119] Among them, the parameter automatic optimization unit dynamically optimizes the key parameters through real-time monitoring of the generation process, improves the quality of the candidate pattern, and reduces manual operation. This module is a key auxiliary module to ensure the output quality of the diffusion generation unit and reduce the user operation threshold.

[0120] Specifically, the module focuses on two core parameters: diffusion step number and text prompt guide coefficient. During the diffusion sampling process, the intermediate generated image is extracted, and the preset quality evaluation index is used to determine whether the intermediate result meets the standard. If the intermediate result does not meet the standard, the parameters are automatically adjusted. For example, if the clarity is low, the diffusion step number is increased, and if the text matching degree is low, the guide coefficient is increased. After adjustment, the subsequent sampling steps are executed again until the intermediate result meets the standard.

[0121] In addition, the module can record the user's past parameter adjustment preferences, and automatically recommend the optimal parameters for subsequent generation of the same style, gradually adapting to the user's design habits.

[0122] The pattern mapping module is a system-level image processing module that can load preset carrier models such as textiles, home furnishings, stationery, and cultural and creative products. Through target detection, edge detection, and positive film superposition technology, the optimal pattern is mapped to the carrier. It can also compress the image volume while ensuring image quality, support users to adjust pattern scaling, rotation, arrangement and other parameters and real-time preview, export preview image, cooperate with output unit to meet user's evaluation and landing demand for actual application effect of pattern.

[0123] In the embodiment of the application, the pattern mapping module includes a pattern mapping preview unit and an output unit.

[0124] Among them, the pattern mapping preview unit maps the generated planar pattern to the actual carrier scene for simulation and display, accelerating the landing from design to application.

[0125] Firstly, the module supports the loading of multiple types of preset carriers, such as Figure 4 As shown in the figure, the preset carriers include textiles, home furnishings, stationery, and cultural and creative products; the carrier model is a three-dimensional model or a high-precision two-dimensional template.

[0126] In the process of pattern mapping, mapping is performed according to the surface properties of the carrier. Among them, the plane carrier directly tiles the pattern, the curved surface carrier pastes the plane pattern to the curved surface through UV mapping, and the repeating carrier automatically processes the splicing edge of the pattern; at the same time, during preview, the scaling ratio, rotation angle, arrangement mode and the like of the pattern are supported to be adjusted.

[0127] In addition, the module also supports exporting preview pictures (such as JPG, PNG, TIFF and the like) for users to report design schemes or evaluate effects.

[0128] Among them, the output unit is used to output the optimal pattern and related derivative data to meet the subsequent design or production needs of the user.

[0129] Firstly, the unit outputs the optimal pattern image screened by CLIP, supports multiple formats (JPG, PNG, TIFF) selection and high-resolution export. Among them, the PNG format supports transparent background color to adapt to the design of creative product decals.

[0130] At the same time, the unit supports the batch export function of the pattern image, and supports the export of formats conforming to industry standards for specific production scenarios. For example, AI vector format is exported for textile design to facilitate typesetting in printing factories, and TIF format is exported for wallpaper design to meet the demand of large-format printing.

[0131] In addition, when output to a file, a parameter file (JSON format) can be selected to be output, and the parameter file is used to record the key parameters (text prompt, LoRA weight, diffusion step number, random seed, etc.) of this generation to facilitate the reproduction of the same generation result by importing the parameter file in the future.

[0132] Figure 8 The effect comparison chart of generating folk style patterns using the platform and the effect generated by other platforms is shown. As shown in Figure 8 The folk pattern generated by the self-developed platform of the application has better color matching, pattern effect and composition layout, and is closer to the characteristics of folk patterns.

[0133] Figure 2 The flowchart of the AI diffusion model pattern generation method of the application is shown. As shown in Figure 2 The AI diffusion model pattern generation method includes the following steps:

[0134] Step S1: input preprocessing.

[0135] In the embodiment of the application, the specific steps of input preprocessing include:

[0136] Step S1.1: requirement receiving;

[0137] Two types of core requirements input by the user through the platform interface, namely, text prompt information describing the pattern style, elements, and color, and an optional reference image (such as a hand-drawn sketch) that can constrain the pattern structure, and guide the user to supplement the key missing information.

[0138] Step S1.2: structure image processing;

[0139] Only when the user provides a structure image, after the image is uniformly resolved (such as 512*512 pixels) and the background noise is removed, the edge detection algorithm is used to binarize a clear edge map, and the core contour is extracted as a standardized structure feature.

[0140] Step S1.3: text prompt analysis;

[0141] The text prompt is split into style, element, color, and detail dimensions by using NLP technology, key description words are marked, and ambiguous expressions are mapped to platform preset labels to ensure semantic accuracy.

[0142] Step S1.4: input compatibility adaptation.

[0143] If there is a structure image, the structure feature is associated with the text information; if not, a structureless input signal is generated, triggering the ControlNet zero convolution mechanism, and feedback is provided to the user to ensure smooth flow in different input scenarios.

[0144] Step S2: text encoding.

[0145] In the embodiment of the application, the specific steps of text encoding include:

[0146] Step S2.1: text input verification;

[0147] The format and semantic integrity of the parsed text are verified, the core information of the long text is extracted, the default content is supplemented and the user is prompted if the semantic is missing, and the compliant text to be encoded is output.

[0148] Step S2.2: CLIP text encoder loading;

[0149] The CLIP encoder and the matching pre-training weight are loaded, the text processing pipeline is initialized, and the text to be encoded is converted into a token sequence to prepare for vector generation.

[0150] In the embodiment of the application, the model of the CLIP encoder is ViT-B / 32, and other models can also be selected as needed.

[0151] Step S2.3: semantic embedding vector generation;

[0152] The text prompt is input into the CLIP text encoder to obtain the semantic embedding vector E textE is then incorporated into the multi-layer cross-attention module of the U-Net using a mathematical formula to accurately map the text semantics to the image features. text

[0153] The mathematical formula is:

[0154] Step S3: LoRA fine-tuning.

[0155] In the embodiments of the present application, the specific steps of LoRA fine-tuning include:

[0156] Step S3.1: Pre-trained model loading and weight freezing;

[0157] The pre-trained Stable Diffusion model is loaded, and its original weight matrix W0 is frozen to avoid loss of the original model's general generation ability, and only the adjustment space suitable for customizing the style is retained.

[0158] Step S3.2: Low-rank matrix insertion;

[0159] A low-rank matrix is inserted into the key layer of the LoRA fine-tuning unit and (rank r << min(m, n)), the weight increment AW=AxB is constructed, and the calculation logic of the actual working weight W of the model W0+AW is determined.

[0160] Step S3.3: Low-rank matrix training;

[0161] A small number of pattern samples provided by the user are only used to perform gradient optimization on the low-rank matrices A and B, and the optimization target is that the gradient of the loss function to the original weight W0 is 0 (the specific optimization method has been described in detail above). The increment feature of the exclusive pattern style is learned, and the training can be completed by a consumer-level GPU.

[0162] Step S3.4: LoRA weight output and management.

[0163] After training, the lightweight LoRA weight module containing only A and B is output, which supports dynamic loading / unloading and multi-module mixing, facilitating the user to quickly switch or fuse styles.

[0164] Step S4: ControlNet structure condition injection.

[0165] In the embodiments of the present application, the specific steps of ControlNet structure condition injection include:

[0166] Step S4.1: Structure feature receiving and checking;

[0167] ​The structural features S output by the input preprocessing step are received, and the feature format (dimension, resolution) is checked to see if it is suitable for the ControlNet branch network. If the format is not suitable, it is automatically adjusted to ensure that the subsequent processing is normal.

[0168] Step S4.2: Structural feature conversion

[0169] Through the convolution function G of the ControlNet branch network l (l is the corresponding number of layers of the U-Net), the two-dimensional structural feature S is converted into a three-dimensional structural condition feature tensor C l to match the feature dimension of the U-Net.

[0170] Step S4.3: Feature superposition and compatibility processing

[0171] C l is superimposed on the original feature F l of the corresponding layer of the U-Net to obtain F l ′=F l +C l ; if there is no structural input, C l =0 is obtained through zero convolution to ensure process compatibility and pass the superimposed feature to the diffusion generation unit.

[0172] Step S5: Diffusion sampling generation

[0173] In the embodiments of the present application, the specific steps of diffusion sampling generation include:

[0174] Step S5.1: Multi-source input integration

[0175] Specifically, three core inputs are integrated: text semantic information of the input preprocessing module, model weight W of the LoRA fine-tuning unit, and structural condition tensor C l of the ControlNet module, to ensure that the data format of each input is suitable for the diffusion model and to prepare for sampling generation.

[0176] Step S5.2: Initial noise generation

[0177] Random noise x T (T is the total number of diffusion steps) conforming to the distribution of is generated as the initial input basis for reverse diffusion sampling.

[0178] Step S5.3: Reverse diffusion iterative sampling

[0179] From t=T to t=1, the text guide (cross-attention calculation), style weight W, and structural tensor C l are combined to iteratively calculate x t-1Step-by-step denoising, by default, uses the DDIM algorithm to balance efficiency and quality. The specific process of reverse diffusion iterative sampling has been described in detail above

[0180] During the iterative sampling process, the optional access parameter automatic optimization unit can perform dynamic parameter adjustment.

[0181] Step S5.4: candidate pattern output.

[0182] After the iteration is completed, multiple clear candidate pattern images can be generated according to the preset number of the user, and are transmitted to the CLIP scoring screening unit for subsequent quality evaluation and screening.

[0183] Step S6: CLIP scoring screening.

[0184] In the embodiment of the application, the specific steps of CLIP scoring screening include:

[0185] Step S6.1: integration of candidate images and text semantic input;

[0186] The batch of candidate pattern images output by the diffusion generation unit are received, and the text prompt parsed after the input preprocessing step and the semantic embedding vector E generated by the text encoding step are retrieved text , to ensure that the image and the text semantic data correspond to each other, and to prepare for subsequent scoring.

[0187] Step S6.2: CLIP similarity and multi-dimensional index calculation;

[0188] The candidate image is input into the CLIP image encoder to generate an image semantic embedding vector E img , and the CLIP similarity of E img and E text is calculated by the formula.

[0189] The structural matching degree (edge overlap rate of the generated image and the ControlNet structural features) and the visual quality index are calculated at the same time to obtain multi-dimensional scoring data. The visual quality index includes sharpness and color saturation.

[0190] Step S6.3: comprehensive scoring sorting and optimal image screening.

[0191] The comprehensive score is calculated according to the preset weight, the candidate images are sorted from high to low according to the score, the user can define the screening threshold to remove low-quality images, and finally the optimal pattern image is screened out and transmitted to the output unit.

[0192] Among them, the preset weight includes CLIP score, structural matching degree and visual quality; the weight value can be set according to the scene.

[0193] Step S7: result output and map preview.

[0194] In the embodiments of the present application, the specific steps of result output and map preview include:

[0195] Step S7.1: optimal image receiving and format adaptation;

[0196] According to the pre-set resolution (such as 512x512, 2048x2048, etc.) before image generation, the optimal pattern image output by the CLIP score screening unit is received, and the multi-export format (JPG, PNG, TIFF) is automatically adapted to meet the needs of different design or production scenarios.

[0197] Step S7.2: pattern image export;

[0198] According to the selected format and resolution, the optimal image is directly exported, which supports saving to the local or associated platform design project for subsequent design improvement or production use.

[0199] Step S7.3: preset carrier model loading;

[0200] Load the preset pattern application carrier model (such as two-dimensional templates or three-dimensional models of textiles, wallpaper, and cultural and creative products) of the platform, and support users to select the target carrier type according to their needs.

[0201] Step S7.4: pattern map and preview generation.

[0202] The platform supports adjustment of pattern map parameters (such as contrast, detail retention, output quality, edge smoothness, and pattern scaling ratio), maps the optimal image to the selected carrier, and generates a preview of the actual application scenario; if the effect is not satisfactory, it supports returning to the previous step to adjust and generate again to complete the design closed loop.

[0203] Advantages of the implementation of the present application: compared with the prior art, the technology of the present application has important improvements in customization, controllability, efficiency and practicality, as follows:

[0204] First, the customization threshold is low and supports exclusive style generation: the present application uses the LoRA fine-tuning mechanism, which only needs to train a small number of low-rank matrices to enable the pre-trained model to learn specific pattern styles, greatly reducing the customization cost of exclusive style models. However, the existing full-tuning requires thousands of samples and multiple high-performance GPUs, which ordinary users cannot achieve. At the same time, the LoRA weight module is small in size and can be saved and dynamically loaded independently, and users can quickly switch between multiple exclusive styles without maintaining multiple complete model copies.

[0205] Secondly, the generation process is highly controllable and precisely matches the design requirements: the invention realizes controllable generation through the dual mechanisms of text guidance and structure control, wherein the text guidance ensures that the pattern theme is consistent with the description through CLIP text embedding; the structure control converts the outline sketch provided by the user into a feature tensor through ControlNet, forcing the generated pattern to follow the preset structure. The dual mechanism of the invention greatly improves the matching degree of the pattern structure and avoids the problem of structure out of control.

[0206] Thirdly, the design efficiency is significantly improved through full-link integration: the invention integrates input processing, model fine-tuning, diffusion generation, intelligent screening, and map preview functions, and users can complete all operations from creative input to application preview on the same platform without switching between multiple tools. Among them, the CLIP automatic screening and batch generation functions can reduce the workload of manual screening; at the same time, the parameter automatic optimization unit can avoid repeated parameter adjustment and trial and error by the user, shortening the design time of a single pattern.

[0207] Finally, it is practical and covers multiple design requirements: the invention adds a pattern map preview function, supports mapping the generated pattern to preset carriers such as textiles, wallpaper, and cultural and creative products, and users can intuitively evaluate the effect of the pattern in actual application without relying on professional 3D software; at the same time, the generated pattern image supports high-resolution export and can be directly used for printing, production, and other downstream links, bridging the last mile from design to landing, and meeting the actual design and production requirements.

[0208] The above is only a specific embodiment of the invention, but the protection scope of the invention is not limited thereto. Any changes or replacements within the scope of the disclosed technology can be easily thought of by those skilled in the art, and should be covered within the protection scope of the invention. Therefore, the protection scope of the invention should be subject to the protection scope of the claims.

Claims

1. An AI diffusion model pattern generation platform, characterized in that, The AI ​​diffusion model pattern generation platform includes: The visual interaction module receives and preprocesses user-input text prompts and pattern structure image information through a provided graphical interface. The image generation module generates the optimal pattern based on the interactive information provided by the visualization interaction module. The pattern mapping module uses object detection, edge detection, and positive overlay technology to map the optimal pattern onto the carrier, and supports user parameter adjustment, preview, and export of preview images. in: The image generation module includes a training submodule and an inference submodule; The training submodule is based on LoRA+Stable Diffusion technology. It learns a unique style by interpolating a low-rank matrix into the U-Net layer and optimizing the matrix with a small number of samples. It outputs lightweight LoRA weights for the inference submodule to call. The inference submodule integrates text vectors, LoRA weights, and ControlNet structural conditional tensors, generates candidate patterns through backdiffusion sampling, and selects the optimal pattern through CLIP scoring, which is then transmitted to the pattern mapping module.

2. The AI ​​diffusion model pattern generation platform according to claim 1, characterized in that, The inference submodule includes a LoRA fine-tuning unit, which is based on a pre-trained model and freezes the original weight matrix W0 of the pre-trained model. Trainable low-rank matrices A and B are inserted into the key layers of the pre-trained model to construct a weight increment ΔW = A × B, so that the actual working weight of the model is the sum of the original weight matrix and the weight increment, and the actual working weight of the model is W = W0 + ΔW. During training, gradient optimization is performed only on the low-rank matrices A and B to learn incremental features of a specific pattern style. After training is completed, a lightweight LoRA weight module is output.

3. The AI ​​diffusion model pattern generation platform according to claim 1, characterized in that, The training submodule includes a ControlNet structure control unit, a diffusion generation unit, a CLIP scoring and filtering unit, a style transfer unit, and a parameter automatic optimization unit. The ControlNet structural control unit converts the preprocessed structural image into a three-dimensional structural conditional feature tensor and superimposes it onto the diffusion model feature layer; The diffusion generation unit is used to fuse text guidance, LoRA weights, and structural conditions to generate candidate pattern images through back diffusion sampling. The CLIP scoring and filtering unit is used to calculate the semantic similarity between candidate patterns and text prompts, and to filter the optimal results by combining structural matching degree and visual quality. The style transfer unit is used to extract style features of preset styles or user reference images, and transfer them to the target pattern through feature fusion; The automatic parameter optimization unit is used to monitor the quality indicators of intermediate generated images in real time during the diffusion sampling process.

4. The AI ​​diffusion model pattern generation platform according to claim 3, characterized in that, The diffusion generation unit aligns text semantics with image features through an attention calculation formula in the cross-attention module of the U-Net network. The formula for calculating attention is: Where: Q is the image feature, d is the feature dimension, K and V are the key and value for attention calculation, respectively, and K = V = E. text The E text These are text semantic embedding vectors generated by the CLIP text encoder; The diffusion generation unit gradually adds random noise x to the sampling process using a forward process calculation formula during the back-diffusion sampling process. T ; The formula for calculating the forward process is: Wherein: the random noise x T It follows a normal distribution, where T is the total number of diffusion steps.

5. The AI ​​diffusion model pattern generation platform according to claim 3, characterized in that, The CLIP scoring and filtering unit calculates CLIP similarity using a similarity formula to obtain a CLIP score; The similarity formula is: Where: E text E is the text semantic embedding vector generated by the CLIP text encoder. img The image semantic embedding vector is generated by the CLIP image encoder. The similarity score ranges from 0 to 1. The higher the CLIP score, the higher the matching degree.

6. The AI ​​diffusion model pattern generation platform according to claim 3, characterized in that, The style migration unit is connected to the visualization interaction module and the diffusion generation unit and supports the input of platform preset styles and user-customized styles; The preset style is processed by calling the pre-stored style feature vector, and the user-customized style is extracted using a deep learning neural network; During the style transfer process, the style transfer unit uses a feature fusion method to fuse style features with the content features of the target pattern.

7. The AI ​​diffusion model pattern generation platform according to claim 3, characterized in that, The quality indicators include clarity and text matching degree. During the sampling process, the diffusion generation unit adjusts the diffusion steps and text prompt guidance coefficient in real time through the parameter automatic optimization unit. If the clarity of the intermediate generated image is low, the diffusion iteration steps are automatically increased. If the text matching degree is low, the text guidance coefficient is increased.

8. The AI ​​diffusion model pattern generation platform according to any one of claims 1 to 7, characterized in that, The pattern mapping module includes a pattern mapping preview unit and an output unit; The pattern mapping preview unit supports loading of textiles, home furnishings, stationery and cultural and creative products. During loading, pattern mapping is performed according to the surface properties of the carrier. The output unit supports exporting in JPG, PNG, and TIFF formats.

9. A method for generating patterns using an AI diffusion model, characterized in that, The AI ​​diffusion model pattern generation method includes: Step S1: Input preprocessing: Receive text prompts and structural images, parse text semantics and extract structural edge features; Step S2: Text encoding, generating text semantic embedding vectors using the CLIP text encoder; Step S3: LoRA fine-tuning, inserting a low-rank matrix to train custom style weights; Step S4: ControlNet structural condition injection, converting structural features into conditional tensors and superimposing them onto the diffusion model; Step S5: Diffusion sampling generation, fusion of text embedding, LoRA weights and structural conditions, iterative denoising to generate candidate patterns; Step S6: CLIP scoring and filtering, calculating semantic similarity and structural matching degree, and selecting the optimal pattern; Step S7: Result output and texture preview. Output the optimal pattern image, load the preset carrier model, and map the optimal pattern image to the carrier model to generate an application preview image.

10. The AI ​​diffusion model pattern generation method according to claim 9, characterized in that, Step S3 includes: S3.1: Loading and freezing pre-trained model and weights. Load the pre-trained Stable Diffusion model and freeze its original weight matrix W0. S3.2: Low-rank matrix insertion, inserting low-rank matrices into the key layers of the model. and Determine the actual working weights of the model as W = W0 + A × B; S3.3: Low-rank matrix training, using a small number of pattern samples to perform gradient optimization only on low-rank matrices A and B, with the optimization objective being that the gradient of the loss function with respect to the original weights W0 is 0; S3.4: LoRA weight output and management, outputting only a lightweight LoRA weight module containing low-rank matrices A and B. The lightweight LoRA weight module supports dynamic loading, unloading, and mixing of multiple modules.

11. The AI ​​diffusion model pattern generation method according to claim 9, characterized in that, Step S4 includes: S4.1: Structural feature reception and verification. Receives standardized structural feature data and verifies whether its dimensions and resolution are suitable for the ControlNet branch network. If they do not match, it will be automatically adjusted. S4.2: Structural feature transformation, through the convolution function G of the ControlNet branch network. l Convert standardized structural feature data into a structural condition feature tensor C. l ; S4.3: Feature overlay and compatibility processing, C l Original features F corresponding to the layer of U-Net l Superposition yields F l ′=F l +C l If an unstructured input signal exists, then C l =0.

12. The AI ​​diffusion model pattern generation method according to claim 9, characterized in that, Step S5 includes: S5.1: Multi-source input integration, integrating standardized text semantic data, LoRA weight module and superimposed features to ensure data format adaptability to diffusion model; S5.2: Initial noise generation, generating noise that conforms to... Distributed random noise x T ; S5.3: Back-diffusion iterative sampling, during which the number of diffusion steps and text guidance coefficient are dynamically adjusted through parameter automatic optimization unit; S5.4: Candidate pattern output, generating multiple candidate pattern images and transferring them to the CLIP scoring and filtering unit.

13. The AI ​​diffusion model pattern generation method according to claim 9, characterized in that, Step S6 includes: S6.1: Integrate candidate images with text semantic input, receive candidate pattern images, and retrieve the semantic embedding vector E generated in step S2. text ; S6.2: CLIP similarity and multi-dimensional index calculation to generate image semantic embedding vector E img It also calculates CLIP similarity, structural matching degree and visual quality index; S6.3: Comprehensive scoring and optimal image selection. Calculate the comprehensive score according to the preset weight, sort the candidate images from high to low score, support user-defined selection thresholds, select the optimal pattern image and pass it to the output unit.

Citation Information

Cited By

  • Personalized LoRA model construction method and system and storage medium

    CN121458529A

  • A personalized LoRA model construction method and system, and a storage medium

    CN121458529B

  • Pattern element processing method and device, computer equipment and storage medium

    CN121563755A