A text-to-image diffusion model inference optimization method based on reflection fine-tuning

CN122966759APending Publication Date: 2026-10-23THE CHINESE UNIVERSITY OF HONG KONG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510463302.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

尽管取得了这些成功,但它们在不同领域的性能表现仍存在差异,尤其是在生成复杂人体姿势、多物体组合场景,或具有复杂光照和阴影的场景时

Benefits of technology

[0032]本发明提出一种基于反思微调的文本到图像扩散模型推理优化方法,通过构建包含大量三元组且覆盖多领域的GenRef反思数据集,为模型反思级扩展提供有力支持,通过联合多模态注意力机制对预训练模型微调得到校正器模型,避免引入额外模块,设计了推理时间框架ReflectionFlow,在推理阶段,从噪声级、提示级、反思级三个互补维度优化图像,能充分探索图像多样性、实现精确语义引导并迭代提升图像质量。该方法以全新的迭代反思自优化框架,让扩散模型有效利用推理时的额外计算资源,在不依赖大规模额外训练的情况下,显著优于简单噪声级缩放方法,在挑战性任务中实现更高质量图像合成,还能灵活权衡搜索宽度和反思深度,适应不同需求,同时解锁了模型的推理能力,在复杂场景和精细细节处理上表现出色。本发明的方法能够显著提升文本到图像扩散模型在复杂场景和精细细节生成上的性能,为高质量图像合成提供了一种可扩展且计算高效的解决方案。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122966759A_ABST
    Figure CN122966759A_ABST
Patent Text Reader

Abstract

A text-to-image diffusion model inference optimization method based on reflection fine-tuning, including: first, constructing a large-scale reflection dataset containing multi-domain triples, providing support for model reflection level expansion. Then, based on this dataset, fine-tune the pre-trained model using a joint multi-modal attention mechanism to obtain a corrector model that can generate optimized images based on text reflection and flawed images. In the inference stage, optimization is performed through three complementary dimensions: noise level expansion to explore image diversity, prompt level expansion to achieve precise semantic guidance, and reflection level expansion to iteratively improve image quality. In each iteration, the corrector model generates new candidate images in combination with the optimization prompts and the images from the previous iteration, which are filtered by the verifier and used for the next iteration, and finally a high-quality image is output. Experiments show that this method significantly outperforms the simple noise level expansion method, providing an extensible and computationally efficient solution for high-quality image synthesis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to computer vision and deep learning technologies, and in particular to an inference optimization method for a text-to-image diffusion model based on reflective fine-tuning. Background Technology

[0002] Recent advancements in text-to-image (T2I) diffusion models [10,14,24,50,58] have brought significant breakthroughs to the field of image synthesis. With the continuous expansion of training resources, these models are steadily improving their ability to generate high-resolution, realistic images. Despite these successes, their performance varies across different domains, especially when generating complex human poses, multi-object scenes, or scenes with complex lighting and shadows. According to existing scaling laws during training

[20] , to alleviate these limitations, it is necessary to increase the training computation, model parameters, and data size exponentially.

[0003] It should be noted that the information disclosed in the background section above is only for understanding the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0004] The main objective of this invention is to overcome the deficiencies in the aforementioned background technology and provide a text-to-image diffusion model inference optimization method based on reflective fine-tuning.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] A text-to-image diffusion model inference optimization method based on reflective fine-tuning includes the following steps:

[0007] S1. Constructing a reflection dataset:

[0008] Collect and construct a large-scale reflection dataset containing multiple triples, each triple including: a defective image, a high-quality image, and a textual reflection describing the defect of the defective image. The dataset covers multiple domains to support the reflective-level expansion of the model.

[0009] S2, Training the corrector model:

[0010] Based on the aforementioned reflection dataset, the pre-trained text-to-image diffusion model is fine-tuned to train a corrector model, which enables the corrector model to generate optimized images based on text reflection and defective images. The fine-tuning process is achieved through a joint multimodal attention mechanism without the need to introduce additional modules.

[0011] S3, Inference Optimization Framework:

[0012] During the inference phase, the generated image is optimized using the corrector model through the following three complementary dimensions:

[0013] Noise level expansion: Explore the diversity of generated images by using different initial noise samples to optimize potential initialization;

[0014] Prompt-level extension: Dynamically optimize text prompts based on input prompts and quality feedback of generated images to achieve precise semantic guidance;

[0015] Reflective-level extension: Iteratively evaluates and corrects previously generated images, progressively improving image quality. The iterative optimization process is based on the corrector model and text reflection.

[0016] S4. Generate optimized image:

[0017] In each iteration, the corrector model is used to generate a new set of candidate images by combining the optimized hints and the images generated in the previous iteration. The best image is selected by the validator as the input for the next iteration, and finally the optimized high-quality image is output.

[0018] Furthermore, in step S1, when constructing the reflection dataset: a large language model is used to list common object categories and their attributes; text prompts are constructed by combining them using a rule-based method, and samples are filtered to avoid overlap with existing benchmark samples; candidate images are generated for each prompt using a specific model; image attributes are verified and evaluated using a visual model with object detection and segmentation capabilities; and the accuracy of correct images is ensured using a multimodal large language model with visual understanding capabilities; the difficulty of the prompts is estimated based on the proportion of correctly generated samples; prompts with abnormal difficulty are discarded; the images with the highest and lowest scores among the remaining prompts are randomly paired to construct optimization pairs; text reflections are generated using a multimodal large language model; and data is collected from four data sources: rule-based data, reward-based data, long and short prompt data, and edit data, ultimately forming a large-scale reflection dataset containing data from multiple domains.

[0019] Further, in step S1, for the construction of reward-based triples: collect synthetic titles and general prompts generated by real users, generate candidate images for each prompt using a specific model; evaluate the image quality and alignment with the prompt based on an integrated scoring strategy of multiple reward models, construct optimized pairs by randomly pairing images from the first k and last k subsets of each prompt, and generate textual reflection instructions from aspects such as prompt alignment, aesthetic quality, and visual fidelity using a multimodal large language model.

[0020] Further, in step S1, for the construction of detail-short cue triples: the multimodal large language model is fine-tuned to condense the detailed cue annotations of the large language model into a short version, and the images generated from these two cues naturally form image pairs; the image pairs are selected using an integrated reward scoring method, and the multimodal large language model is used to generate reflective instructions.

[0021] Furthermore, in step S1, when expanding the dataset using existing image editing data: high-quality editing samples are selected from the OmniEdit dataset, and detailed synthetic captions are generated for these samples using a fine-tuned caption model; all generated re-instructions are rigorously cleaned and filtered in post-processing, and a representative subset of samples is manually checked to verify their correctness and consistency.

[0022] Furthermore, in step S2, when training the corrector model, the joint multimodal attention mechanism used is as follows: the text input, the defective image, and the optimized image are concatenated into a fusion sequence, so that Q, K, and V are obtained by linear projection from the concatenated labeled sequence, thereby realizing multimodal attention calculation, wherein the text input is a concatenation of the original input prompt and the reflection prompt.

[0023] Furthermore, in step S2, when training the corrector model, the text input, the defective image, and the optimized image are concatenated into a unified sequence, and Q, K, and V are obtained through linear projection. Multimodal attention is calculated using a multi-head self-attention mechanism to achieve bidirectional information exchange between different modalities without the need for additional specialized modules. The defective image serves as conditional information and can be further downsampled to improve the computational efficiency of training and inference. Standard diffusion or flow matching loss is applied to the optimized target image for training.

[0024] Furthermore, in step S2, the training strategy employed when training the corrector model includes: randomly discarding the original cue, reflection cue, and defective input images with a certain probability, wherein the reflection cue and defective images are discarded simultaneously with a relatively high probability; and using a "task warm-up" method to dynamically adjust the sampling probabilities of multiple data domains during training, initially increasing the sampling probability of edited data, and then gradually increasing the sampling probabilities of the three data domains other than edited data: rule-based data, reward-based data, and long / short cue data, in order to improve the overall performance of the model and compensate for the potential visual quality degradation problem in the edited data.

[0025] Furthermore, in step S3, when expanding the noise level: the number of different initial noise samples generated in each round of exploration is defined as the search width. By increasing the search width, the diversity in the distribution learned by the diffusion model is explored. However, since the initial noise generation processes are independent of each other and depend on the feedback of the task-related validators, simply increasing the search width may lead to diminishing returns in computational efficiency.

[0026] Furthermore, in step S3, during the cue-level expansion: in each iteration, using a multimodal large language model, based on the original user cue, the previously generated image and its evaluation score, the text cue is optimized without explicit gradient information to generate accurate and effective cue for subsequent image generation iterations.

[0027] Further, in step S4, when generating optimized images: first, a set of initial candidate images is generated using a generator implemented by unloading low-rank adaptation weights; at each iteration, a multimodal large language model validator is used to evaluate and rank the images generated in the previous iteration from multiple dimensions, and text reflections and user prompts are generated based on the evaluation scores and previously generated images; the reflected and improved prompts are input into a trained corrector model with low-rank adaptation to generate new candidate images; the validator is used to select the best image for each optimization chain, and then the best image is selected from all chains as the final output.

[0028] Further, in steps S3 and S4: given a text prompt and a text-to-image generator, the generator first generates an initial image; in each optimization iteration, the corrector model is used to generate an optimized image based on the image from the previous iteration, the original text prompt, and the text reflection describing previous shortcomings and directions for improvement; the text reflection is generated after the quality of the generated image is evaluated by an external evaluation module; the probability of finally generating an optimized image is the product of the initial image generation probability and the probability of the corrector model generating the corresponding image in each iteration. Through such an iterative process, candidate images are continuously generated and optimized by combining relevant factors, and a high-quality image is output.

[0029] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned text-to-image diffusion model inference optimization method based on reflective fine-tuning.

[0030] A computer program product includes a computer program that, when executed by a processor, implements the aforementioned text-to-image diffusion model inference optimization method based on reflective fine-tuning.

[0031] The present invention has the following beneficial effects:

[0032] This invention proposes a text-to-image diffusion model inference optimization method based on reflective fine-tuning. By constructing a GenRef reflective dataset containing a large number of triples and covering multiple domains, it provides strong support for reflective-level scaling of the model. A corrector model is obtained by fine-tuning the pre-trained model through a joint multimodal attention mechanism, avoiding the introduction of additional modules. An inference time framework, ReflectionFlow, is designed. During the inference phase, images are optimized from three complementary dimensions: noise level, cue level, and reflective level. This fully explores image diversity, achieves accurate semantic guidance, and iteratively improves image quality. This method, with its novel iterative reflective self-optimization framework, allows the diffusion model to effectively utilize the additional computational resources during inference. Without relying on large-scale additional training, it significantly outperforms simple noise-level scaling methods, achieving higher-quality image synthesis in challenging tasks. It also flexibly balances search width and reflective depth to adapt to different needs, while unlocking the model's inference capabilities, demonstrating excellent performance in complex scenes and fine-detail processing. This invention significantly improves the performance of text-to-image diffusion models in generating complex scenes and fine details, providing a scalable and computationally efficient solution for high-quality image synthesis.

[0033] Other beneficial effects of the embodiments of the present invention will be further described below. Attached Figure Description

[0034] Figure 1 This describes the overall flow of the ReflectionFlow framework in this embodiment of the invention, as well as the qualitative and quantitative results of the computational extension during inference.

[0035] Figure 2 This document describes the construction process and statistical information of the GenRef dataset in this embodiment of the invention.

[0036] Figure 3 This is a schematic diagram illustrating the scaling dimensions during three different inference processes of the text-to-image diffusion model in an embodiment of the present invention.

[0037] Figure 4 This is a visualization diagram of complex reasoning in an embodiment of the present invention. Starting from an initially incorrect generation (left side), ReflectionFlow iteratively reflects on and corrects errors, gradually generating images that are precisely aligned with the provided hints and reflection instructions.

[0038] Figure 5 This is a performance analysis diagram of an embodiment of the present invention. The left side shows the performance improvement of ReflectionFlow at different difficulty levels, and the right side shows the impact of increasing the inference budget on the GenEval score.

[0039] Figure 6 This is a flowchart of the text-to-image diffusion model inference optimization method based on reflective fine-tuning of the present invention. Detailed Implementation

[0040] The embodiments of the present invention will be described in detail below. It should be emphasized that the following description is merely exemplary and is not intended to limit the scope and application of the present invention.

[0041] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0042] Recent text-to-image diffusion models have achieved remarkable improvements in visual quality by massively expanding training data and model parameters. However, they often perform poorly when dealing with complex scenes and fine details. Inspired by the self-reflective capabilities emerging in large language models, this invention proposes a text-to-image diffusion model inference optimization method based on reflective fine-tuning, designing ReflectionFlow, an inference time frame that enables the diffusion model to iteratively reflect and optimize its output. ReflectionFlow introduces three complementary inference time expansion dimensions: (1) a noise-level expansion for optimizing latent initialization; (2) a cue-level expansion for precise semantic guidance; and most notably, (3) a reflective-level expansion that explicitly models actionable reflections to iteratively evaluate and correct previously generated images. This invention efficiently fine-tunes the state-of-the-art diffusion transformer FLUX.1dev within a unified framework by jointly modeling multimodal inputs. Experimental results show that ReflectionFlow significantly outperforms simple noise-level expansion methods, providing a scalable and computationally efficient solution for achieving higher-quality image synthesis in challenging tasks.

[0043] See Figure 6 This invention provides a text-to-image diffusion model inference optimization method based on reflective fine-tuning, comprising the following steps:

[0044] Step S1: Construct the reflection dataset:

[0045] Collect and construct a large-scale reflection dataset containing multiple triples, each triple including: a defective image, a high-quality image, and a textual reflection describing the defect of the defective image. The dataset covers multiple domains to support the reflection-level expansion of the model.

[0046] In some embodiments, during step S1, when constructing the reflection dataset: common object categories and their attributes are listed using a large language model (such as GPT-4), text prompts are constructed by combining them using a rule-based method, and samples are filtered to avoid overlap with existing benchmark samples; candidate images are generated for each prompt using a specific model, and image attributes are verified and evaluated using a visual model with object detection and segmentation capabilities (such as GroundedSAM), and the accuracy of correct images is ensured using a multimodal large language model with visual understanding capabilities (such as Qwen2.5VL); the difficulty of the prompts is estimated based on the proportion of correctly generated samples, prompts with abnormal difficulty are discarded, and the images with the highest and lowest scores among the remaining prompts are randomly paired to construct optimization pairs. Text reflections are generated using Qwen2.5-VL, and data is collected from four data sources: rule-based data, reward-based data, long and short prompt data, and edit data, ultimately forming a large-scale reflection dataset containing data from multiple domains.

[0047] In some embodiments, in step S1, for the construction of reward-based triples: collect synthetic titles and common cues generated by real users, generate candidate images for each cue using a specific model; evaluate the image quality and alignment with the cues based on an integrated scoring strategy of multiple reward models, construct optimized pairs by randomly pairing images from the first k and last k subsets of each cue, and generate textual reflection instructions using Qwen2.5-VL from aspects such as cue alignment, aesthetic quality, and visual fidelity.

[0048] In some embodiments, in step S1, for the construction of detail-short cue triples: the multimodal large language model is fine-tuned to condense the detailed cue annotations of the large language model (such as GPT-4) into a short version, and the images generated from these two cues naturally form image pairs; the image pairs are filtered using an integrated reward scoring method, and reflective instructions are generated using Qwen2.5-VL.

[0049] In some embodiments, when expanding the dataset using existing image editing data in step S1: high-quality editing samples are selected from model datasets with diverse image editing functions (such as OmniEdit), and detailed synthetic subtitles are generated for these samples using a fine-tuned subtitle model; all generated reflexive instructions are rigorously cleaned and filtered in post-processing, and a representative subset of samples is manually checked to verify their correctness and consistency.

[0050] Step S2: Train the corrector model:

[0051] Based on the aforementioned reflection dataset, the pre-trained text-to-image diffusion model is fine-tuned to train a corrector model, which enables the corrector model to generate optimized images based on text reflection and defective images. The fine-tuning process is achieved through a joint multimodal attention mechanism without the need to introduce additional modules.

[0052] In some embodiments, in step S2, when training the corrector model, the joint multimodal attention mechanism used is specifically as follows: the text input, the defective image, and the optimized image are concatenated into a fusion sequence, so that Q, K, and V are obtained by linear projection from the concatenated label sequence, thereby realizing multimodal attention calculation, wherein the text input is a concatenation of the original input cue and the reflection cue.

[0053] Specifically, the text input, defective image, and optimized image are concatenated into a unified sequence. Q, K, and V are obtained through linear projection. Multimodal attention is calculated using a multi-head self-attention mechanism to achieve bidirectional information exchange between different modalities without the need for additional specialized modules. The defective image serves as conditional information and can be further downsampled to improve the computational efficiency of training and inference. Standard diffusion (or flow matching) loss is applied to the optimized target image for training.

[0054] In some embodiments, in step S2, when training the corrector model, the training strategy includes: randomly discarding the original cue, the reflection cue, and the defective input image with a certain probability, wherein the reflection cue and the defective image are discarded simultaneously with a relatively high probability; and using a "task warm-up" method to dynamically adjust the sampling probability of multiple data domains during training, initially increasing the sampling probability of the edited data, and then gradually increasing the sampling probability of the three data domains other than the edited data: rule-based data, reward-based data, and long / short cue data, in order to improve the overall performance of the model and compensate for the possible visual quality degradation problem in the edited data.

[0055] Step S3, Inference Optimization Framework:

[0056] During the inference phase, the generated image is optimized using the corrector model through the following three complementary dimensions:

[0057] Noise level expansion: Explore the diversity of generated images by using different initial noise samples to optimize potential initialization;

[0058] Prompt-level extension: Dynamically optimize text prompts based on input prompts and quality feedback of generated images to achieve precise semantic guidance;

[0059] Reflective-level extension: Iteratively evaluates and corrects previously generated images, progressively improving image quality. The iterative optimization process is based on the corrector model and text reflection.

[0060] In some embodiments, during step S3, when expanding the noise level: the number of different initial noise samples generated in each round of exploration is defined as the search width. The diversity in the distribution learned by the diffusion model is explored by increasing the search width. However, since the initial noise generation processes are independent of each other and depend on the feedback of the task-related validators, simply increasing the search width may lead to diminishing returns in computational efficiency.

[0061] In some embodiments, during step S3, when the prompt level is expanded: in each iteration, a multimodal large language model is used to optimize the text prompt based on the original user prompt, the previously generated image and its evaluation score, without explicit gradient information, so as to generate accurate and effective prompts for subsequent image generation iterations.

[0062] Step S4: Generate optimized image:

[0063] In each iteration, the corrector model is used to generate a new set of candidate images by combining the optimized hints and the images generated in the previous iteration. The best image is selected by the validator as the input for the next iteration, and finally the optimized high-quality image is output.

[0064] In some embodiments, in step S4, when generating optimized images: first, a set of initial candidate images is generated using a generator implemented by unloading low-rank adaptation weights; at each iteration, a multimodal large language model validator is used to evaluate and rank the images generated in the previous iteration from multiple dimensions, and text reflections and user prompts are generated based on the evaluation scores and previously generated images; the reflected and improved prompts are input into a trained corrector model with low-rank adaptation to generate new candidate images; the validator is used to select the best image for each optimization chain, and then the best image is selected from all chains as the final output.

[0065] In some embodiments, in steps S3 and S4: given a text prompt and a text-to-image generator, the generator first generates an initial image; in each optimization iteration, using the corrector model, based on the image of the previous iteration, the original text prompt, and the text reflection describing previous shortcomings and directions for improvement, an optimized image is generated; wherein the text reflection is generated after the quality of the generated image is evaluated by an external evaluation module; the probability of finally generating an optimized image is the product of the initial image generation probability and the probability of the corrector model generating the corresponding image in each iteration. Through such an iterative process, candidate images are continuously generated and optimized by combining relevant factors, and a high-quality image is output.

[0066] This invention proposes a text-to-image diffusion model inference optimization method based on reflective fine-tuning. By constructing a GenRef reflective dataset containing a large number of triples and covering multiple domains, it provides strong support for reflective-level scaling of the model. A corrector model is obtained by fine-tuning the pre-trained model through a joint multimodal attention mechanism, avoiding the introduction of additional modules. An inference time framework, ReflectionFlow, is designed to optimize images from three complementary dimensions—noise level, cue level, and reflective level—during the inference phase. This fully explores image diversity, achieves precise semantic guidance, and iteratively improves image quality. This method, with its novel iterative reflective self-optimization framework, allows the diffusion model to effectively utilize additional computational resources during inference. Without relying on large-scale additional training, it significantly outperforms simple noise-level scaling methods, achieving higher-quality image synthesis in challenging tasks. It also flexibly balances search width and reflective depth to adapt to different needs, while unlocking the model's inference capabilities, demonstrating excellent performance in complex scenes and fine-detail processing. This invention significantly improves the performance of text-to-image diffusion models in generating complex scenes and fine details, providing a scalable and computationally efficient solution for high-quality image synthesis.

[0067] The following further describes specific embodiments and experimental verifications of the present invention.

[0068] This invention proposes ReflectionFlow, an inference time framework that enables diffusion models to iteratively reflect on and optimize their outputs. ReflectionFlow introduces three complementary inference time extension dimensions: (1) a noise-level extension for optimizing latent initialization; (2) a cue-level extension for precise semantic guidance; and most notably, (3) a reflection-level extension, which explicitly models actionable reflections to iteratively evaluate and correct previously generated images. To facilitate the reflection-level extension, this invention constructs GenRef, a large-scale dataset containing 800,000 triples, each containing a reflection, a defective image, and an enhanced image. Using this dataset, this invention efficiently fine-tunes the state-of-the-art diffusion transformer FLUX.1dev within a unified framework by jointly modeling multimodal inputs. Experimental results show that ReflectionFlow significantly outperforms simple noise-level extension methods, providing a scalable and computationally efficient solution for achieving higher-quality image synthesis in challenging tasks.

[0069] Recent advancements in text-to-image (T2I) diffusion models [10,14,24,50,58] have brought significant breakthroughs to the field of image synthesis. With the continuous expansion of training resources, these models are steadily improving their ability to generate high-resolution, realistic images. Despite these successes, their performance varies across different domains, especially when generating complex human poses, multi-object scenes, or scenes with complex lighting and shadows. According to existing scaling laws during training

[20] , to alleviate these limitations, it is necessary to increase the training computation, model parameters, and data size exponentially.

[0070] This prompted the inventors to rethink the current paradigm: instead of constantly expanding pre-trained models, how to effectively utilize the full capabilities of existing diffusion models during inference? This invention assumes that while T2I models may struggle to generate perfect images in a single inference, their performance can be significantly improved through iterative optimization. This idea of ​​using additional computational resources to improve performance during inference has been validated in large language models (LLMs)

[41] . Modern large language models have demonstrated the ability to improve output quality by reflecting on intermediate outputs and subsequently optimizing responses [23,30,39], which makes them perform well in solving complex tasks such as mathematical problems and code generation. However, current inference time optimization methods for diffusion models [29,40,51] mainly focus on parallelized noisy space search strategies, while the sequential self-optimization paradigm that allows diffusion models to reflect on and correct their own errors has largely remained unexplored.

[0071] This invention proposes ReflectionFlow, a novel self-optimizing framework for inference time in diffusion models based on reflective fine-tuning. The method explores extensions to inference time computation in three dimensions: (1) noise-level extension, aiming to find better noise initialization; (2) cue-level extension, achieving precise semantic guidance by optimizing input cues; and (3) reflective-level extension, constructing an explicit reflective mechanism to iteratively evaluate and correct previously generated outputs. Combining these dimensions enables the diffusion model to flexibly utilize additional computational resources during inference, continuously improving image quality through iterative processes, such as... Figure 1 As shown.

[0072] The method of this invention addresses a fundamental challenge: how to endow text-to-image (T2I) diffusion models with self-optimization capabilities? Currently, existing diffusion models fail to accurately interpret reflective cues or iteratively optimize using previously generated images. Considering the inherent similarities between self-optimization and image editing tasks, this invention finds that both involve generating new outputs based on textual and visual context. Inspired by training paradigms that efficiently adapt diffusion priors for image editing [6,46], this invention hypothesizes that a similar approach could enable diffusion models to achieve self-optimization. However, another key challenge arises: the lack of datasets specifically designed for reflective-guided optimization.

[0073] Inspired by this understanding, this invention constructs GenRef, the first large-scale image reflection dataset containing 800,000 reflection triples from multiple domains. To ensure the effectiveness of these triples (e.g., defective images accurately capture potential errors, reflections provide effective and feasible editing suggestions, and high-quality images have sufficiently high quality), this invention designs a scalable, fully automated data construction process that incorporates four different data sources and utilizes verifiable objectives, an integrated reward model, and diverse unfolding strategies. In addition to laying the foundation for the reflection tuning method of this invention, this well-organized dataset can be used for a wider range of applications, such as general preference tuning tasks

[45] . This invention then employs an efficient reflection tuning method specifically designed for text-to-image diffusion transformers (such as FLUX.1-dev

[24] ). In the method of this invention, the original cue, reflection cue, defective image, and high-quality image are concatenated into a unified sequence to perform a joint multimodal attention mechanism, thus eliminating the need for additional modules [54,56].

[0074] Through experiments, ReflectionFlow demonstrates its potential to improve image generation quality without requiring additional large-scale training. Compared to simple noise-level scaling, ReflectionFlow performs significantly better with the same inference budget, and its performance is further improved when an oracle verifier is introduced. Furthermore, this invention explores a flexible trade-off between search width and reflection depth, as well as the impact of the overall inference budget. Further evaluation shows that the method of this invention achieves particularly significant improvements on challenging prompts. Qualitative analysis demonstrates how the model of this invention iteratively reflects on and corrects its output, progressively converging to a better solution.

[0075] In summary, (1) this invention proposes ReflectionFlow, the first reflection-based scaling framework for diffusion model inference, which integrates three scaling dimensions—noise level, cue level, and reflection level—to iteratively optimize the output; (2) this invention constructs GenRef, the first large-scale dataset containing 800,000 automatically generated triples (reflection cue, defective image, high-quality image); (3) this invention employs an efficient reflection adjustment method for diffusion transformers and formulates a specific training strategy; (4) numerous experiments show that ReflectionFlow significantly improves the quality of text-to-image generation and unlocks inference capabilities.

[0076] Related work

[0077] Image diffusion model

[0078] Text-to-image diffusion models have made rapid progress in terms of model architecture and training strategies. In terms of architectural evolution, the field has shifted from the commonly used UNet diffusion model

[37] to diffusion transformers (DiT)

[32] . In terms of training strategies, the early complex hand-designed diffusion schedules [17,43] have been replaced by simpler flow-based formulas [26,28], and training efficiency has been significantly improved through techniques such as multi-resolution progressive training [8]. Recently, the expansion of training datasets and model parameter sizes has led to the emergence of various large-scale, flow-based diffusion transformer models [10,12,24,50,58].

[0079] Enhanced during diffusion reasoning

[0080] Based on robust pre-trained diffusion models, recent research has increasingly focused on unlocking their potential during inference. One area of ​​research has found that initial noise significantly impacts generation quality [34,57], prompting the search for better initialization strategies [2,29,34,57]. Another research direction is improving the iterative sampling process of diffusion models [3,40,55], particularly through denoising and inversion

[42] . Furthermore, recent research [25,50] has shown that enhancing input cues can significantly improve visual fidelity and text-image alignment. While existing methods primarily focus on parallel single-pass generation, this work proposes a process of sequential generation followed by optimization, integrating scaling during parallel and sequential inference into a unified framework.

[0081] Computational complexity during scaling inference

[0082] Recent research on large language models has provided valuable insights into the scaling law during inference. One major research line [11,53] has explored search algorithms, such as N-to-1 with validators and beam search, to select higher-quality outputs. Another prominent direction is enabling large language models to optimize their own outputs. For example, techniques such as zero-shot hints [21,30,39] have been used to stimulate self-reflection in models, enabling them to iteratively improve their outputs. Furthermore, supervised fine-tuning (SFT) and reinforcement learning (RL) methods [9,15,23,35,47] have been introduced to explicitly train models for reflective self-improvement. Meta has also proposed a comprehensive framework

[41] that systematically unifies these directions and delves into the trade-off between pre-training scale and computational cost during inference, which greatly inspires the approach of this invention.

[0083] method

[0084] Problem Formulation

[0085] This invention first formalizes the iterative optimization framework for the text-to-image generation task. Given a text cue y and a text-to-image generator G... θ First, generate the image x0~G θ (·|y). Subsequently, in each optimization iteration i, the corrector model C is used. φ Based on the image x from the previous iteration i-1 Original text prompts (y) and text reflection prompts (r) describing previous shortcomings and directions for improvement. i-1 Generate the improved image x i ~C φ (·|y,x i-1 r i-1 Specifically, external evaluation modules such as reward models [16,52] and multimodal large language models (MLLMs) [1] are used to evaluate the quality of the image generated in the (i-1)th iteration and generate instructive reflection r. i-1 ~R(·|x i-1 However, a major challenge of this iterative optimization method lies in how to effectively train the text-to-image diffusion model so that it can correct its own errors through reflective cues, i.e., reformulating the text-to-image generation task as generating first and then optimizing:

[0086]

[0087] Inspired by recent advances in the field of image editing [6,46], this invention observes the corrector C defined in Equation 1. φThe objective is very similar to general image editing problems, namely, transforming an input image into a desired target image based on text instructions. Therefore, this invention conceptualizes the text-reflection-guided self-correction task as a generalized editing problem. By constructing a specialized reflection dataset and performing efficient reflection fine-tuning, this invention enables the underlying text-to-image diffusion model to effectively learn, optimize, and iteratively improve the images it generates.

[0088] Reflection Dataset

[0089] The key to enabling text-to-image diffusion models to learn self-optimization lies in constructing a suitable dataset. However, there is currently a lack of open-source datasets specifically curated for image optimization tasks guided by text feedback. To fill this gap, this invention introduces GenRef, the first large-scale text-to-image optimization dataset containing 800,000 triples of the form (defective image, high-quality image, reflection), sourced from multiple domains, such as... Figure 2 As shown. Figure 2 This illustration shows the construction process and statistical information of the GenRef dataset in an embodiment of the present invention. The embodiment of the present invention collects reflection triples (defective images, enhanced images, and text reflections) from four different data sources, including: rule-based data, reward-based data, long / short cue data, and edit data.

[0090] in principle

[0091] Inspired by the latest advancements in the construction of self-optimizing datasets in the literature on large language models

[33] , this invention first establishes several guiding principles that the dataset must meet: (1) "Defective images" should comprehensively cover common errors encountered by the generator G_{\theta} during inference; (2) "High-quality images" should show a significant improvement in quality in all aspects compared to their corresponding "defective images"; and (3) Textual reflections should accurately describe the observed defects and provide feasible guidance for optimization. Guided by these principles, this invention develops an automated and scalable dataset construction process covering the following four different areas.

[0092] Rule-based triples

[0093] Recent studies, such as DeepseekR1[9], have shown that high-quality, rigorously validated datasets built using rule-based validators can significantly improve the capabilities of models. Inspired by these approaches, this invention first utilizes large language models such as GPT-4[1], like GenEval

[13] and T2ICompBench

[19] , to brainstorm various common object categories and their associated attributes, such as color and spatial location. Subsequently, this invention uses a rule-based approach to combine these objects and attributes to construct unique text prompts. This invention rigorously screens these prompts to ensure that they do not overlap with the test samples of existing benchmarks.

[0094] Next, the present invention uses FLUX.1-dev to generate 10 candidate images for each cue. Each candidate image is verified by GroundedSAM

[36] to detect and locate individual objects, and then attributes such as color and quantity are evaluated according to the given cue. Based on these evaluations, each image is assigned a binary correctness label, or a continuous correctness score between 0 and 1, while explicitly indicating the reason for any errors detected. To ensure the accuracy of the images marked as correct, the present invention further uses Qwen2.5VL[4] to verify each candidate image, retaining those images that are completely consistent with the text cue.

[0095] Next, this invention estimates the difficulty of each hint by the proportion of correct samples generated by FLUX.1-dev. Then, the invention divides the difficulty into three quantiles, discarding hints whose generated images are mostly correct or mostly incorrect, as this indicates the hints are too easy or too difficult. For the remaining challenging hints, this invention constructs image optimization pairs by randomly pairing the highest-scoring image with the lowest-scoring image. Finally, leveraging the powerful multimodal capabilities of Qwen2.5-VL, this invention generates concise and feasible text reflections from each image pair and its corresponding error reasons, ultimately generating 253,000 triples.

[0096] Reward-based triples

[0097] While rule-based triples primarily emphasize object-centric text-image alignment, aesthetic quality, visual fidelity, and alignment with general user cues are equally crucial for general image optimization models. To address this issue, this invention collects a variety of general cues, including synthetic titles and real user-generated cues. For each cue, 10 candidate images are generated. Each generated image is then evaluated using an integrated scoring strategy based on multiple reward models (e.g., HPSv2 score

[48] , CLIP score

[16] , and PickScore

[22] ) to comprehensively assess its overall quality and alignment with the given cue. Optimization pairs are then constructed by randomly pairing images from the first k and last k subsets of each cue. Then, using Qwen2.5-VL, concise and feasible text reflection instructions are generated based on cue alignment, aesthetic quality, and visual fidelity, resulting in 136,000 reward-based triples.

[0098] Details - Short Tip Triples

[0099] Recent research [5,7,38] has shown that, for the same expected content, the quality of generated images consistently improves as textual cues become more detailed and descriptive. Inspired by this observation, this invention fine-tunes a multimodal large language model, specifically condensing detailed cues annotated by large language models (such as GPT-4) into shorter, more concise versions. Images generated from these two cue variants naturally form corresponding image pairs, with the image generated from the detailed cues serving as a higher-quality instance. To ensure the quality and validity of these image pairs, this invention also employs an integrated reward scoring method for filtering and utilizes Qwen2.5-VL to generate reflective instructions, ultimately yielding 104,000 triples.

[0100] Edit Triplet

[0101] Finally, this invention expands the dataset with existing image editing data to further enhance its diversity and richness. The editing data naturally provides image pairs with text editing instructions, which are easily aligned with the triplet-based dataset format of this invention. Although the editing domain differs from the main image optimization task of this invention, the precision and explicitness of the editing instructions can effectively improve the model's ability to follow text guidance and understand the precise correspondence between the source and target images. Specifically, this invention selects 316,000 high-quality editing samples from the OmniEdit

[46] dataset and uses the finely tuned captioning model of this invention to generate detailed synthetic captions for these samples.

[0102] To ensure the quality and reliability of the dataset, this invention performs rigorous post-processing cleaning and filtering on all generated reflection instructions. Furthermore, this invention manually examines a representative subset of samples to verify their correctness and consistency. Figure 2 As shown, the final GenRef dataset of this invention contains 800,000 triples, with 1% of the data in each category reserved as a validation set.

[0103] Reflection and Fine-tuning

[0104] After constructing a suitable dataset, this invention focuses on efficiently training the corrector model C. φ To improve the quality of generated images, similar to image editing tasks, self-optimization is treated as a conditional generation problem, and an efficient fine-tuning strategy is proposed for a pre-trained Diffusion Transformer (DiT) without introducing any additional modules.

[0105] Highly efficient fine-tuning for DiT

[0106] The MMDiT architecture

[10] has become the de facto standard for recent text-to-image generation models. In these models, image tags and text embeddings are concatenated into a unified sequence, allowing joint multimodal attention computation within each transformer block. Inspired by recent advances in conditional generation [44,49], this invention also takes text input y and a defective image x as input. bad And the optimized image x good Connect them into a fusion sequence to achieve multimodal attention computation:

[0107]

[0108] Where Q, K, and V are from the concatenated labeled sequence z = [y; x bad ;x good The linear projection is used to obtain y, which is the connection between the original input cue and the reflection cue. This unified attention mechanism naturally facilitates bidirectional information exchange between multiple modalities without the need for specialized modules such as ControlNet

[56] or IP-Adapter

[54] .

[0109] Within this framework, the defective image x bad As conditional information, no noise scheduling is required, and it can be further downsampled to a lower resolution (from 1024 to 512) to improve computational efficiency during training and inference. Therefore, the optimized target image x can be directly processed. good Apply standard diffusion (or flow matching) loss [26,28]:

[0110]

[0111] Among the noise x was sampled from a standard Gaussian distribution. t From p(x t |∈,x good The sample was obtained from the sample.

[0112] Training strategy

[0113] The inventors discovered that training directly on the proposed dataset can lead to distribution drift with the pre-trained base model, thereby reducing the quality of the generated images. To mitigate this problem, this invention designs a specialized training strategy to enhance the robustness of the model and maintain consistency with the pre-trained distribution.

[0114] First, during training, this invention randomly discards the original prompts, reflected prompts, and defective input images with a certain probability. Specifically, reflected prompts and defective images are discarded simultaneously with a relatively high probability. In this case, the training objective is effectively restored to standard text-to-image generation, ensuring that the model does not deviate excessively from its pre-training distribution.

[0115] Furthermore, this invention employs a "task warm-up" method, dynamically adjusting the sampling probabilities of multiple data domains throughout the training process. Initially, the sampling probability of the edited data is higher, which helps the model quickly acquire accurate instruction following capabilities. As training progresses, the sampling probabilities of the other three data domains are gradually increased. This gradual adjustment effectively improves the overall performance of the model and compensates for potential visual quality degradation issues in the edited data by utilizing high-quality synthetic datasets.

[0116] Expanding testing through iterative optimization

[0117] Utilizing a trained corrector model, this invention aims to maximize the generative capability of the diffusion model during inference. In this section, the invention proposes a re-examination of test-time extensions to the text-to-image diffusion model from three distinct but complementary dimensions: noise-level extension, reflection-level extension, and cue-level extension, such as... Figure 3 As shown, these three dimensions are seamlessly integrated in the ReflectionFlow framework proposed in this invention.

[0118] Noise level extension

[0119] This invention first introduces a noise level extension, inspired by recent research focusing on noise space optimization [2,34,57]. These methods aim to find better initial or intermediate noise images through various search strategies. In the framework of this invention, the number of different initial noise samples generated in each round of exploration is defined as the search width N. By increasing N, the diversity inherent in the distribution learned by the diffusion model can be fully explored. However, since the generation processes of these N initial noises are independent of each other and largely depend on the feedback of the task-related validator, simply increasing N may lead to diminishing returns in computational efficiency.

[0120] Reflective extension

[0121] The reflective-level extension, based on the corrector model trained according to this invention, gradually improves image quality by iteratively optimizing previously generated images. This invention defines the number of iterations as the reflective depth M. Specifically, each optimization iteration follows the process defined in Section 3.1, i.e., iterative optimization is performed using the image generated in the previous iteration combined with reflective content. If the corrector model is effective, increasing the reflective depth M can significantly improve the overall performance of the model.

[0122] Tip-level extension

[0123] Finally, considering that the text-to-image diffusion model depends not only on noisy image input but also on user-provided text prompts, this invention incorporates a prompt optimization process within the extended framework during testing. This invention finds that prompt expansion can significantly improve generation quality, especially for concise prompts. In each iteration, this invention utilizes a multimodal large language model (MLLM) to optimize the text prompt based on the original user prompt, previously generated images, and their evaluation scores. This prompt optimization process, performed without explicit gradient information, can generate accurate and effective prompts for subsequent image generation iterations.

[0124] ReflectionFlow

[0125] Integrating all the above components, this invention proposes the ReflectionFlow framework; for detailed algorithm information, please refer to the supplementary materials. Specifically, this invention first uses a generator implemented by unloading low-rank adaptation (LoRA) weights to generate an initial set of N candidate images. Subsequently, in the i-th iteration, this invention utilizes a multimodal large language model validator to comprehensively evaluate and rank the N images generated in the previous iteration across multiple dimensions. Based on these evaluation scores and the previously generated images, the multimodal large language model generates text reflections aimed at correcting identified errors, and then optimizes user prompts. These reflections and improved prompts are used together as input to the trained corrector model with low-rank adaptation (LoRA) of this invention, generating a set of optimized N images for the next iteration. Finally, this invention uses the validator to select the best image for each optimization chain, and then selects the best image across all chains.

[0126] The ReflectionFlow of this invention allows for flexible adjustment of the search width N (number of parallel chains) and the reflection depth M (number of iterations for optimization). This flexibility enables users to effectively balance performance and computational efficiency according to the requirements and constraints of various downstream tasks.

[0127] experiment

[0128] Experimental setup

[0129] Training details. This invention chose FLUX.1-dev1

[24] , a stream-based text-to-image diffusion transformer with 12 billion parameters, as the generator for this invention. To train the corrector model, this invention used the GenRef dataset, resizing and cropping all target images to 1024×1024 and all conditional images to 512×512. To achieve efficient fine-tuning, this invention adopted the low-rank adaptive (LoRA) method with a rank of 256. The model was trained with a batch size of 64 and optimized using the Prodigy optimizer

[31] with protective warm-up and bias correction enabled, following the practices outlined in OminiControl

[44] . The entire fine-tuning process was performed on 8 NVIDIA A100 GPUs with 15,000 optimization steps.

[0130] Evaluation. This invention evaluates the ReflectionFlow framework on the GenEval dataset

[13] , following the official evaluation process. The GenEval dataset contains 553 prompts, each of which generates 4 images. All images are generated at a resolution of 1024×1024, a guided scale of 3.5, and 30 sampling steps. This invention uses a large language model (such as GPT-4o) as a validator to score the generated images and generate reflections. Detailed information on large language model (such as GPT-4o) prompts is provided in the supplementary materials.

[0131] Main results

[0132] This invention first validates the effectiveness of the proposed ReflectionFlow framework on the GenEval benchmark. Specifically, this invention progressively introduces three complementary scaling dimensions defined in the method: noise-level scaling, cue-level scaling, and reflection-level scaling. This invention compares ReflectionFlow with the baseline model FLUX.1-dev and several state-of-the-art text-to-image models.

[0133] ReflectionFlow improves generation quality

[0134] Table 1 summarizes the quantitative results. Starting with the baseline FLUX.1-dev model (score 0.67), this invention observed a slight improvement in score after introducing noise-level scaling, reaching 0.68. Further combining cue-level scaling brought a more significant improvement, with a score of 0.72. Finally, when this invention integrates the three levels of scaling together, ReflectionFlow achieves a significant performance leap, with an overall score of 0.77.

[0135] Table 1: Quantitative comparison of various inference-time scaling settings with existing text-to-image models on GenEval.

[0136]

[0137] These results demonstrate that simple noise-level scaling alone is inefficient without explicit guidance, while dynamic optimization cues during generation help to more clearly understand complex semantic attributes such as object color and spatial arrangement. The significant performance improvement achieved by combining reflective-level scaling further confirms that textual reflection from the validator provides valuable feedback, enabling the corrector model to iteratively and reliably optimize its output.

[0138] Unleash your full potential with the Oracle Verifier

[0139] While the ReflectionFlow framework has achieved significant improvements under the guidance of multimodal large language model (MLLM) validators, this invention observes that evaluation scores may not be accurate in finding truly correct candidate images. To explore the potential upper limits of the method presented in this invention, an additional experiment was conducted using the Oracle validator. This Oracle validator utilizes the GenEval evaluation flow to provide a true score for selecting the best candidate image at each iteration.

[0140] Table 2: Oracle verifier results under different scaling dimensions

[0141]

[0142] As shown in Table 2, ReflectionFlow achieved an impressive score of 0.92 under the Oracle scenario, indicating a potential performance ceiling (an improvement of 0.15) compared to the multimodal large language model (MLLM) validator. This performance gap clearly demonstrates the complexity of text-to-image generation, highlighting the need to develop more accurate, robust, and human-biased image evaluation methods. Furthermore, even in the Oracle scenario, each component of the proposed method independently contributes to the performance improvement, and combining these components further achieves the optimal score. This consistent trend strongly validates the complementary effectiveness of the three scaling dimensions for the diffusion model.

[0143] Ablation Research

[0144] Exploration of Iterative Optimization Strategies

[0145] Inspired by recent advances in iterative self-optimization strategies [30,39], this invention systematically studies different exploration strategies within the ReflectionFlow framework. Specifically, this invention conducts ablation experiments by changing two key hyperparameters: the search width N, which represents the number of candidate images generated in each iteration; and the reflection depth M, which represents the number of iterations for optimization. With a fixed computational budget of N×M=16, this invention explores three different optimization strategies: (1) a sequential strategy, generating one candidate image in each optimization step; (2) a parallel strategy, generating multiple candidate images simultaneously in each iteration; and (3) a combined strategy, balancing depth and breadth by moderately expanding the candidate branches in each iteration.

[0146] Table 3: Ablation studies of width and depth in reasoning

[0147]

[0148] Table 3 clearly shows that the sequential strategy (W1D16) achieved the highest overall performance of 0.78, outperforming the parallel strategy (W16D1), which scored lower at 0.74. Comparing various combined strategies, such as W2D8, W4D4, and W8D2, this invention consistently observes that strategies with greater optimization depth tend to produce better performance than those with wider branches. These observations indicate that the ReflectionFlow framework exhibits effective reflection and self-correction capabilities, but the optimization process is relatively unstable, requiring multiple sequential iterations to gradually identify and correct errors. Increasing the optimization depth allows the model to continuously reason and correct previous errors, eventually converging to an improved result.

[0149] Exploration of different reasoning budgets

[0150] Next, this invention investigates how the allocated inference budget affects the performance of the ReflectionFlow framework. Specifically, this invention fixes the search width at 2 and progressively increases the reflection depth as the total budget is expanded. This allows this invention to explicitly test the ability of ReflectionFlow to iterate and reflect and correct previous errors. This invention uses only noise level scaling as a comparison baseline, as this represents a common approach in the existing literature

[29] .

[0151] Figure 5 The results show that ReflectionFlow's performance improves rapidly as the budget increases from 1 to 4, then the rate of improvement slows down, eventually reaching a GenEval score of 0.78. Under all budgets, the baseline's overall performance remains significantly lower than ReflectionFlow, indicating the limited effectiveness of scaling alone in simple tests. This observation is highly consistent with existing findings in this invention, confirming the importance of incorporating deeper iterative reflection strategies and developing more suitable validators to further improve scaling performance under larger budgets.

[0152] Analysis and Discussion

[0153] The ability to reflect on difficult tasks

[0154] Previous research in large language models has shown that scaling during inference, particularly through longer inference and reflection chains, can improve performance on more challenging tasks [30,39]. Inspired by these observations, this invention investigates whether the ReflectionFlow framework exhibits similar properties in diffusion models. Using the difficulty estimated in Section 3.2, this invention categorizes hints in the GenEval benchmark into three difficulty groups based on initial accuracy: hard hints with accuracy between 0 and 0.3, medium-difficulty hints with accuracy between 0.4 and 0.7, and easy hints with accuracy between 0.8 and 1.0. Figure 5 This paper summarizes the performance of ReflectionFlow across these three difficulty levels.

[0155] ReflectionFlow achieved the greatest improvement on difficult prompts, with accuracy increasing dramatically from 0.10 to 0.47. Medium-difficulty prompts showed a moderate improvement, increasing accuracy from 0.55 to 0.65, while easy prompts saw the smallest change, decreasing slightly from 0.95 to 0.93. These results clearly demonstrate that ReflectionFlow shares similarities with reflection-based scaling strategies in large language models, where deeper iterative reflection is particularly beneficial for challenging tasks. This shows potential for future work on dynamically allocating inference time computational resources based on prompt difficulty.

[0156] Qualitative examples

[0157] To visually demonstrate the effectiveness of ReflectionFlow, this invention provides a qualitative example of the generated image and the corresponding reflection process. Figure 4 This diagram illustrates a complex reasoning process according to an embodiment of the present invention. Starting with an initially incorrect generation (left side of the diagram), ReflectionFlow iteratively reflects on and corrects the error, progressively generating an image precisely aligned with the provided hints and reflection instructions. Figure 4 As shown, the images initially generated by the baseline model often fail to capture the subtle details or complex relationships described in the prompts. Through iterative reflection, the model gradually identifies and corrects these problems, ultimately improving the output quality. Furthermore, the method of this invention naturally generates interpretable reflective chains, similar to thought chain reasoning in large language models, demonstrating how the model can progressively and explicitly reason and resolve issues such as visual inconsistencies, style mismatches, and inaccurate composition. For more qualitative results, please refer to the supplementary materials.

[0158] In summary, this invention proposes an inference optimization method for text-to-image diffusion models based on reflective fine-tuning, and designs an inference-time framework, ReflectionFlow, which endows text-to-image diffusion models with iterative self-optimization capabilities. The method constructs a large-scale image reflection dataset, GenRef, containing 800,000 triplets consisting of defective images, high-quality images, and text reflections. By formulating self-optimization as a generalized image editing problem and employing an efficient fine-tuning strategy on the pre-trained diffusion transformer, ReflectionFlow effectively improves performance without deviating from the pre-training distribution. Furthermore, the framework integrates inference-time scaling of noise, reflection, and cue dimensions, providing flexibility in balancing computational efficiency and generation quality. This invention offers a promising direction for advancing self-optimizing generative models and contributes to building more reliable and adaptive image generation systems.

[0159] This invention also provides a storage medium for storing a computer program, which, when executed, performs at least the methods described above.

[0160] This invention also provides a control device, including a processor and a storage medium for storing a computer program; wherein the processor executes the computer program by performing at least the method described above.

[0161] This invention also provides a processor that executes a computer program, at least performing the methods described above.

[0162] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk drive or magnetic tape drive. The storage media described in the embodiments of this invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0163] In the several embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

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

[0165] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0166] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0167] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

[0168] The methods disclosed in the several method embodiments provided by this invention can be arbitrarily combined without conflict to obtain new method embodiments.

[0169] The features disclosed in the several product embodiments provided by this invention can be arbitrarily combined without conflict to obtain new product embodiments.

[0170] The features disclosed in the several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0171] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various equivalent substitutions or obvious modifications can be made without departing from the concept of the present invention, and all such modifications, achieving the same performance or application, should be considered within the scope of protection of the present invention.

[0172] References

[0173] [1]Josh Achiam,Steven Adler,Sandhini Agarwal,Lama Ahmad,Ilge Akkaya,Florencia Leoni Aleman,Diogo Almeida,Janko Altenschmidt,Sam Altman,ShyamalAnadkat,et al.GPT-4technical report.arXiv preprint arXiv preprint arXiv:20273,2073.

[0174] [2]Donghoon Ahn,Jiwon Kang,Sanghyun Lee,Jaewon Min,Minjae Kim,WooseokJang,Hyoungwon Cho,Sayak Paul,SeonHwa Kim,Eunju Cha,et al.A noise is worthdiffusion guidance.arXiv preprint arXiv:2412.03895,2,524.

[0175] [3]Lichen Bai,Shitong Shao,Zikai Zhou,Zipeng Qi,Zhiqiang Xu,HaoyiXiong,and Zeke Xie.Zigzag diffusion sampling:The path to success iszigzag.arXiv preprint arXiv:2412.10891,2024.2

[0176] [4]Shuai Bai,Keqin Chen,Xuejing Liu,Jialin Wang,Wenbin Ge,Sibo Song,Kai Dang,Peng Wang,Shijie Wang,Jun Tang,et al.Qwen2.5-vl technicalreport.arXiv preprint arXiv:2502.13923,2025.3

[0177] [5]James Betker,Gabriel Goh,Li Jing,Tim Brooks,Jianfeng Wang,LinjieLi,Long Ouyang,Juntang Zhuang,Joyce Lee,Yufei Guo,et al.Improving imagegeneration with better captions.Computer Science.2023.4,6

[0178] [6]Tim Brooks,Aleksander Holynski,and Alexei A Efros.Instructpix2pix:Learning to follow image editing instructions.In Proceedings of the IEEEConference on Computer Vision and Pattern Recognition(CVPR),pages 18392–18402,2023.2,3

[0179] [7]Agneet Chatterjee,Melech Ben Gabriela Stan,Estelle Aflalo,SayakPaul,et al.Getting it right:Improving spatial consistency in text-to-imagemodels.In Proceedings of the European Conference on Computer Vision(ECCV),2024.4

[0180] [8]Junsong Chen,Chongjian Ge,Enze Xie,Yue Wu,Lewei Yao,Xiaozhe Ren,Zhongdao Wang,Ping Luo,Huchuan Lu,and Zhenguo Li.Pixart-σ:Weak-to-strongtraining of diffusion transformer for 4k text-to-image generation.Proceedingsof the European Conference on Computer Vision(ECCV),2024.2

[0181] [9] DeepSeek-AI, Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, RuoyuZhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang, Xiao Bi, Xiaokang Zhang, Xingkai Yu, Yu Wu, ZFWu, Zibin Gou, Zhihong Shao, Zhuoshu Li, Ziyi Gao, AixinLiu, Bing Xue, Bingxuan Wang, Bochao Wu, Bei Feng, Chengda Lu, Chenggang Zhao, Chengqi Deng, Chenyu Zhang, Chong Ruan, Damai Dai, Deli Chen, Dongjie Ji, Erhang Li, Fangyun Lin, Fucong Dai, Fuli Luo, Guangbo Hao, Guanting Chen, Guowei Li, H.Zhang, Han Bao, Hanwei Xu, Haocheng Wang, Honghui Ding, Huajian Xin, Huazuo Gao, Hui Qu, Hui Li, Jianzhong Guo, Jiashi Li, Jiawei Wang, Jingchang Chen, JingyangYuan, Junjie Qiu, Junlong Li, JLCai, Jiaqi Ni, Jian Liang, Jin Chen, Kai Dong, KaiHu, Kaige Gao, Kang Guan, Kexin Huang, Kuai Yu, Lean Wang, Lecong Zhang, Liang Zhao, Litong Wang, Liyue Zhang, Lei Xu, Leyi Xia, Mingchuan Zhang, Minghua Zhang, MinghuiTang, Meng Li, Miaojun Wang, Mingming Li, Ning Tian, ​​Panpan Huang, Peng Zhang, Qiancheng Wang, Qinyu Chen, Qiushi Du, Ruiqi Ge, Ruisong Zhang, Ruizhe Pan, RunjiWang, RJChen, RLJin, Ruyi Chen, Shanghao Lu, Shangyan Zhou, Shanhuang Chen, Shengfeng Ye, Shiyu Wang, Shuiping Yu, Shunfeng Zhou, Shuting Pan, SSLi, ShuangZhou, Shaoqing Wu, Shengfeng Ye, Tao Yun, Tian Pei, Tianyu Sun, T.Wang, WangdingZeng, Wanjia Zhao, Wen Liu, Wenfeng Liang, Wenjun Gao, Wenqin Yu, Wentao Zhang, WLXiao, Wei An, Xiaodong Liu, Xiaohan Wang, Xiaokang Chen, Xiaotao Nie, XinCheng, Xin Liu, Xin Xie, Xingchao Liu, Xinyu Yang, Xinyuan Li, Xuecheng Su, XuhengLin, XQLi, Xiangyue Jin, Xiaojin Shen, Xiaosha Chen, Xiaowen Sun, Xiaoxiang Wang, Xinnan Song, Xinyi Zhou, Xianzu Wang, Xinxia Shan, YKLi, YQWang, YXWei, YangZhang, Yanhong Xu, Yao Li, Yao Zhao, Yaofeng Sun, Yaohui Wang, Yi Yu, Yichao Zhang, Yifan Shi, Yiliang Xiong, Ying He, Yishi Piao, Yisong Wang, Yixuan Tan, Yiyang Ma, Yiyuan Liu, Yongqiang Guo, Yuan Ou, Yuduan Wang, Yue Gong, Yuheng Zou, Yujia He, Yunfan Xiong, Yuxiang Luo, Yuxiang You, Yuxuan Liu, Yuyang Zhou, YXZhu, YanhongXu, Yanping Huang, Yaohui Li, Yi Zheng, Yuchen Zhu, Yunxian Ma, Ying Tang, YukunZha, Yuting Yan, ZZRen, Zehui Ren, Zhangli Sha, Zhe Fu, Zhean Xu, Zhenda Xie, Zhengyan Zhang, Zhewen Hao, Zhicheng Ma, Zhigang Yan, Zhiyu Wu, Zihui Gu, Zijia Zhu, Zijun Liu, Zilin Li, Ziwei Xie, Ziyang Song, Zizheng Pan, Zhen Huang, Zhipeng Xu, Zhongyu Zhang, and Zhen Zhang. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning. arXiv preprint arXiv:2501.12948,2025.3.

[0182]

[10] Patrick Esser,Sumith Kulal,Andreas Blattmann,Rahim Entezari,Jonas Müller,Harry Saini,Yam Levi,Dominik Lorenz,Axel Sauer,Frederic Boesel,etal.Scaling rectified flow transformers for high-resolution image synthesis.InProceedings of the International Conference on Machine Learning(ICML),2024.1,2,5,6

[0183]

[11] Xidong Feng, Ziyu Wan, Muning Wen, Stephen Marcus McAleer, Ying Wen, Weinan Zhang, and Jun Wang. Alphazero-like tree-search can guide large language model decoding and training. arXiv preprint arXiv:2309.17179,2023.3

[0184]

[12] Peng Gao,Le Zhuo,Dongyang Liu,Ruoyi Du,Xu Luo,Longtian Qiu,YuhangZhang,Rongjie Huang,Shijie Geng,Renrui Zhang,et al.Lumina-t2x:Scalable flow-based large diffusion transformer for flexible resolution generation.InProceedings of the International Conference on Learning Representations(ICLR),2025.2

[0185]

[13] Dhruba Ghosh,Hannaneh Hajishirzi,and Ludwig Schmidt.Geneval:Anobject-focused framework for evaluating text-to-image alignment.Advances inNeural Information Processing Systems(NeurIPS),36,2024.3,6

[0186]

[14] Ziyu Guo,Renrui Zhang,Chengzhuo Tong,Zhizheng Zhao,Peng Gao,Hongsheng Li,and Pheng-Ann Heng.Can we generate images with cot?let’s verifyand reinforce image generation step by step.arXiv preprint arXiv:2501.13926,2025.1

[0187]

[15] Alexander Havrilla,Sharath Chandra Raparthy,ChristoforosNalmpantis,Jane Dwivedi-Yu,Maksym Zhuravinskyi,Eric Hambro,and RobertaRaileanu.Glore:When,where,and how to improve llm reasoning via global andlocal refinements.In Proceedings of the International Conference on MachineLearning(ICML),2024.3

[0188]

[16] Jack Hessel,Ari Holtzman,Maxwell Forbes,Ronan Le Bras,and YejinChoi.CLIPScore:A reference-free evaluation metric for image captioning.InProceedings of the 2021 Conference on Empirical Methods in Natural LanguageProcessing,pages 7514–7528,Online and Punta Cana,Dominican Republic,2021.Association for Computational Linguistics.3,4

[0189]

[17] Jonathan Ho,Ajay Jain,and Pieter Abbeel.Denoising diffusionprobabilistic models.Advances in Neural Information Processing Systems(NeurIPS),2020.2

[0190]

[18] Edward J Hu,Yelong Shen,Phillip Wallis,Zeyuan Allen-Zhu,YuanzhiLi,Shean Wang,Lu Wang,Weizhu Chen,et al.Lora:Low-rank adaptation of largelanguage models.Proceedings of the International Conference on LearningRepresentations(ICLR),2022.6

[0191]

[19] Kaiyi Huang,Kaiyue Sun,Enze Xie,Zhenguo Li,and Xihui Liu.T2i-compbench:A comprehensive benchmark for open-world compositional text-to-image generation.Advances in Neural Information Processing Systems(NeurIPS),36:78723–78747,2023.3

[0192]

[20] Jared Kaplan,Sam McCandlish,Tom Henighan,Tom B Brown,BenjaminChess,Rewon Child,Scott Gray,Alec Radford,Jeffrey Wu,and Dario Amodei.Scalinglaws for neural language models.arXiv preprint arXiv:2001.08361,2020.1

[0193]

[21] Geunwoo Kim,Pierre Baldi,and Stephen McAleer.Language models cansolve computer tasks.Advances in Neural Information Processing Systems(NeurIPS),2023.3

[0194]

[22] Yuval Kirstain,Adam Polyak,Uriel Singer,Shahbuland Matiana,JoePenna,and Omer Levy.Pick-a-pic:An open dataset of user preferences for text-to-image generation.In Advances in Neural Information Processing Systems(NeurIPS),2023.4

[0195]

[23] Aviral Kumar,Vincent Zhuang,Rishabh Agarwal,Yi Su,John D Co-Reyes,Avi Singh,Kate Baumli,Shariq Iqbal,Colton Bishop,Rebecca Roelofs,etal.Training language models to self-correct via reinforcement learning.arXivpreprint arXiv:2409.12917,2024.2,3

[0196]

[24] Black Forest Labs.Flux.https: / / github.com / black-forest-labs / flux,2024.1,2,6

[0197]

[25] Zhimin Li,Jianwei Zhang,Qin Lin,Jiangfeng Xiong,Yanxin Long,Xinchi Deng,Yingfang Zhang,Xingchao Liu,Minbin Huang,Zedong Xiao,etal.Hunyuan-dit:A powerful multi-resolution diffusion transformer with fine-grained chinese understanding.arXiv preprint arXiv:2405.08748,2024.2

[0198]

[26] Yaron Lipman,Ricky TQ Chen,Heli Ben-Hamu,Maximilian Nickel,andMatthew Le.Flow matching for generative modeling.In Proceedings of theInternational Conference on Learning Representations(ICLR),2023.2,5

[0199]

[27] Bingchen Liu,Ehsan Akhgari,Alexander Visheratin,Aleks Kamko,Linmiao Xu,Shivam Shrirao,Chase Lambert,Joao Souza,Suhail Doshi,and DaiqingLi.Playground v3:Improving text-to-image alignment with deep-fusion largelanguage models,2024.6

[0200]

[28] Xingchao Liu,Chengyue Gong,et al.Flow straight and fast:Learningto generate and transfer data with rectified flow.In Proceedings of theInternational Conference on Learning Representations(ICLR),2022.2,5

[0201]

[29] Nanye Ma,Shangyuan Tong,Haolin Jia,Hexiang Hu,YuChuan Su,MingdaZhang,Xuan Yang,Yandong Li,Tommi Jaakkola,Xuhui Jia,et al.Inference-timescaling for diffusion models beyond scaling denoising steps.arXiv preprintarXiv:2501.09732,2025.2,7

[0202]

[30] Aman Madaan,Niket Tandon,Prakhar Gupta,Skyler Hallinan,Luyu Gao,Sarah Wiegreffe,Uri Alon,Nouha Dziri,Shrimai Prabhumoye,Yiming Yang,etal.Self-refine:Iterative refinement with self-feedback.Advances in NeuralInformation Processing Systems(NeurIPS),2023.2,3,7,8

[0203]

[31] Konstantin Mishchenko and Aaron Defazio.Prodigy:an expeditiouslyadaptive parameter-free learner.In Proceedings of the InternationalConference on Machine Learning(ICML),pages 35779–35804,2024.6

[0204]

[32] William S Peebles and Saining Xie.Scalable diffusion models withtransformers.In Proceedings of the IEEE International Conference on ComputerVision(ICCV),2022.2

[0205]

[33] Guilherme Penedo,Hynek Kydlícˇek,Loubna Ben allal,Anton Lozhkov,Margaret Mitchell,Colin A Raffel,Leandro Von Werra,and Thomas Wolf.Thefineweb datasets:Decanting the web for the finest text data at scale.InAdvances in Neural Information Processing Systems(NeurIPS),pages 30811–30849,2024.3

[0206]

[34] Zipeng Qi,Lichen Bai,Haoyi Xiong,and Zeke Xie.Not all noises arecreated equally:Diffusion noise selection and optimization.arXiv preprintarXiv:2407.14041,2024.2,5

[0207]

[35] Yuxiao Qu,Tianjun Zhang,Naman Garg,and Aviral Kumar.Recursiveintrospection:Teaching language model agents how to self-improve.Advances inNeural Information Processing Systems(NeurIPS),2024.3

[0208]

[36] Tianhe Ren,Shilong Liu,Ailing Zeng,Jing Lin,Kunchang Li,He Cao,Jiayu Chen,Xinyu Huang,Yukang Chen,Feng Yan,Zhaoyang Zeng,Hao Zhang,Feng Li,Jie Yang,Hongyang Li,Qing Jiang,and Lei Zhang.Grounded sam:Assembling open-world models for diverse visual tasks,2024.3

[0209]

[37] Robin Rombach,Andreas Blattmann,Dominik Lorenz,Patrick Esser,andBjōrn Ommer.High-resolution image synthesis with latent diffusion models.InProceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR),pages 10684–10695,2022.2

[0210]

[38] Eyal Segalis,Dani Valevski,Danny Lumen,Yossi Matias,and YanivLeviathan.A picture is worth a thousand words:Principled recaptioningimproves image generation.arXiv preprint 2310.16656,2023.4

[0211]

[39] Noah Shinn,Federico Cassano,Ashwin Gopinath,Karthik Narasimhan,and Shunyu Yao.Reflexion:Language agents with verbal reinforcementlearning.Advances in Neural Information Processing Systems(NeurIPS),2023.2,3,7,8

[0212]

[40] Raghav Singhal,Zachary Horvitz,Ryan Teehan,Mengye Ren,Zhou Yu,Kathleen McKeown,and Rajesh Ranganath.Ageneral framework for inference-timescaling and steering of diffusion models.arXiv preprint arXiv:2501.06848,2025.2

[41] Charlie Snell,Jaehoon Lee,Kelvin Xu,and Aviral Kumar.Scaling llmtest-time compute optimally can be more effective than scaling modelparameters.arXiv preprint arXiv:2408.03314,2024.2,3

[0213]

[42] Jiaming Song,Chenlin Meng,and Stefano Ermon.Denoising diffusionimplicit models.In Proceedings of the International Conference on LearningRepresentations(ICLR),2021.2

[0214]

[43] Yang Song,Jascha Sohl-Dickstein,Diederik P Kingma,Abhishek Kumar,Stefano Ermon,and Ben Poole.Score-based generative modeling throughstochastic differential equations.In Proceedings of the InternationalConference on Learning Representations(ICLR),2021.2

[0215]

[44] Zhenxiong Tan,Songhua Liu,Xingyi Yang,Qiaochu Xue,and XinchaoWang.Ominicontrol:Minimal and universal control for diffusiontransformer.arXiv preprint arXiv:2411.15098,2024.5,6

[0216]

[45] Bram Wallace,Meihua Dang,Rafael Rafailov,Linqi Zhou,Aaron Lou,Senthil Purushwalkam,Stefano Ermon,Caiming Xiong,Shafiq Joty,and NikhilNaik.Diffusion model alignment using direct preference optimization.InProceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR),pages 8228–8238,2024.2

[0217]

[46] Cong Wei,Zheyang Xiong,Weiming Ren,Xeron Du,Ge Zhang,and WenhuChen.Omniedit:Building image editing generalist models through specialistsupervision.In Proceedings of the International Conference on LearningRepresentations(ICLR),2024.2,3,5

[0218]

[47] Sean Welleck,Ximing Lu,Peter West,Faeze Brahman,Tianxiao Shen,Daniel Khashabi,and Yejin Choi.Generating sequences by learning to self-correct.In Proceedings of the International Conference on LearningRepresentations(ICLR),2023.3

[0219]

[48] Xiaoshi Wu,Yiming Hao,Keqiang Sun,Yixiong Chen,Feng Zhu,Rui Zhao,and Hongsheng Li.Human preference score v2:A solid benchmark for evaluatinghuman preferences of text-to-image synthesis.arXiv preprint arXiv:2306.09341,2023.4

[0220]

[49] Shitao Xiao,Yueze Wang,Junjie Zhou,Huaying Yuan,Xingrun Xing,Ruiran Yan,Shuting Wang,Tiejun Huang,and Zheng Liu.Omnigen:Unified imagegeneration.arXiv preprint arXiv:2409.11340,2024.5

[0221]

[50] Enze Xie, Junsong Chen, Junyu Chen, Han Cai, Haotian Tang, Yujun Lin, Zhekai Zhang, Muyang Li, Ligeng Zhu, Yao Lu, et al. Sana: Efficient high-resolution image synthesis with linear diffusion transformers. Proceedings of the International Conference on Learning Representations (ICLR), 2025.1,2

[0222]

[51] Enze Xie, Junsong Chen, Yuyang Zhao, Jincheng Yu, Ligeng Zhu, Yujun Lin, Zhekai Zhang, Muyang Li, Junyu Chen, Han Cai, et al. Sana 1.5: Efficient scaling of training-time and inference-time compute in linear diffusion transformer. arXiv preprint arXiv:2501.18427,2025.2

[0223]

[52] Jiazheng Xu, Xiao Liu, Yuchen Wu, Yuxuan Tong, Qinkai Li, Ming Ding, Jie Tang, and Yuxiao Dong. Image reward: Learning and evaluating human preferences for text-to-image generation. In Advances in Neural Information Processing Systems, pages 15903–15935. Curran Associates, Inc., 2023.3

[0224]

[53] Shunyu Yao,Dian Yu,Jeffrey Zhao,Izhak Shafran,Tom Griffiths,YuanCao,and Karthik Narasimhan.Tree of thoughts:Deliberate problem solving withlarge language models.Advances in Neural Information Processing Systems(NeurIPS),2023.3

[0225]

[54] Hu Ye,Jun Zhang,Sibo Liu,Xiao Han,and Wei Yang.Ipadapter:Textcompatible image prompt adapter for text-to-image diffusion models.arXivpreprint arXiv:2308.06721,2023.2,5

[0226]

[55] Haotian Ye,Haowei Lin,Jiaqi Han,Minkai Xu,Sheng Liu,Yitao Liang,Jianzhu Ma,James Y Zou,and Stefano Ermon.Tfg:Unified training-free guidancefor diffusion models.Advances in Neural Information Processing Systems(NeurIPS),2024.2

[0227]

[56] Lvmin Zhang,Anyi Rao,and Maneesh Agrawala.Adding conditionalcontrol to text-to-image diffusion models.In Proceedings of the IEEEInternational Conference on Computer Vision(ICCV),pages 3836–3847,2023.2,5

[0228]

[57] Zikai Zhou, Shitong Shao, Lichen Bai, Zhiqiang Xu, Bo Han, and Zeke Xie. Golden noise for diffusion models: A learning framework. arXiv preprint arXiv:2411.09502,2024.2,5

[0229]

[58] Le Zhuo, Ruoyi Du, Han Xiao, Yangguang Li, Dongyang Liu, Rongjie Huang, Wenze Liu, Xiangyang Zhu, Fu-Yun Wang, Zhanyu Ma, et al. Lumina-next: Making lumina-t2x stronger and faster with next-dit. In Advances in Neural Information Processing Systems (NeurIPS), 2024, 1, 2

Claims

1. A text-to-image diffusion model inference optimization method based on reflective fine-tuning, characterized in that, Includes the following steps: S1. Constructing a reflection dataset: Collect and construct a large-scale reflection dataset containing multiple triples, each triple including: a defective image, a high-quality image, and a textual reflection describing the defect of the defective image. The dataset covers multiple domains to support the reflective-level expansion of the model. S2, Training the corrector model: Based on the aforementioned reflection dataset, the pre-trained text-to-image diffusion model is fine-tuned to train a corrector model, which enables the corrector model to generate optimized images based on text reflection and defective images. The fine-tuning process is achieved through a joint multimodal attention mechanism without the need to introduce additional modules. S3, Inference Optimization Framework: During the inference phase, the generated image is optimized using the corrector model through the following three complementary dimensions: Noise level expansion: Explore the diversity of generated images by using different initial noise samples to optimize potential initialization; Prompt-level extension: Dynamically optimize text prompts based on input prompts and quality feedback of generated images to achieve precise semantic guidance; Reflective-level extension: Iteratively evaluates and corrects previously generated images, progressively improving image quality. The iterative optimization process is based on the corrector model and text reflection. S4. Generate optimized image: In each iteration, the corrector model is used to generate a new set of candidate images by combining the optimized hints and the images generated in the previous iteration. The best image is selected by the validator as the input for the next iteration, and finally the optimized high-quality image is output.

2. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In step S1, when constructing the reflection dataset: a large language model is used to list common object categories and their attributes; text prompts are constructed by combining them using a rule-based method, and samples are filtered to avoid overlap with existing benchmark samples; candidate images are generated for each prompt using a specific model; image attributes are verified and evaluated using a visual model with object detection and segmentation capabilities; and the accuracy of correct images is ensured using a multimodal large language model with visual understanding capabilities; the difficulty of the prompts is estimated based on the proportion of correctly generated samples; prompts with abnormal difficulty are discarded; the images with the highest and lowest scores among the remaining prompts are randomly paired to construct optimization pairs; text reflections are generated using a multimodal large language model; and data is collected from four data sources: rule-based data, reward-based data, long and short prompt data, and edit data, ultimately forming a large-scale reflection dataset containing data from multiple domains.

3. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In step S1, for reward-based triple construction: collect synthetic titles and common cues generated by real users, and generate candidate images for each cue using a specific model; An ensemble scoring strategy based on multiple reward models evaluates image quality and alignment with cues. Optimized pairs are constructed by randomly pairing images from the first k and last k subsets of each cue. A multimodal large language model is used to generate textual reflection instructions based on cue alignment, aesthetic quality, and visual fidelity.

4. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In step S1, for the construction of detail-short cue triples: the multimodal large language model is fine-tuned, and the detailed cue annotations of the large language model are condensed into short versions. The images generated from these two types of cue naturally form image pairs. An integrated reward scoring method is used to filter the image pairs, and the multimodal large language model is used to generate reflective instructions.

5. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In step S1, when expanding the dataset using existing image editing data: high-quality editing samples are selected from the model dataset with diverse image editing functions, and detailed synthetic captions are generated for these samples using the fine-tuned caption model; all generated reflexive instructions are rigorously cleaned and filtered in post-processing, and a representative sample subset is manually checked to verify their correctness and consistency.

6. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In step S2, when training the corrector model, the joint multimodal attention mechanism used is as follows: the text input, the defective image, and the optimized image are concatenated into a fusion sequence, so that Q, K, and V are obtained by linear projection from the concatenated labeled sequence, thereby realizing multimodal attention calculation, where the text input is a concatenation of the original input cue and the reflection cue.

7. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 6, characterized in that, In step S2, when training the corrector model, the text input, the defective image, and the optimized image are concatenated into a unified sequence. Q, K, and V are obtained through linear projection. Multimodal attention is calculated using a multi-head self-attention mechanism to achieve bidirectional information exchange between different modalities without the need for additional specialized modules. The defective image serves as conditional information and can be further downsampled to improve the computational efficiency of training and inference. Standard diffusion or flow matching loss is applied to the optimized target image for training.

8. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In step S2, the training strategy used when training the corrector model includes: randomly discarding the original cue, reflection cue, and defective input images with a certain probability, wherein the reflection cue and defective images are discarded simultaneously with a relatively high probability; and using a "task warm-up" method to dynamically adjust the sampling probability of multiple data domains during training. Initially, the sampling probability of the edited data is increased, and then the sampling probability of the rule-based data, reward-based data, and long / short cue data (excluding edited data) is gradually increased to improve the overall performance of the model and compensate for the possible visual quality degradation in the edited data.

9. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In step S3, when expanding the noise level: the number of different initial noise samples generated in each round of exploration is defined as the search width. By increasing the search width, the diversity in the distribution learned by the diffusion model is explored. However, since the initial noise generation processes are independent of each other and depend on the feedback of the task-related validators, simply increasing the search width may lead to diminishing returns in computational efficiency.

10. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In step S3, during the cue-level expansion: In each iteration, the multimodal large language model is used to optimize the text cue based on the original user cue, the previously generated image and its evaluation score, without explicit gradient information, so as to generate accurate and effective cue for subsequent image generation iterations.

11. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In step S4, when generating optimized images: first, a set of initial candidate images is generated using a generator implemented by unloading low-rank adaptation weights; at each iteration, a multimodal large language model validator is used to evaluate and rank the images generated in the previous iteration from multiple dimensions, and text reflections and user prompts are generated based on the evaluation scores and previously generated images; the reflected and improved prompts are input into a trained corrector model with low-rank adaptation to generate new candidate images; the validator is used to select the best image for each optimization chain, and then the best image is selected from all chains as the final output.

12. The text-to-image diffusion model inference optimization method based on reflective fine-tuning according to claim 1, characterized in that, In steps S3 and S4: Given a text prompt and a text-to-image generator, the generator first generates an initial image; in each optimization iteration, the corrector model is used to generate an optimized image based on the image from the previous iteration, the original text prompt, and the text reflection describing previous shortcomings and directions for improvement; the text reflection is generated after the quality of the generated image is evaluated by an external evaluation module; the probability of finally generating an optimized image is the product of the initial image generation probability and the probability of the corrector model generating the corresponding image in each iteration. Through this iterative process, candidate images are continuously generated and optimized by combining relevant factors, and a high-quality image is output.

13. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the text-to-image diffusion model inference optimization method based on reflective fine-tuning as described in any one of claims 1 to 13.

14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the text-to-image diffusion model inference optimization method based on reflective fine-tuning as described in any one of claims 1 to 13.