ChatPaper.aiChatPaper

FlowOpt:基于全流程快速优化的免训练编辑方法

FlowOpt: Fast Optimization Through Whole Flow Processes for Training-Free Editing

October 24, 2025
作者: Or Ronai, Vladimir Kulikov, Tomer Michaeli
cs.AI

摘要

扩散模型与流匹配模型的显著成功,引发了大量研究致力于在测试阶段对其进行适配以实现可控生成任务。这些应用涵盖图像编辑、修复、压缩及个性化等多个领域。然而,由于此类模型的采样过程具有迭代特性,使用基于梯度的优化方法直接控制最终生成图像在计算上并不现实。因此,现有方法通常采用对每个时间步进行独立操作的策略。本文提出FlowOpt——一种将整个流过程视为黑箱的零阶(无梯度)优化框架,无需通过模型进行反向传播即可实现对整个采样路径的优化。该方法不仅效率卓越,还允许用户监控中间优化结果,并在需要时执行早停机制。我们证明了FlowOpt步长的充分条件,在该条件下可确保收敛至全局最优解,并进一步展示了如何通过经验估计该上界以选择合适的步长。我们通过图像编辑任务验证FlowOpt的实用性,展示两种应用模式:(i)反演(确定生成给定图像的初始噪声);(ii)在遵循目标文本提示的前提下,直接引导编辑图像与源图像保持相似性。两种场景下,FlowOpt在保持与现有方法基本相当的神经函数评估次数(NFEs)的同时,均实现了最先进的性能。代码及示例详见项目网页。
English
The remarkable success of diffusion and flow-matching models has ignited a surge of works on adapting them at test time for controlled generation tasks. Examples range from image editing to restoration, compression and personalization. However, due to the iterative nature of the sampling process in those models, it is computationally impractical to use gradient-based optimization to directly control the image generated at the end of the process. As a result, existing methods typically resort to manipulating each timestep separately. Here we introduce FlowOpt - a zero-order (gradient-free) optimization framework that treats the entire flow process as a black box, enabling optimization through the whole sampling path without backpropagation through the model. Our method is both highly efficient and allows users to monitor the intermediate optimization results and perform early stopping if desired. We prove a sufficient condition on FlowOpt's step-size, under which convergence to the global optimum is guaranteed. We further show how to empirically estimate this upper bound so as to choose an appropriate step-size. We demonstrate how FlowOpt can be used for image editing, showcasing two options: (i) inversion (determining the initial noise that generates a given image), and (ii) directly steering the edited image to be similar to the source image while conforming to a target text prompt. In both cases, FlowOpt achieves state-of-the-art results while using roughly the same number of neural function evaluations (NFEs) as existing methods. Code and examples are available on the project's webpage.
PDF21December 31, 2025