FireFlow: Fast Inversion of Rectified Flow for Image Semantic Editing
Yingying Deng, Xiangyu He, Changwang Mei, Peisong Wang, Fan Tang
TL;DR
FireFlow tackles fast, accurate inversion and editing for Rectified Flow (ReFlow) models by introducing a low-cost, second-order-accurate ODE solver that reuses velocity estimates to match the accuracy of higher-order schemes at the cost of an Euler step. This training-free approach leverages the near-constant velocity dynamics of well-trained ReFlow models to enable 8-step inversion and editing with improved reconstruction fidelity and faster performance. Empirical results show up to ~2.7× speedups and substantial error reductions in inversion and reconstruction, as well as competitive or superior results in text-guided generation and semantic editing (e.g., PIE-Bench), without needing auxiliary editing models. The method balances accuracy and efficiency, offering scalable, real-time capable inversion for ReFlow-based generation like FLUX and broader editing tasks, while noting limitations in color edits and proposing enhancements via attention feature integration. $v_\theta$ dynamics, step size $\Delta t$, and the modified midpoint updates underpin the core contributions and practical impact of FireFlow.$
Abstract
Though Rectified Flows (ReFlows) with distillation offers a promising way for fast sampling, its fast inversion transforms images back to structured noise for recovery and following editing remains unsolved. This paper introduces FireFlow, a simple yet effective zero-shot approach that inherits the startling capacity of ReFlow-based models (such as FLUX) in generation while extending its capabilities to accurate inversion and editing in $8$ steps. We first demonstrate that a carefully designed numerical solver is pivotal for ReFlow inversion, enabling accurate inversion and reconstruction with the precision of a second-order solver while maintaining the practical efficiency of a first-order Euler method. This solver achieves a $3\times$ runtime speedup compared to state-of-the-art ReFlow inversion and editing techniques, while delivering smaller reconstruction errors and superior editing results in a training-free mode. The code is available at $\href{https://github.com/HolmesShuan/FireFlow}{this URL}$.
