TL;DR
This paper introduces FlowEdit, a novel method for text-based image editing that bypasses the common "editing-by-inversion" paradigm. By directly constructing a path between source and target image distributions using pre-trained flow models, FlowEdit achieves state-of-the-art results in structure preservation and text adherence, offering a more efficient and transferable editing solution.
What Problem Does This Paper Address?
Editing real images using powerful text-to-image (T2I) generative models, like diffusion or flow models, has become a significant research area. The dominant approach, "editing-by-inversion," involves first "inverting" a real image to find its corresponding latent noise representation. This noise is then used with a modified text prompt to generate an edited image. However, this inversion process is often imperfect, leading to a loss of image fidelity and structure. To compensate, many methods resort to complex interventions within the model's sampling process or rely on test-time optimization, which can be computationally expensive and difficult to transfer across different model architectures. This paper addresses the limitations of inversion-based editing by proposing an "inversion-free" method that directly maps between image distributions, aiming for better structure preservation and broader applicability.
Methods
FlowEdit's core innovation lies in its departure from the inversion process. Instead of mapping an image to noise and then back to an edited image, FlowEdit constructs a direct Ordinary Differential Equation (ODE) path that connects the source image distribution to the target image distribution, guided by source and target text prompts. This direct path is designed to have a lower "transport cost" (a measure of how much the distribution needs to be deformed) compared to the inversion approach, which implicitly passes through a standard Gaussian distribution.
The method leverages pre-trained T2I flow models, specifically their velocity fields. For a source image $X_{src}$ and a target prompt $C_{tar}$, FlowEdit defines a new ODE whose velocity field is derived from the difference between the target and source model velocities. This new ODE is solved from $t=1$ (starting at $X_{src}$) to $t=0$ (ending at the edited image $X_{tar}$). A key aspect is the averaging of multiple random pairings and their associated velocity fields to improve robustness and achieve better pairings between source and target samples, as illustrated in Figure 3. The algorithm is optimization-free and model-agnostic, meaning it doesn't require fine-tuning the generative model or complex optimization at inference time, and can be applied to different flow-based T2I models.
Datasets
The paper utilizes a diverse dataset of over 70 real images from the DIV2K dataset and royalty-free sources. For each image, source prompts were obtained using LLaVA-1.5 and manually refined. Several handcrafted target prompts were provided to facilitate diverse edits. The authors also created a synthetic dataset of 1000 cat images generated by SD3 for quantitative evaluation of structure preservation and text adherence, comparing FlowEdit against inversion-based methods.
Key Insights and Ideas
- Inversion is the bottleneck: The paper strongly suggests that the inherent inaccuracies and high transport cost of the inversion process are the primary reasons for structural degradation in text-based image editing.
- Direct path is superior: By constructing a direct ODE path between source and target distributions, FlowEdit bypasses the problematic inversion step, leading to significantly better structure preservation.
- Model Agnosticism is achievable: FlowEdit's design, relying on the velocity fields of pre-trained flow models, makes it transferable across different architectures without requiring model-specific interventions.
- Averaging for better pairings: Using multiple random pairings and averaging their velocity fields is crucial for finding more desirable source-to-target sample mappings, leading to improved editing outcomes.
Key Results
FlowEdit achieves state-of-the-art results on various text-based image editing tasks. Qualitatively, it demonstrates superior structure preservation and text adherence compared to competing methods like SDEdit, iRFDS, and RF-Inversion, as shown in Figures 1, 5, 6, and 7. Quantitatively, on a synthetic dataset, FlowEdit achieved a lower transport cost (MSE and LPIPS) for cat-to-dog edits compared to inversion-based methods, indicating better preservation of the source image's structure and semantics. The method also shows a favorable balance between text adherence (CLIP) and structure preservation (LPIPS) across different hyperparameters.
Limitations and Future Work
The authors acknowledge that FlowEdit's strong emphasis on structure preservation can be a limitation when substantial modifications to large regions of the image are desired, such as significant pose or background changes (illustrated in supplementary figures). Future work could explore ways to balance structure preservation with the ability to perform more drastic edits. Additionally, while FlowEdit is model-agnostic, its performance is still dependent on the quality of the underlying pre-trained flow models.
Summary updated