Semantic Image Inversion and Editing using Rectified Stochastic Differential Equations

Litu Rout, Yujia Chen, Nataniel Ruiz, Constantine Caramanis, Sanjay Shakkottai, Wen-Sheng Chu · DOI

Introduction

Image inversion—the process of mapping a real image back into the latent noise space of a generative model—is a critical prerequisite for semantic image editing. While Diffusion Models (DMs) have revolutionized image generation, they often struggle with a fundamental trade-off between faithfulness to the original image and the ability to perform meaningful edits. Traditional inversion methods frequently suffer from "drift," where the reconstructed image loses the identity of the source, or require computationally expensive per-image optimization.

This paper introduces a novel framework for image inversion and editing using Rectified Flows (RFs). By framing inversion as a dynamic optimal control problem, the authors achieve high-fidelity, zero-shot editing without the need for model fine-tuning or time-consuming test-time optimization.

Methodology

The core of the proposed approach lies in leveraging the unique properties of Rectified Flows, such as the Flux model, which learn straight-line trajectories (ODEs) between noise and data. The authors contribute three key technical advancements:

  1. LQR-Based Inversion: The inversion process is treated as an optimal control problem. Using a Linear Quadratic Regulator (LQR), the method finds a "minimum energy" path to transform an image back into noise. This ensures the resulting latent representation is both consistent with the specific input image and resides within the model's expected distribution.
  2. Rectified SDEs: The authors derive a stochastic equivalent to their controlled ODE, termed a Rectified Stochastic Differential Equation. This allows for the design of a stochastic sampler that provides robustness against discretization errors common in pure ODE-based inversion.
  3. Zero-Shot Pipeline: The framework is entirely zero-shot, utilizing analytical solutions from the LQR framework to guide the model during both the inversion and the subsequent editing phase.

Experimental Evaluation

The researchers evaluated the method on standard benchmarks including LSUN-Bedroom, LSUN-Church, and SFHQ (Synthetic Faces High Quality). These datasets cover tasks ranging from turning sketches into realistic scenes (Stroke2Image) to complex semantic face editing.

Original face image from the SFHQ dataset used for semantic editing tasks.
Result of semantic age editing, demonstrating the framework's ability to maintain identity while applying significant transformations.

Key Results

The proposed method demonstrates significant improvements over existing optimization-free diffusion baselines:

  • Realism: In human evaluations for the Stroke-to-Image task on LSUN-Bedroom, the method was rated 89% more realistic than previous state-of-the-art techniques (NTI+P2P).
  • Faithfulness: Face reconstruction accuracy improved by 29% compared to standard diffusion-based inversion methods.
  • Efficiency: By avoiding test-time optimization, the approach achieves a 54% gain in runtime compared to optimization-based methods like NTI, even when utilizing larger backbones like Flux.
  • Qualitative Performance: The method successfully handles complex, sequential edits (e.g., adding multiple toppings to a pizza) and smooth semantic interpolations (e.g., aging or gender transitions) while preserving the structural integrity of the original image.

Conclusion and Future Work

By utilizing the straight-line trajectories of Rectified Flows and the mathematical rigor of LQR control, this work provides a robust solution to the faithfulness-editability trade-off in image inversion. While currently tailored to the Multi-Modal Diffusion Transformer (MM-DiT) architecture, the underlying theory is generalizable. Future research directions include extending this framework to video inversion and more complex, multi-object scene manipulations.

Summary updated

BibTeX
@inproceedings{rout2025semantic,
  author = {Litu Rout and Yujia Chen and Nataniel Ruiz and Constantine Caramanis and Sanjay Shakkottai and Wen-Sheng Chu},
  title = {{Semantic Image Inversion and Editing using Rectified Stochastic Differential Equations}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=Hu0FSOSEyS},
}
Figure