DCI: Dual-Conditional Inversion for Boosting Diffusion-Based Image Editing

Zixiang Li, Haoyu Wang, Wei Wang, Chuangchuang Tan, Yunchao Wei, Yao Zhao

TL;DR

Dual-Conditional Inversion (DCI) solves the long-standing trade-off between reconstruction accuracy and editing flexibility in diffusion models. By jointly conditioning the inversion process on both the source text prompt and the reference image through a two-stage fixed-point optimization, DCI achieves state-of-the-art results in maintaining structural consistency while allowing for precise semantic edits.

What Problem Does This Paper Address?

In the world of diffusion-based image editing, "inversion" is the critical first step. It involves taking a real image and finding the specific latent noise representation that, when processed by the model, reconstructs that exact image. Once you have this "noise code," you can manipulate it to change the image (e.g., turning a "round cake" into a "square cake").

However, standard inversion methods like DDIM suffer from a "latent noise gap." Because these models operate in discrete steps rather than a continuous flow, the mathematical assumptions used to reverse the process often break down. This leads to a frustrating trade-off: either the reconstructed image looks perfect but is impossible to edit, or the image is easy to edit but loses the fine details and structure of the original. Existing solutions often struggle when text descriptions are sparse or when the image contains complex visual details that words cannot fully capture.

Methods

DCI introduces a novel framework that treats inversion as a dual-condition fixed-point optimization problem. Instead of relying solely on text, it uses the original image as a visual anchor.

Overview of the Dual-Conditional Inversion (DCI) framework.

The process consists of two alternating stages at each timestep:

  1. Reference-Guided Noise Correction: The model computes an initial noise estimate based on the text prompt. It then extracts a "reference noise" from the original image using a VAE encoder. By calculating the discrepancy between these two, DCI applies a one-step gradient correction to "anchor" the noise trajectory to the actual visual structure of the source image.
  2. Fixed-Point Latent Refinement: To ensure the path is self-consistent, DCI treats the latent variable as a fixed point in the generative trajectory. It iteratively refines the latent state until it satisfies a self-consistency loss. This ensures that the "inverted" path aligns perfectly with how the model naturally generates images, reducing artifacts and "drift."

Crucially, DCI is a plug-and-play method. It requires no retraining of the underlying diffusion model (like Stable Diffusion) and can be integrated seamlessly into various editing pipelines like Prompt-to-Prompt (P2P) or MasaCtrl.

Key Insights and Ideas

  • Text is Coarse, Images are Fine: The core insight is realizing that text prompts are often too ambiguous to guide a precise inversion. By using the image itself as a secondary condition (the "Dual" in DCI), the model doesn't have to "guess" the structural details.
  • Fixed-Point Stability: Treating inversion as a fixed-point problem provides a mathematical guarantee of stability. It ensures that the noise found at step $T$ will actually lead back to the image at step $0$ along a path the model understands.
  • Efficiency via "Nudging": Unlike some optimization methods that take minutes per image, DCI is highly efficient. Because it focuses on "nudging" the trajectory back onto the correct path rather than starting from scratch, it achieves high fidelity with only a few iterations (usually <10).

Key Results

DCI was evaluated on the PIE-Bench and COCO2017 datasets, outperforming all major baselines (including DDIM, NTI, and SPDInv) across multiple metrics:

Visual comparison of DCI against baseline inversion methods on various image editing tasks.
  • Structural Fidelity: Achieved a 31.1% reduction in DINO score (lower is better for structural similarity) compared to the previous state-of-the-art, SPDInv.
  • Reconstruction Quality: Showed significant improvements in PSNR (29.38 vs. 28.60 for the next best) and MSE, indicating much closer alignment with the original image.
  • Editability: In human preference studies, DCI was consistently rated higher for its ability to follow editing instructions while preserving the background and non-edited regions.
  • Speed: Despite being an iterative optimization method, DCI is remarkably fast, taking roughly 12.1 seconds per image on an RTX 4090—nearly 11x faster than Null-Text Inversion (NTI).

Limitations and Future Work

  • Computational Overhead: While faster than many competitors, DCI still adds a small amount of overhead compared to simple feed-forward inversion.
  • Editing Engine Dependency: DCI improves the inversion, but the final edit is still limited by the quality of the downstream editing engine (e.g., P2P). If the editing model fails to understand a complex prompt, DCI cannot fix that.
  • Architecture Specificity: Currently, the method is implemented and evaluated primarily for DDIM-based architectures. Extending this to other samplers like DPM-Solver or newer architectures like Diffusion Transformers (DiT) is a noted direction for future research.
  • Modality Expansion: The authors suggest exploring DCI for video and 3D scene editing in the future.

Summary updated

BibTeX
@inproceedings{li2025dci,
  author = {Zixiang Li and Haoyu Wang and Wei Wang and Chuangchuang Tan and Yunchao Wei and Yao Zhao},
  title = {{DCI: Dual-Conditional Inversion for Boosting Diffusion-Based Image Editing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=JH0DczMsAV},
}
Figure