A style transfer-based strong similarity generation method, device, equipment and medium

By combining Flux, Zoe Depth Anything, ControlNet, and LoRA models, the problems of detail loss and unclear style features in style transfer are solved, achieving a balance between detail preservation and style intensity, and improving the quality and consistency of generated images.

CN122155931APending Publication Date: 2026-06-05XIAMEN ZIXUN INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
XIAMEN ZIXUN INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-01-31
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing style transfer methods struggle to balance stylization intensity with image detail preservation, leading to issues such as detail loss and unclear style features during strong style transfer.

Method used

High-resolution redrawing is performed using the Flux model, combined with the Zoe Depth Anything model for in-depth understanding, structural optimization is achieved using ControlNet and Flux-IPAdapter, detail adjustments are made using the LoRA model, and histogram matching is performed in the Lab color space to generate the final style map.

Benefits of technology

It achieves an optimal balance between detail preservation and style intensity, ensures the consistency and stability of content structure, improves the accuracy and visual naturalness of color transfer, and constructs a modular and interpretable strong similarity generation pipeline.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122155931A_ABST
    Figure CN122155931A_ABST
Patent Text Reader

Abstract

The application provides a style transfer strong similarity-based generation method, device, equipment and medium, the method comprising: S10, redrawing a style reference map, outputting a clear style map; S20, inputting the clear style map into a monocular depth estimation model, outputting a single-channel depth map; S30, inputting the single-channel depth map into an enhanced image generation model for structure optimization, generating a redrawing sketch; S40, using a visual feature extraction model and a deep learning model to perform style fusion and rendering on the redrawing sketch, generating a preliminary style map; S50, pre-training a LoRA model, using the LoRA model to adjust the preliminary style map, outputting an intermediate style map; S60, after upsampling the intermediate style map, performing block optimization, outputting an optimized style map; S70, inputting the optimized style map into a Lab color space, performing histogram matching, and generating a final style map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, device, and medium for generating strong similarity based on style transfer. Background Technology

[0002] Strong similarity generation refers to a style transfer generation method that uses a style reference image as the core benchmark and uses technical means to restore the structural features (spatial relationships, object outlines, perspective logic), color distribution, and texture details of the reference image. The final generated image has a very high similarity to the reference image. Style transfer, an important research direction in computer vision and digital image processing, aims to effectively apply the visual features of specific art styles (such as oil painting, ink painting, and cartoon rendering) to target content images while preserving the structural and semantic information of the original image as much as possible. Traditional transfer methods, when handling different style transfer requirements, still lack effective strategies for preserving image details and adjusting style intensity differences. This leads to loss of image details and indistinct style features during strong style transfer, along with some changes in scene elements. It is difficult to balance stylistic intensity and image detail preservation, and strong style transfer can result in distorted content structure and inaccurate scene elements. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a method, apparatus, device and medium for generating strong similarity based on style transfer, so as to solve the technical problem in the prior art that it is difficult to balance the stylization intensity and the preservation of image details, resulting in the loss of details and the lack of obvious style features when strong style transfer is performed. In a first aspect, the present invention provides a method for generating strong similarity based on style transfer, comprising the following steps: S10. Redraw the style reference image and output a clear style image; S20. Input the sharp style map into the monocular depth estimation model and output a single-channel depth map; S30. Input the single-channel depth map into the enhanced image generation model for structural optimization to generate a transfer sketch. S40. The visual feature extraction model and deep learning model are used to perform style fusion and rendering on the transcribed sketch to generate a preliminary style map; S50. Pre-train the LoRA model, and use the LoRA model to adjust the initial style map to output an intermediate style map; S60. After upsampling the intermediate style map, perform block optimization and output the optimized style map; S70. Input the optimized style map into the Lab color space, perform histogram matching, and generate the final style map. Secondly, the present invention provides a style transfer-based strong similarity generation device, comprising the following modules: The reference image redrawing module redraws the style reference image and outputs a clear style image. The deep understanding module inputs the sharp style map into the monocular depth estimation model and outputs a single-channel depth map. The structure optimization module inputs the single-channel depth map into the enhanced image generation model for structure optimization, generating a transfer sketch. The fusion rendering module uses a visual feature extraction model and a deep learning model to perform style fusion and rendering on the transferred sketch, generating a preliminary style map. The LoRA model module pre-trains a LoRA model, which is used to adjust the initial style map and output an intermediate style map. The block optimization module upsamples the intermediate style map, performs block optimization, and outputs an optimized style map. The final generation module inputs the optimized style map into the Lab color space, performs histogram matching, and generates the final style map. Thirdly, the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in the first aspect. Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect. One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages: 1. Achieves the optimal balance between detail preservation and style intensity: This invention introduces high-definition redrawing of the Flux model as a pre-processing stage, providing a high-fidelity texture foundation for subsequent processing; combined with the LoRA detail fine-tuning and TTP block division + Flux redrawing multi-scale optimization mechanism, it can accurately preserve the key details of the source image while applying high-intensity style transfer, effectively avoiding the common problems of detail blurring or style mismatch in traditional methods. 2. Ensures high consistency and stability of content structure: By using the Zoe Depth and AnythingControlNet models, a strong spatial structure prior is injected into the generation process. This mechanism can strictly constrain the outline, perspective, and occlusion relationships of generated objects, fundamentally preventing scene element distortion, deformation, or semantic errors that may occur during strong stylization, thus ensuring the recognizability and structural realism of the main content. 3. Improved accuracy and visual naturalness of color transfer: This invention employs Lab color space histogram matching, supplemented by Bach distance quantization evaluation and Gaussian smoothing strategies, to achieve accurate imitation of the target style's color distribution. This method can effectively convey complex tonal styles while avoiding color banding and unnatural transitions, ensuring that the generated image's color representation is highly similar to the reference image both visually and statistically. 4. A modular and interpretable strong similarity generation pipeline was constructed: This invention decomposes the complex style transfer task into logically clear and sequential stages such as deep understanding, structural optimization, style fusion, and detail refinement. This modular design not only improves the controllability and debuggability of the entire process, allowing adjustments to intermediate stages for specific needs, but also makes the quality and strong similarity of the generated results technically interpretable. The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description The present invention will be further described below with reference to the accompanying drawings and embodiments. Figure 1 This is a flowchart of the method in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the device in Embodiment 2 of the present invention. Detailed Implementation This application provides a method, apparatus, device, and medium for generating strong similarity based on style transfer, which solves the technical problem in the prior art that it is difficult to balance stylization intensity and image detail preservation, resulting in loss of detail and unclear style features during strong style transfer. Example 1 This embodiment provides a method for generating strong similarity based on style transfer, such as Figure 1 As shown, it includes the following steps: S10. Redraw the style reference image and output a clear style image; Specifically, S10 is: The style reference map is redrawn using the Flux model to enhance its texture details and output a clear style map. The texture details include line sharpness and color transition smoothness; S20. Input the sharp style map into the monocular depth estimation model and output a single-channel depth map; Specifically, S20 is: The sharp style map is input into the monocular depth estimation model (Zoe Depth Anything model), the three-dimensional spatial structure of the sharp style map is analyzed, a single-channel depth map is generated, and the original depth value of the single-channel depth map is output. S30. Input the single-channel depth map into the enhanced image generation model for structural optimization to generate a transfer sketch. Specifically, S30 is: S31. Input the single-channel depth map into the ControlNet model: Convert the original depth value into a grayscale value; The original depth value is pre-processed to obtain the processed depth value; Extract the depth levels corresponding to the grayscale values ​​of different pixels in the single-channel depth map, and establish a mapping relationship between processing depth values ​​and spatial positions; label the foreground and background boundaries in the single-channel depth map; label the occlusion levels in the single-channel depth map; and package the depth levels, mapping relationship, foreground and background boundaries, and occlusion levels into depth information. S32. Optimize the clear style map based on the depth information: Adjust the foreground and background boundaries in the sharp style map based on the foreground and background boundaries marked in the single-channel depth chart; Based on the position of the core object in the single-channel depth map, the visual center of gravity of the clear style map is corrected. The core object is the area with the highest processing depth value at a set level. Output depth information to enhance the style map; S33. Based on the depth information, enhance the object contour using the depth information enhancement style map: S331. Obtain the grayscale image of the depth information enhancement style map, calculate the grayscale value change rate of each pixel in the grayscale image, and record the grayscale value change rate that is greater than a set threshold as the grayscale value change point. Using the depth information as a constraint, the grayscale value abrupt change that meets the set conditions is identified as the object outline; S332. Enhance and complete the blurred contour edges in the depth information enhancement style map to improve the contour clarity of the depth information enhancement style map; S34. Adjust the perspective ratio of the enhanced style map based on the depth gradient of the enhanced style map, correct the occlusion level of the enhanced style map according to the occlusion level of the single-channel depth map, and output the adjusted intermediate image. S35. Input the intermediate adjustment image and style reference image into the Flux-IPAdapter model, extract the visual features of the intermediate adjustment image and style reference image and fuse them to generate a transfer sketch; S40. The visual feature extraction model and deep learning model are used to perform style fusion and rendering on the transcribed sketch to generate a preliminary style map; In step S40, the FLUX Redux model is used to perform style blending and rendering on the transferred sketch, specifically as follows: S41. Input the clear style map into the CLIP Vision model and extract key style parameters, including color distribution, brushstroke features, texture details and lighting processing methods. S42. Input the transferred sketch into the CLIP Vision model and extract preliminary style information, which includes depth information and optimized contour edges. S43. Input the key style parameters and preliminary style information into the FluxGuidanc model, use VAE and UNet to generate images in collaboration, use KSampler to sample noise during the generation process, and generate a preliminary style map. S50. Pre-train the LoRA model, and use the LoRA model to adjust the initial style map to output an intermediate style map; Specifically, S50 is: S51. Pre-train the LoRA model using the target style map: The target style map includes a clear style map and a style reference map extended dataset of the same style. S511. Preprocess the target style map: Adjust the target style images to the same size, adjust the brightness by ±5%, and horizontally flip the unoriented target style images; scale the target style images by ±10%; add style description tags to each target style image, the style description tags including style type, core elements and detailed features; S512. Train the model parameters of the LoRA model using the preprocessed target style map, and perform iterative optimization: The model parameters include: color style parameters, texture and brushstroke style parameters, spatial style adaptation parameters, style embedding alignment parameters, and text-image alignment parameters; The initial learning rate for the training is 5e-5 to 2e-4, and the mixed precision for the training is FP16. Iteration termination condition: Use the Bach distance test. If the Bach distance between the target style map and the model-generated map is ≤0.12, then randomly select 10 model-generated maps and manually compare their differences with the target style map. If there is no difference, then terminate the iterative training. S52. The preliminary style map is adjusted using the pre-trained LoRA model to output an intermediate style map; S60. After upsampling the intermediate style map, perform block optimization and output the optimized style map; Specifically, S60 is as follows: S61. Upsample the intermediate style map by 2 pixels, and then divide the intermediate style map into sub-blocks using TTP block segmentation technology; S62. Perform semantic adaptation preprocessing on each of the sub-blocks; S63. Input the preprocessed sub-blocks into the Florence model to extract deep semantic structure information; S64. The deep semantic structure information is transformed into strong constraints of the Flux algorithm, and each sub-block is redrawn based on the strong constraints. S65. Join and merge the redrawn sub-blocks, optimize the edge connection of adjacent sub-blocks; output the optimized style map. S70. Input the optimized style map into the Lab color space, perform histogram matching, and generate the final style map; Specifically, S70 is: S71. Input the style reference image into the Lab color space, and then input the optimized style image into the Lab color space. The L channel of the Lab color space independently controls the brightness distribution to ensure that the contrast of the optimized style image matches that of the style reference image. Figure 1 To; output an optimized style image with adjusted colors; S72. Convert the style reference image from RGB color space to HSV color space to obtain the histogram of the style reference image, perform histogram statistics on the style reference image, and then perform probability normalization to generate the histogram probability distribution of the style reference image. S73. Use Bach distance to calculate the color distribution similarity between the optimized style map and the style reference map after color adjustment:

[0004] DB stands for Bach distance. p ( x () represents the optimized style map to be matched. q ( x () is the histogram probability distribution of the style reference map; retain the optimized style map with DB≤0.15, and repeat the processing of S71 to S73 for DB>0.15; S74. Perform Gaussian smoothing on the histogram of the style reference map to eliminate color banding. The standard deviation of the Gaussian kernel width σ = 1.0. Output the final style map. Based on the same inventive concept, this application also provides an apparatus corresponding to the method in Embodiment 1, as detailed in Embodiment 2. Example 2 This embodiment provides a style transfer-based strong similarity generation device, such as... Figure 2 As shown, it includes the following modules: The reference image redrawing module redraws the style reference image and outputs a clear style image. The deep understanding module inputs the sharp style map into the monocular depth estimation model and outputs a single-channel depth map. The structure optimization module inputs the single-channel depth map into the enhanced image generation model for structure optimization, generating a transfer sketch. The fusion rendering module uses a visual feature extraction model and a deep learning model to perform style fusion and rendering on the transferred sketch, generating a preliminary style map. The LoRA model module pre-trains a LoRA model, which is used to adjust the initial style map and output an intermediate style map. The block optimization module upsamples the intermediate style map, performs block optimization, and outputs an optimized style map. The final generation module inputs the optimized style map into the Lab color space, performs histogram matching, and generates the final style map. The reference drawing redrawing module specifically includes: The style reference map is redrawn using the Flux model to enhance its texture details and output a clear style map. The texture details include line sharpness and color transition smoothness; The deep understanding module specifically includes: The sharp style map is input into the monocular depth estimation model, the three-dimensional spatial structure of the sharp style map is analyzed, a single-channel depth map is generated, and the original depth value of the single-channel depth map is output. The structural optimization module specifically includes: The pixel-level resolution unit inputs the single-channel depth map into the ControlNet model: Convert the original depth value into a grayscale value; The original depth value is pre-processed to obtain the processed depth value; Extract the depth levels corresponding to the grayscale values ​​of different pixels in the single-channel depth map, and establish a mapping relationship between processing depth values ​​and spatial positions; label the foreground and background boundaries in the single-channel depth map; label the occlusion levels in the single-channel depth map; and package the depth levels, mapping relationship, foreground and background boundaries, and occlusion levels into depth information. The depth information enhancement unit optimizes the sharp style map based on the depth information: Adjust the foreground and background boundaries in the sharp style map based on the foreground and background boundaries marked in the single-channel depth chart; Based on the position of the core object in the single-channel depth map, the visual center of gravity of the clear style map is corrected. The core object is the area with the highest processing depth value at a set level. Output depth information to enhance the style map; The contour enhancement unit enhances the object contour by enhancing the style map based on the depth information: The mutation subunit acquires a grayscale image of the depth information enhancement style map, calculates the grayscale value change rate of each pixel in the grayscale image, and records the grayscale value mutation point where the grayscale value change rate is greater than a set threshold. Using the depth information as a constraint, the grayscale value abrupt change that meets the set conditions is identified as the object outline; The clarity subunit enhances and completes the blurred contour edges in the depth information enhancement style map, thereby improving the contour clarity of the depth information enhancement style map. The layer adjustment unit adjusts the perspective ratio of the depth information enhancement style map based on the depth gradient of the depth information enhancement style map, corrects the occlusion level of the depth information enhancement style map according to the occlusion level of the single-channel depth map, and outputs the adjusted intermediate image. The feature fusion unit inputs the intermediate adjustment image and the style reference image into the Flux-IPAdapter model, extracts the visual features of the intermediate adjustment image and the style reference image and fuses them to generate a transfer sketch; In the fusion rendering module, the FLUX Redux model is used to perform style fusion and rendering on the transferred sketch, specifically as follows: The style parameter extraction unit inputs the clear style map into the CLIP Vision model and extracts key style parameters, including color distribution, brushstroke features, texture details, and lighting and shadow processing methods. The sketch parameter extraction unit inputs the transferred sketch into the CLIP Vision model and extracts preliminary style information, which includes depth information and optimized contour edges. The preliminary style map unit inputs the key style parameters and preliminary style information into the FluxGuidanc model, uses VAE and UNet to generate images, and uses KSampler to sample noise during the generation process to generate a preliminary style map. The LoRA model module is specifically as follows: Pre-training unit: The LoRA model is pre-trained using the target style map. The target style map includes a clear style map and a style reference map extended dataset of the same style. The data preprocessing subunit preprocesses the target style map: Adjust the target style images to the same size, adjust the brightness by ±5%, and horizontally flip the unoriented target style images; scale the target style images by ±10%; add style description tags to each target style image, the style description tags including style type, core elements and detailed features; The iterative optimization subunit trains the LoRA model parameters using the preprocessed target style map and performs iterative optimization: The model parameters include: color style parameters, texture and brushstroke style parameters, spatial style adaptation parameters, style embedding alignment parameters, and text-image alignment parameters; The initial learning rate for the training is 5e-5 to 2e-4, and the mixed precision for the training is FP16. Iteration termination condition: Use the Bach distance test. If the Bach distance between the target style map and the model-generated map is ≤0.12, then randomly select 10 model-generated maps and manually compare their differences with the target style map. If there is no difference, then terminate the iterative training. The parameter adjustment unit uses a pre-trained LoRA model to adjust the initial style map and outputs an intermediate style map. The block optimization module specifically includes: Divide the image into sub-blocks, upsample the intermediate style map by 2 pixels, and then divide it into sub-blocks using TTP block division technology; The adaptation preprocessing unit performs adaptation preprocessing on each sub-block; The semantic units are reversed, and the preprocessed sub-blocks are input into the Florence model to extract deep semantic structure information; The constraint unit transforms the deep semantic structure information into strong constraints of the Flux algorithm, and redraws each sub-block based on the strong constraints. The edge optimization unit stitches and merges the redrawn sub-blocks, optimizing the edge connection between adjacent sub-blocks; it outputs an optimized style map. The final generation module is specifically: The color adjustment unit inputs the style reference image into the Lab color space, and then inputs the optimized style image into the Lab color space. The L channel of the Lab color space independently controls the brightness distribution to ensure that the contrast of the optimized style image matches that of the style reference image. Figure 1 To; output an optimized style image with adjusted colors; The histogram unit converts the style reference image from the RGB color space to the HSV color space to obtain the histogram of the style reference image, performs histogram statistics on the style reference image, and then performs probability normalization to generate the histogram probability distribution of the style reference image. The DB unit uses Bach distance to calculate the color distribution similarity between the optimized style map and the style reference map after color adjustment.

[0005] DB stands for Bach distance. p ( x () represents the optimized style map to be matched. q ( x The histogram probability distribution of the style reference map is used; optimized style maps with DB≤0.15 are retained, and the color adjustment unit is repeated to the DB unit for DB>0.15; The Gaussian unit performs Gaussian smoothing on the histogram of the style reference map to eliminate color banding. The standard deviation of the Gaussian kernel width is σ=1.0; the final style map is then output. Since the apparatus described in Embodiment 2 of the present invention is an apparatus used to implement the method of Embodiment 1 of the present invention, those skilled in the art can understand the specific structure and variations of the apparatus based on the method described in Embodiment 1 of the present invention, and therefore will not be described again here. All apparatuses used in the method of Embodiment 1 of the present invention fall within the scope of protection of the present invention. Based on the same inventive concept, this application provides an electronic device embodiment corresponding to Embodiment 1, as detailed in Embodiment 3. Example 3 This embodiment provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it can implement any of the implementation methods in Embodiment 1. Since the electronic device described in this embodiment is the device used to implement the method in Embodiment 1 of this application, those skilled in the art can understand the specific implementation method and various variations of the electronic device in this embodiment based on the method described in Embodiment 1 of this application. Therefore, how the electronic device implements the method in the embodiment of this application will not be described in detail here. Any device used by those skilled in the art to implement the method in the embodiment of this application falls within the scope of protection of this application. Based on the same inventive concept, this application provides a storage medium corresponding to Embodiment 1, as detailed in Embodiment 4. Example 4 This embodiment provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it can implement any of the implementation methods in Embodiment 1. Example 5 Terminology Explanation: FLUX is an advanced text-based image generation model developed by Black Forest Labs (founded by the core team of Stable Diffusion). It aims to generate high-quality images from text descriptions. Based on a diffusion model framework and incorporating several innovative techniques (such as flow matching and parallel diffusion Transformer blocks), it excels in image quality, cue word adherence, and generation speed. LoRA (Low-Rank Adaptation) is an efficient model fine-tuning method that reduces the number of trainable parameters and computational cost by inserting a low-rank matrix into the pre-trained model, while maintaining fine-tuning effectiveness. In image generation, it is often used to optimize details in style-transferred images, such as adjusting local texture, color consistency, or structural accuracy. FLUX.1 Redux is a style transfer and image variant reshaping tool developed by Black Forest Labs for the FLUX.1 text-based image model. It combines diffusion models with deep learning style transfer techniques, introducing an adaptive style injection mechanism based on the FLUX.1 diffusion model framework. This dynamically embeds target style features into the latent space of the diffusion process. It allows users to stylize the generated results or generate diverse variants while preserving the core content of the image. Tile-based texture processing (TP) is a tile-based processing technique for high-resolution images, primarily used to address memory limitations and computational efficiency issues when generating or editing large images. Directly loading the entire image can lead to memory overflow or model crashes, while tile processing can cut the image into multiple small tiles, optimize each tile, and then seamlessly stitch them together to achieve efficient, stable, and high-quality output. Zoe Depth Anything: Zoe Depth is a monocular depth estimation model developed by Intel. It combines relative depth and metric depth estimation, supports zero-shot transfer learning, and achieves good generalization performance in depth prediction across different scenarios (such as indoors and outdoors). Depth Anything, developed by the University of Hong Kong, ByteDance, and other institutions, is trained using 1.5 million labeled images and 62 million unlabeled images. It provides multi-scale models (such as small, medium, and large), surpasses MiDaS in accuracy and robustness, and supports tasks such as ControlNet depth control. Histogram Matching: A method that adjusts the distribution of pixel values ​​in an image to match the histogram of a reference image; it is often used for color correction. The algorithm is mainly implemented as follows: Step 1: Flux Model (High-Resolution Redrawing Stage) Integration method: Directly redraw the style reference image in high definition, focusing on enhancing its texture details (such as line clarity and color transition smoothness) to provide a high-fidelity foundation for subsequent style transfer. Step 2: Zoe Depth Anything Depth Information Preprocessing Role and Integration: This step provides a deep understanding of the redrawn style map. Zoe Depth Anything analyzes the 3D spatial structure of the image, accurately resolving the positional relationships between objects, occlusion levels, and depth gradients, generating a high-precision single-channel depth map. This provides crucial prior information on spatial structure for subsequent processes. Model tuning: The Zoe Depth Anything model is typically used as a pre-trained model. The "tuning" here refers to its input being a high-resolution image enhanced with Flux. This ensures that the texture and edge information upon which depth estimation is based is clearer and more reliable, thereby improving the quality and accuracy of the depth map. Input Enhancement Image: Input the high-fidelity style image (high resolution and enhanced texture details) of the Flux model into the adjusted Zoe Depth Anything model. 3D structure analysis: Based on the input high-resolution image, the model analyzes the 3D spatial structure of the image, specifically including the positional relationships between objects, occlusion levels, and depth gradients. Output a single-channel depth map: Through the above analysis process, a single-channel depth map is finally generated, completing the core output of the deep understanding stage. Step 3: Generate ControlNet+Flux-IPAdapter architecture bootstrapping sketch ControlNet Structure Optimization: Input the depth map generated in step 2 into the ControlNet model. The ControlNet model uses depth information as a strong condition to finely adjust and enhance the overall composition, object outlines and spatial perspective of the original image (i.e., the style map after Flux redrawing), and outputs an image with a more reasonable structure, stronger three-dimensionality and conformity to depth constraints. The aforementioned adjustments and enhancements: 1: Deep Information Analysis and Conditional Mapping The ControlNet model first performs pixel-level parsing on the input single-channel depth map: Extract the depth level corresponding to the grayscale value of different pixels in the depth map (for example, the closer the grayscale value is to white, the closer the object is to the observer; the closer it is to black, the farther away it is). These depth levels are transformed into "structural constraints" that the model can recognize, and a mapping relationship between "depth value and spatial location" is established (for example, the pixel range of foreground objects, midground transition areas, and background areas is marked). The grayscale value originates from the pixel quantization of the single-channel depth map. The core process is to map the original depth value (physical distance quantization data) output by the Zoe Depth Anything model to grayscale levels (pixel brightness values) ranging from 0 to 255. This represents the visualization and standardization result of the depth map. The "3D spatial structure" in the previous step (S20) does not directly contain grayscale values—the 3D spatial structure is abstract information parsed by the model (object positional relationships, occlusion levels, depth gradients), while the grayscale value is a concrete transformation of the "original depth value" within that structure (e.g., smaller depth value → closer object → brighter grayscale value; larger depth value → farther object → darker grayscale value). 2: Adaptive adjustments to the overall composition Optimize the composition of high-fidelity style images by using depth information as a constraint: Region boundary correction: Based on the foreground / background boundaries marked on the depth map, adjust any compositional imbalances that may exist in the high-fidelity style map (for example, if the depth map shows that the foreground object occupies too much space, the model will reduce the pixel range of the corresponding object in the style map to avoid the image being crowded; if the depth map shows that the background space is insufficient, the background area of ​​the style map will be expanded and texture details will be added). Center of gravity alignment: Based on the position of the core object in the depth map (the area with the highest depth value in the middle level), the visual center of gravity of the style map is corrected (for example, if the core object in the depth map is located on the left side of the image, the model will adjust the core object that is offset in the style map to the corresponding left area to ensure that the composition center of gravity matches the depth structure). 3: Precise enhancement of object outlines Enhance the clarity and accuracy of object outlines in style maps using depth information: Contour edge localization: Locate the contour edge of the object in the style image by using the "sudden change in gray value between adjacent pixels" in the depth image (representing the turning point of the object's surface or the occlusion boundary between different objects). For example, the gray value change between the foreground person and the background wall in the depth image corresponds to the contour line position of the person in the style image. Contour detail completion and sharpening: Enhance blurry edges that do not match the contour in the style map and the depth map (for example, if the figure contour in the style map is blurred due to stylization, the model will complete the blurry contour pixels based on the depth boundary of the arm in the depth map, and improve the contour clarity through the edge sharpening algorithm to avoid the contour from being disconnected from the depth structure). 4: Correction of spatial perspective relationships Based on the depth gradient of the depth map (the rate of change of depth values ​​in adjacent regions), the perspective rationality of the style map is corrected: Perspective ratio adjustment: Calculate the perspective ratio of objects appearing larger when closer and smaller when farther away based on the depth gradient (for example, if the depth gradient of foreground objects is large in the depth map, the size of the corresponding objects in the style map needs to be enlarged proportionally; if the depth gradient of background objects is small, the size needs to be reduced proportionally), and correct any "perspective distortion" that may exist in the style map (such as distant objects being too large and foreground objects being too small). Occlusion correction: Based on the "occlusion level" marked in the depth map (for example, if the gray value of the foreground object covers the background object in the depth map, it means that the foreground occludes the background), correct the incorrect occlusion relationship in the style map (for example, if the background trees "penetrate" the foreground person in the style map, the model will delete the pixels in the trees that are occluded by the person based on the occlusion logic of the depth map, and fill in the outline details of the person to ensure that the occlusion relationship is consistent with the depth structure). Step 3.1: Deep Information Analysis and Conditional Mapping The ControlNet model first performs pixel-level parsing on the input single-channel depth map: Extract the depth level corresponding to the grayscale value of different pixels in the depth map (for example, the closer the grayscale value is to white, the closer the object is to the observer; the closer it is to black, the farther away it is). These depth levels are transformed into structural constraints that the model can recognize, establishing a mapping relationship between "depth value → spatial location" (e.g., labeling the pixel ranges of foreground objects, midground transition areas, and background regions). The depth values ​​are derived from the ZoeDepth Anything model output. The brighter the grayscale (the lighter the color), the smaller the depth value (the closer the distance), and the closer the object. The darker the grayscale (the deeper the color) → the greater the depth value (the farther the distance) → the farther away the object is; The mapping relationship between depth values ​​and spatial locations is used to associate the depth value (grayscale value) of each pixel in a single-channel depth map with its actual spatial location in the image, providing a basis for subsequent composition optimization and enabling the system to understand the three-dimensional spatial structure of the image. In a single-channel depth map, the gray value of each pixel represents the depth information at that location (for example, the higher the gray value, the closer the location is to the observer). The ControlNet model parses this depth map, extracts the depth level of each pixel, and transforms the depth level into structural constraints to establish a mapping relationship between depth values ​​and spatial locations. This mapping relationship is used in S32 to guide the system in optimizing the composition of high-fidelity style maps. Step 3.2: Adaptive adjustments to the overall composition Optimize the composition of high-fidelity style images by using depth information as a constraint: Depth information refers to the depth level information extracted in step 3.1, and the structural constraints derived from these depth levels. It includes: the depth levels corresponding to the grayscale values ​​of different pixels extracted from the single-channel depth map, the structural constraints derived from the depth levels, and the depth information system established through the mapping relationship between depth values ​​and spatial locations; Region boundary correction: Based on the foreground / background boundaries marked on the depth map, adjust for potential "compositional imbalance" issues in the high-fidelity style map (for example, if the depth map shows that the foreground object occupies too much space, the model will reduce the pixel range of the corresponding object in the style map to avoid a crowded image; if the depth map shows that the background space is insufficient, the background area of ​​the style map will be expanded and texture details will be added). Center of gravity alignment: Based on the position of the "core object" (the area with the highest depth value in the middle layer) in the depth map, the visual center of gravity of the style map is corrected (for example, if the core object in the depth map is located on the left side of the image, the model will adjust the core object that is offset in the style map to the corresponding left area to ensure that the composition center of gravity matches the depth structure). Step 3.3: Precise Enhancement of Object Contours Enhance the clarity and accuracy of object outlines in style maps using depth information: Contour edge localization: Locate the contour edge of the object in the style image by using the "sudden change in gray value between adjacent pixels" in the depth image (representing the turning point of the object's surface or the occlusion boundary between different objects). For example, the gray value change between the foreground person and the background wall in the depth image corresponds to the contour line position of the person in the style image. Method for obtaining "the point where the grayscale value of adjacent pixels changes abruptly": First, obtain the grayscale image of the style map; calculate the gradient (grayscale change rate) of each pixel; use depth information (derived from the mapping relationship between depth values ​​and spatial location) as a constraint; use the depth information to determine which gradient abrupt changes are the true object contours; for example, if the depth value changes significantly at a certain point (from near to far or from far to near), then the grayscale abrupt change at that point is more likely to correspond to the object contour. Contour detail completion and sharpening: Enhance "blurred edges that do not match the contour of the depth map" in the style map (for example, if the outline of a person in the style map is blurred due to stylization, the model will complete the blurred outline pixels based on the depth boundary of the arm in the depth map, and improve the clarity of the outline through the edge sharpening algorithm to avoid the outline from being disconnected from the depth structure). Step 3.4: Correction of spatial perspective relationships Based on the "depth gradient" (the rate of change of depth values ​​in adjacent regions) of the depth map, the perspective rationality of the style map is corrected: Perspective ratio adjustment: Calculate the "near is larger and far is smaller" perspective ratio based on the depth gradient (for example, if the depth gradient of the foreground object in the depth map is large, the size of the object in the corresponding style map needs to be enlarged proportionally; if the depth gradient of the background object is small, the size needs to be reduced proportionally), and correct any "perspective distortion" that may exist in the style map (such as distant objects being too large and foreground objects being too small). Occlusion correction: Based on the "occlusion level" marked in the depth map (for example, if the gray value of the foreground object covers the background object in the depth map, it means that the foreground occludes the background), correct the incorrect occlusion relationship in the style map (for example, if the background trees "penetrate" the foreground person in the style map, the model will delete the pixels in the trees that are occluded by the person based on the occlusion logic of the depth map, and fill in the outline details of the person to ensure that the occlusion relationship is consistent with the depth structure). Flux-IPAdapter Stylized Sketch Generation: Input the ControlNet-optimized image into Flux-IPAdapter. This component combines the powerful multimodal feature alignment capabilities of IPAdapter with Flux's generative framework. Based on the optimized structural information, it extracts and fuses the core visual features (color, texture, brushstrokes) of the original style map to generate a "transfer sketch." This sketch retains the precise structure of the ControlNet-optimized image while incorporating the initial nuances of the target style (such as line style and basic color tones), providing a clear structural and style-oriented framework for the final style transfer. In simple terms, the structural information is the skeleton of the image after optimization in steps 3.1-3.2, while the original visual features of the "style reference image" are the skin. Flux-IPAdapter merges the skeleton and skin to generate a transfer sketch that retains the original image composition while having a new style. Step 4: Deeply Guided Style Migration with Redux Function and Combination Method: Perform final style blending and rendering on the stylized transfer sketch generated in step 3: Style Feature Extraction (In-depth Analysis): First, the CLIP Vision model is used to perform in-depth analysis of the high-fidelity style map. Extract key style parameters: color distribution, brushstroke characteristics, texture details, and lighting techniques. For example, if the high-fidelity style image is Van Gogh's "Starry Night", CLIP will extract features such as "swirling brushstrokes" and "bright blue tones"; Extract preliminary style information from the transferred sketch; this sketch already contains depth information and optimized outlines. For example, the sketch may be a simple line drawing, but it already contains the correct spatial structure and object positions. Style fusion (core steps): Using FluxGuidance as the core node, the two types of information are merged. This process is like a palette, where high-fidelity style paint (style characteristics) is evenly applied to the canvas structure information of the transferred sketch. Rendering generation: Image generation is performed using VAE (Variational Autoencoder) and UNet (the core component of the diffusion model); KSampler is responsible for noise sampling to ensure consistency in style and structure; During the generation process, the system remembers the structure (depth information and outline) of the transferred sketch and only changes its style; The FLUX Redux modeling tool performs an in-depth analysis of all style feature parameters (precise color distribution, complex texture patterns, unique brushstroke styles, etc.) of the original high-resolution style map, and combines them with the preliminary style information contained in the sketch itself. Step 5: Fine-tuning the details of the LoRA model Function and Integration: Refines local details in the Redux output image. Utilizing LoRA technology, it fine-tunes only a few key parameters in the model, including: color style parameters (such as Lab channel weights, color distribution statistics, and color banding repair parameters) to ensure the hue matches the target style. Figure 1 The parameters include: texture and brushstroke style parameters (such as brushstroke thickness / density / direction, texture scale and contrast, matching the texture details of the target style), spatial style adaptation parameters (such as style-structure fusion weight, object edge style feathering parameters, balancing the structural compatibility of style and preliminary style map), style embedding alignment parameters (such as embedding distance parameters, style category weight parameters, quantifying the matching of the target style essence from the bottom layer), and text-image alignment parameters (such as text style feature mapping weight, local style enhancement parameters, echoing the Flux dual-guide mechanism, allowing the style described in the text to be translated into image parameters). Model tuning: The LoRA model is specifically trained using the target style map. Conditional fine-tuning is performed. The core component of the target style map is the high-fidelity style map output by S1. Supplementary source: A style-related extended dataset of the style reference map. Data Preprocessing: Size Normalization: All images are uniformly adjusted to 1024×1024. Style Enhancement Strategies: Micro-adjustment of brightness (±5%, to avoid disrupting color style); Horizontal Flip (ensure the style is non-directional; for example, ink wash paintings can be flipped, but calligraphy cannot); Slight Scaling (±10%, to preserve the complete structure). Text Tag Supplementation: Add refined style description tags to each target style image. The tags must include "style type + core element + detailed features" to help LoRA accurately locate key style points. The core element is the most recognizable core visual subject or iconic element in the target style map, which is the "skeleton" of the style; the detailed features are the subtle visual expressions that support the core element and reflect the texture of the style, which is the "texture" of the style. Training iterations: Learning rate: initial 5e-5 to 2e-4. Mixed precision: Force FP16 enabled; Iteration termination condition: Bach distance (color distribution): Continuing the S72 logic, it must be ≤0.12. Subjective verification: Randomly select 10 generated images to ensure that their style details (such as brushstrokes and textures) are visually indistinguishable from the target style image. Key parameters specifically include: color style parameters (such as Lab channel weighting coefficients, color distribution statistics parameters, and color banding repair parameters, to ensure that the hue matches the target style). Figure 1 The parameters include: texture and brushstroke style parameters (such as brushstroke thickness / density / direction, texture scale and contrast, matching the texture details of the target style), spatial style adaptation parameters (such as style-structure fusion weight, object edge style feathering parameters, balancing the structural compatibility of style and preliminary style map), style embedding alignment parameters (such as embedding distance parameters, style category weight parameters, quantifying the matching of the target style essence from the bottom layer), and text-image alignment parameters (such as text style feature mapping weight, local style enhancement parameters, echoing the Flux dual-guide mechanism, allowing the style described in the text to be translated into image parameters). Step 6: TTP block segmentation + Florence model + Flux redrawing (multi-scale optimization stage) By upsampling the image by 2 pixels and then using TTP block segmentation technology to divide it into sub-blocks to avoid the memory limitations of large-size image processing, the Florence model is used to infer the deep semantic structure information such as object contours and region segmentation of each sub-block. Finally, based on this semantic understanding, the Flux algorithm is applied to redraw each sub-block in a targeted manner, optimizing its internal structure and style fusion effect and paying attention to the visual transition between blocks to avoid seams. First, each sub-block undergoes adaptation preprocessing (normalizing the sub-block size to the resolution supported by Florence, adding global context coordinate labels to the sub-blocks to preserve positional associations, and supplementing edge information of adjacent sub-blocks to avoid semantic breaks). After preprocessing, the data is input into the Florence model, allowing the model to accurately deduce deep semantic structure information, including object contours (such as contour vertex coordinates) and region segmentation (such as pixel masks of different regions). After obtaining this semantic information, it is not simply input into the "semantic understanding" stage, but is transformed into three types of strong constraints for the Flux algorithm: locking the redraw boundary with the object contour as the structural anchor point (avoiding object deformation), matching differentiated style weights with region segmentation (such as using corresponding style strokes for different regions), and optimizing the edge pixels between blocks by combining global context indexes (eliminating seams). Finally, based on these semantic constraints, each sub-block is redrawn using the Flux algorithm, achieving the effects of optimized internal structure of sub-blocks, accurate style fusion, and visual coherence between blocks. Instead of directly inputting the sub-blocks after TTP segmentation into the Florence model for semantic information analysis, each sub-block needs to undergo adaptation preprocessing (normalizing the sub-block size to the resolution supported by Florence, adding global context coordinate labels to the sub-blocks to preserve positional associations, and supplementing edge information of adjacent sub-blocks to avoid semantic breaks). After preprocessing, the data is input into the Florence model, allowing the model to accurately deduce deep semantic structure information, including object contours (such as contour vertex coordinates) and region segmentation (such as pixel masks of different regions). After obtaining this semantic information, it is not simply input into the "semantic understanding" stage, but rather transformed into three types of strong constraints for the Flux algorithm: locking the redraw boundary with the object contour as the structural anchor point (avoiding object deformation), matching differentiated style weights with region segmentation (such as using corresponding style strokes for different regions), and optimizing the edge pixels between blocks by combining global context indexes (eliminating seams). Finally, based on these semantic constraints, each sub-block is redrawn using the Flux algorithm, achieving the effects of optimized internal structure of sub-blocks, accurate style fusion, and visual coherence between blocks. Based on the deep semantic structure information (object outline, region segmentation) of the sub-blocks output by the Florence model, it is first transformed into strong constraints of the Flux algorithm. The core shape within the sub-block is locked with the object outline coordinates as structural anchor points, and the style-adaptive region is divided by the region segmentation mask. Then, the Flux algorithm is applied to redraw each sub-block: when optimizing the internal structure, the details of deformation within the sub-block are corrected according to semantics (such as filling in the blurred object outline edges and calibrating the misaligned region segmentation boundaries) to ensure that the structure matches the semantics; when achieving style fusion, the sub-blocks are segmented into different regions to match the target style features (such as using delicate brushstrokes for the character area and large-area shading for the background area) so that the style accurately fits the content of the sub-blocks; when processing the visual transition between blocks, the edge pixels of adjacent sub-blocks are extracted by combining the coordinate labels of the TTP blocks to construct the edge transition zone. The color grayscale, texture density and brushstroke direction within the transition zone are adjusted simultaneously to make the edges of adjacent sub-blocks connect naturally and avoid visual seams. The target style feature acquisition method is as follows: The user first provides a style reference image (such as a daily photo in the style of Xiaohongshu, or a painting by Van Gogh). Flux-IPAdapter extracts the original visual features (including color distribution, brush stroke features, texture details, etc.) from this style reference image. These extracted original visual features are used as target style features and matched to each sub-block. Step 7: Histogram matching technique 1. Lab color space channel matching mechanism Performing histogram matching in the Lab color space essentially leverages the space's "luminance-color separation" characteristic: The style reference image and the optimized style image undergo a simultaneous conversion from the original color space (such as RGB) to the Lab color space. The style reference image must be used as a separate comparison benchmark input in order to achieve the goal of consistent brightness and hue between the optimized style image and the style reference image. The L* channel independently controls the brightness distribution, ensuring the contrast and style reference of the generated image. Figure 1 To avoid overly bright or dark colors due to style transfer; Channels a and b correspond to the green-red and blue-yellow color axes, respectively. By matching channels separately, the hue shift can be precisely controlled. For example, when transferring the "Van Gogh blue" or "Monet green" of the reference image to the generated image, color mixing distortion can be avoided. 2. Precision control of Bhattacharyya Distance Bach distance is used to quantify the color distribution similarity between a generated image and a reference image. The formula is:

[0006] Where p(x) is the optimized style map to be matched, and q(x) is the histogram probability distribution of the reference map. The histogram probability distribution of the style reference map is generated through three steps: color space conversion → histogram statistics → probability normalization. When DB≤0.15, it means: The color distribution differences are so small that the color deviation cannot be distinguished by the naked eye. DB≤0.15 is the standard for color distribution matching. The style map after adjustment is retained for DB≤0.15, and secondary processing is only performed on the case of DB>0.15. The core function of color distribution similarity quantified by Bach distance is to provide an objective and quantifiable standard for judging strong similarity in style transfer, thus avoiding the bias of relying solely on subjective human judgment of whether colors are consistent. 3. Gaussian smoothing enhancement strategy (σ=1.0) The core function of color distribution similarity quantified by Bach distance is to provide an objective and quantifiable standard for judging strong similarity in style transfer, thus avoiding the bias of relying solely on subjective human judgment of whether colors are consistent. The core function of applying Gaussian smoothing to the histogram of the style reference map using digital image processing algorithms is: Eliminate color banding: Avoid uneven color transitions caused by histogram discretization (such as stripes appearing in the gradient of the sky from blue to purple). A Gaussian kernel width of σ=1.0 can balance the smoothing effect and detail preservation. σ (standard deviation): This is the core indicator controlling the smoothing strength of the Gaussian kernel. The smaller σ is, the more concentrated the weights of the Gaussian kernel are in the center (smaller influence range on adjacent areas, weaker smoothing strength, and more detail retention); the larger σ is, the more dispersed the weights are (larger influence range, stronger smoothing strength, and easier blurring of details). Color entropy reflects the color richness of an image. By smoothing rather than hard-cropping the histogram, we ensure that the color diversity of the generated image is close to that of the reference image. The histogram probability distribution of the style reference image is generated through three steps: color space conversion, histogram statistics, and probability normalization. The technical solutions provided in this application embodiment have at least the following technical effects or advantages: This application embodiment provides a method, apparatus, device and medium for generating strong similarity based on style transfer, which can make slight changes to the content of the image while strictly transferring the style. Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes. While specific embodiments of the present invention have been described above, those skilled in the art should understand that the specific embodiments described are merely illustrative and not intended to limit the scope of the invention. Equivalent modifications and variations made by those skilled in the art in accordance with the spirit of the invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for generating strong similarity based on style transfer, characterized in that, Includes the following steps: S10. Redraw the style reference image and output a clear style image; S20. Input the sharp style map into the monocular depth estimation model and output a single-channel depth map; S30. Input the single-channel depth map into the enhanced image generation model for structural optimization to generate a transfer sketch. S40. The visual feature extraction model and deep learning model are used to perform style fusion and rendering on the transcribed sketch to generate a preliminary style map; S50. Pre-train the LoRA model, and use the LoRA model to adjust the initial style map to output an intermediate style map; S60. After upsampling the intermediate style map, perform block optimization and output the optimized style map; S70. Input the optimized style map into the Lab color space, perform histogram matching, and generate the final style map.

2. The method for generating strong similarity based on style transfer according to claim 1, characterized in that, Specifically, S10 is: The style reference map is redrawn using the Flux model to enhance its texture details and output a clear style map. The texture details include line sharpness and color transition smoothness; Specifically, in S20: The sharp style map is input into the monocular depth estimation model, the three-dimensional spatial structure of the sharp style map is analyzed, a single-channel depth map is generated, and the original depth value of the single-channel depth map is output. Specifically, S30 is: S31. Input the single-channel depth map into the ControlNet model: Convert the original depth value into a grayscale value; The original depth value is pre-processed to obtain the processed depth value; Extract the depth levels corresponding to the grayscale values ​​of different pixels in the single-channel depth map, and establish a mapping relationship between processing depth values ​​and spatial positions; label the foreground and background boundaries in the single-channel depth map; label the occlusion levels in the single-channel depth map; and package the depth levels, mapping relationship, foreground and background boundaries, and occlusion levels into depth information. S32. Optimize the clear style map based on the depth information: Adjust the foreground and background boundaries in the sharp style map based on the foreground and background boundaries marked in the single-channel depth chart; Based on the position of the core object in the single-channel depth map, the visual center of gravity of the clear style map is corrected. The core object is the area with the highest processing depth value at a set level. Output depth information to enhance the style map; S33. Based on the depth information, enhance the object contour using the depth information enhancement style map: S331. Obtain the grayscale image of the depth information enhancement style map, calculate the grayscale value change rate of each pixel in the grayscale image, and record the grayscale value change rate that is greater than a set threshold as the grayscale value change point. Using the depth information as a constraint, the grayscale value abrupt change that meets the set conditions is identified as the object outline; S332. Enhance and complete the blurred contour edges in the depth information enhancement style map to improve the contour clarity of the depth information enhancement style map; S34. Adjust the perspective ratio of the enhanced style map based on the depth gradient of the enhanced style map, correct the occlusion level of the enhanced style map according to the occlusion level of the single-channel depth map, and output the adjusted intermediate image. S35. Input the intermediate adjustment image and style reference image into the Flux-IPAdapter model, extract the visual features of the intermediate adjustment image and style reference image and fuse them to generate a transfer sketch.

3. The method for generating strong similarity based on style transfer according to claim 1, characterized in that, In step S40, the FLUX Redux model is used to perform style blending and rendering on the transferred sketch, specifically as follows: S41. Input the clear style map into the CLIP Vision model and extract key style parameters, including color distribution, brushstroke features, texture details and lighting processing methods. S42. Input the transferred sketch into the CLIP Vision model and extract preliminary style information, which includes depth information and optimized contour edges. S43. Input the key style parameters and preliminary style information into the FluxGuidanc model, use VAE and UNet to generate images in collaboration, use KSampler to sample noise during the generation process, and generate a preliminary style map. Specifically, S50 is: S51. Pre-train the LoRA model using the target style map: The target style map includes a clear style map and a style reference map extended dataset of the same style. S511. Preprocess the target style map: Adjust the target style images to the same size, adjust the brightness by ±5%, and horizontally flip the unoriented target style images; scale the target style images by ±10%; add style description tags to each target style image, the style description tags including style type, core elements and detailed features; S512. Train the model parameters of the LoRA model using the preprocessed target style map, and perform iterative optimization: The model parameters include: color style parameters, texture and brushstroke style parameters, spatial style adaptation parameters, styleEmbedding alignment parameters, and text-image alignment parameters. The initial learning rate for the training is 5e-5 to 2e-4, and the mixed precision for the training is FP16. Iteration termination condition: Use the Bach distance test. If the Bach distance between the target style map and the model-generated map is ≤0.12, then randomly select 10 model-generated maps and manually compare their differences with the target style map. If there is no difference, then terminate the iterative training. S52. The preliminary style map is adjusted using the pre-trained LoRA model to output an intermediate style map; Specifically, S60 is as follows: S61. Upsample the intermediate style map by 2 pixels, and then divide the intermediate style map into sub-blocks using the TTP block division technique. S62. Perform semantic adaptation preprocessing on each of the sub-blocks; S63. Input the preprocessed sub-blocks into the Florence model to extract deep semantic structure information; S64. The deep semantic structure information is transformed into strong constraints of the Flux algorithm, and each sub-block is redrawn based on the strong constraints. S65. Join and merge the redrawn sub-blocks, optimize the edge connection of adjacent sub-blocks; output the optimized style map.

4. The method for generating strong similarity based on style transfer according to claim 1, characterized in that, Specifically, S70 is: S71. Input the style reference image into the Lab color space, and then input the optimized style image into the Lab color space. The L channel of the Lab color space independently controls the brightness distribution to ensure that the brightness and darkness contrast of the optimized style image is consistent with the style reference image; output the optimized style image after color adjustment. S72. Convert the style reference image from RGB color space to HSV color space to obtain the histogram of the style reference image, perform histogram statistics on the style reference image, and then perform probability normalization to generate the histogram probability distribution of the style reference image. S73. Use Bach distance to calculate the color distribution similarity between the optimized style map and the style reference map after color adjustment: DB stands for Bach distance. p ( x () represents the optimized style map to be matched. q ( x () is the histogram probability distribution of the style reference map; retain the optimized style map with DB≤0.15, and repeat the processing of S71 to S73 for DB>0.15; S74. Perform Gaussian smoothing on the histogram of the style reference map to eliminate color banding. The standard deviation of the Gaussian kernel width σ = 1.

0. Output the final style map.

5. A style transfer-based strong similarity generation device, characterized in that, Includes the following modules: The reference image redrawing module redraws the style reference image and outputs a clear style image. The deep understanding module inputs the sharp style map into the monocular depth estimation model and outputs a single-channel depth map. The structure optimization module inputs the single-channel depth map into the enhanced image generation model for structure optimization, generating a transfer sketch. The fusion rendering module uses a visual feature extraction model and a deep learning model to perform style fusion and rendering on the transferred sketch, generating a preliminary style map. The LoRA model module pre-trains a LoRA model, which is used to adjust the initial style map and output an intermediate style map. The block optimization module upsamples the intermediate style map, performs block optimization, and outputs an optimized style map. The final generation module inputs the optimized style map into the Lab color space, performs histogram matching, and generates the final style map.

6. The style transfer-based strong similarity generation device according to claim 5, characterized in that, The reference drawing redrawing module specifically includes: The style reference map is redrawn using the Flux model to enhance its texture details and output a clear style map. The texture details include line sharpness and color transition smoothness; The deep understanding module specifically includes: The sharp style map is input into the monocular depth estimation model, the three-dimensional spatial structure of the sharp style map is analyzed, a single-channel depth map is generated, and the original depth value of the single-channel depth map is output. The structural optimization module specifically includes: The pixel-level resolution unit inputs the single-channel depth map into the ControlNet model: Convert the original depth value into a grayscale value; The original depth value is pre-processed to obtain the processed depth value; Extract the depth levels corresponding to the grayscale values ​​of different pixels in the single-channel depth map, and establish a mapping relationship between processing depth values ​​and spatial positions; label the foreground and background boundaries in the single-channel depth map; label the occlusion levels in the single-channel depth map; and package the depth levels, mapping relationship, foreground and background boundaries, and occlusion levels into depth information. The depth information enhancement unit optimizes the sharp style map based on the depth information: Adjust the foreground and background boundaries in the sharp style map based on the foreground and background boundaries marked in the single-channel depth chart; Based on the position of the core object in the single-channel depth map, the visual center of gravity of the clear style map is corrected. The core object is the area with the highest processing depth value at a set level. Output depth information to enhance the style map; The contour enhancement unit enhances the object contour by enhancing the style map based on the depth information: The mutation subunit acquires a grayscale image of the depth information enhancement style map, calculates the grayscale value change rate of each pixel in the grayscale image, and records the grayscale value mutation point where the grayscale value change rate is greater than a set threshold. Using the depth information as a constraint, the grayscale value abrupt change that meets the set conditions is identified as the object outline; The clarity subunit enhances and completes the blurred contour edges in the depth information enhancement style map, thereby improving the contour clarity of the depth information enhancement style map. The layer adjustment unit adjusts the perspective ratio of the depth information enhancement style map based on the depth gradient of the depth information enhancement style map, corrects the occlusion level of the depth information enhancement style map according to the occlusion level of the single-channel depth map, and outputs the adjusted intermediate image. The feature fusion unit inputs the intermediate adjustment image and the style reference image into the Flux-IPAdapter model, extracts the visual features of the intermediate adjustment image and the style reference image, and fuses them to generate a transfer sketch.

7. The style transfer-based strong similarity generation device according to claim 5, characterized in that, In the fusion rendering module, the FLUX Redux model is used to perform style fusion and rendering on the transferred sketch, specifically as follows: The style parameter extraction unit inputs the clear style map into the CLIP Vision model and extracts key style parameters, including color distribution, brushstroke features, texture details, and lighting and shadow processing methods. The sketch parameter extraction unit inputs the transferred sketch into the CLIP Vision model and extracts preliminary style information, which includes depth information and optimized contour edges. The preliminary style map unit inputs the key style parameters and preliminary style information into the FluxGuidanc model, uses VAE and UNet to generate images, and uses KSampler to sample noise during the generation process to generate a preliminary style map. The LoRA model module is specifically as follows: Pre-training unit: The LoRA model is pre-trained using the target style map. The target style map includes a clear style map and a style reference map extended dataset of the same style. The data preprocessing subunit preprocesses the target style map: Adjust the target style images to the same size, adjust the brightness by ±5%, and horizontally flip the unoriented target style images; scale the target style images by ±10%; add style description tags to each target style image, the style description tags including style type, core elements and detailed features; The iterative optimization subunit trains the LoRA model parameters using the preprocessed target style map and performs iterative optimization: The model parameters include: color style parameters, texture and brushstroke style parameters, spatial style adaptation parameters, styleEmbedding alignment parameters, and text-image alignment parameters. The initial learning rate for the training is 5e-5 to 2e-4, and the mixed precision for the training is FP16. Iteration termination condition: Use the Bach distance test. If the Bach distance between the target style map and the model-generated map is ≤0.12, then randomly select 10 model-generated maps and manually compare their differences with the target style map. If there is no difference, then terminate the iterative training. The parameter adjustment unit uses a pre-trained LoRA model to adjust the initial style map and outputs an intermediate style map. The block optimization module specifically includes: Divide the image into sub-blocks, upsample the intermediate style map by 2 pixels, and then divide it into sub-blocks using TTP block division technology; The adaptation preprocessing unit performs adaptation preprocessing on each sub-block; The semantic units are reversed, and the preprocessed sub-blocks are input into the Florence model to extract deep semantic structure information; The constraint unit transforms the deep semantic structure information into strong constraints of the Flux algorithm, and redraws each sub-block based on the strong constraints. The edge optimization unit stitches and merges the redrawn sub-blocks, optimizing the edge connection between adjacent sub-blocks; and outputs an optimized style map.

8. The style transfer-based strong similarity generation device according to claim 5, characterized in that, The final generation module is specifically: The color adjustment unit inputs the style reference image into the Lab color space, and then inputs the optimized style image into the Lab color space. The L channel of the Lab color space independently controls the brightness distribution to ensure that the brightness and darkness contrast of the optimized style image is consistent with the style reference image. Output an optimized style image with adjusted colors; The histogram unit converts the style reference image from the RGB color space to the HSV color space to obtain the histogram of the style reference image, performs histogram statistics on the style reference image, and then performs probability normalization to generate the histogram probability distribution of the style reference image. The DB unit uses Bach distance to calculate the color distribution similarity between the optimized style map and the style reference map after color adjustment. DB stands for Bach distance. p ( x () represents the optimized style map to be matched. q ( x The histogram probability distribution of the style reference map is used; optimized style maps with DB≤0.15 are retained, and the color adjustment unit is repeated to the DB unit for DB>0.15; The Gaussian unit performs Gaussian smoothing on the histogram of the style reference map to eliminate color banding. The standard deviation of the Gaussian kernel width is σ=1.0; the final style map is then output.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 4.