TL;DR
Rectified Flow (RF) models like FLUX and OpenSora represent the new state-of-the-art for image and video generation. However, they often struggle with "inversion drift"—a phenomenon where reconstructing an image from noise leads to noticeable distortions. To solve this, researchers introduce RF-Solver, a training-free, second-order ODE sampler that drastically reduces reconstruction error, and RF-Edit, a feature-sharing framework that enables precise image and video editing while preserving original structures.
What Problem Does This Paper Address?
While traditional Diffusion Models (like Stable Diffusion) use complex curved paths to turn noise into images, Rectified Flow (RF) models aim for a "straight-line" transition. This theoretical straightness makes them faster and more efficient. However, in practice, the "velocity field" predicted by the neural network isn't perfectly linear.
When researchers try to perform inversion (mapping a real image back into noise to edit it), standard first-order solvers (like Euler) accumulate significant discretization errors. By the time you try to "reconstruct" the image from that noise, the subject might have moved, colors might have shifted, or the video might be severely warped.
This "inversion inaccuracy" makes high-quality editing—like changing a horse to a camel without moving the background—nearly impossible for current RF-based models.
Methods: Fixing the Flow
The authors propose two main components to tame Rectified Flow models:
1. RF-Solver
Instead of relying on the standard first-order Euler method, the authors derive a higher-order solution for the Rectified Flow ODE. They use a second-order Taylor expansion to better estimate the non-linear components of the flow. To calculate the necessary derivatives without needing the "true" gradient of the model, they implement a clever "step-forward" trick: they take a tiny additional step ($\Delta t$) to estimate how the network's prediction is changing, then use that to correct the main trajectory. This reduces the local error from $O(h^2)$ to $O(h^3)$.
2. RF-Edit
To solve the problem of "losing the original structure" during editing, they introduce a feature-sharing mechanism. During the inversion process (Image $\to$ Noise), the model's self-attention Value ($V$) features are stored. During the editing process (Noise $\to$ Edited Image), these stored features are injected back into the model. This ensures the layout and structural integrity of the source are maintained while the new prompt modifies the appearance.
Critically, both methods are training-free and "plug-and-play" for any pre-trained RF model.
Key Insights and Ideas
- The "Straight Line" is a Lie: Even though RF models are trained to be straight, the discretization during inference introduces curvature. Acknowledging this non-linearity and using a higher-order solver is the key to fixing inversion.
- Two Forwards are Better Than One: RF-Solver requires two network passes per timestep (to calculate the derivative). Interestingly, the authors found that using RF-Solver with $N$ steps outperformed the vanilla solver with $2N$ steps, proving that mathematical precision is more important than simply increasing the sampling density.
- Attention Values as Anchors: By sharing the "Value" feature in self-attention, the model keeps the "what and where" of the original image (structural information) while allowing the "Query" and "Key" to adapt to the new text prompt.
Key Results
The researchers evaluated their methods across several benchmarks, including 10,000 images from the MS-COCO validation set, over 300 real and generated images for editing, and approximately 40 videos evaluated using VBench metrics.
- Superior Reconstruction: On image inversion tasks, RF-Solver achieved an MSE of 0.0092, compared to 0.0268 for the vanilla RF sampler—a massive improvement in fidelity.
- Better Generation: Even for standard text-to-image tasks, RF-Solver improved the FID score (a measure of image quality and diversity) from 25.33 to 23.98.
- Robust Editing: RF-Edit outperformed established baselines like Prompt-to-Prompt (P2P) and DiffEdit. It successfully handled complex scenarios while maintaining the structural integrity of the original subjects.
Limitations and Future Work
- Computational Overhead: Because RF-Solver requires two forward passes per step to estimate derivatives, it is effectively twice as slow per iteration as a standard Euler sampler.
- Diminishing Returns: The authors tested a 3rd-order expansion (RF-Solver-3), but found it didn't provide significant gains over the 2nd-order version, likely because the increased complexity reduced the total number of timesteps possible under a fixed compute budget.
- Hyperparameter Tuning: The "feature-sharing" step in RF-Edit currently requires some manual adjustment (e.g., deciding exactly how many timesteps to share features) to get the perfect balance between following the prompt and keeping the source structure. Automating this balance is a likely next step.
Summary updated