Skip to main content
QUICK REVIEW

[Paper Review] Null-text Inversion for Editing Real Images using Guided Diffusion Models

Ron Mokady, Amir Hertz|arXiv (Cornell University)|Nov 17, 2022
Generative Adversarial Networks and Image SynthesisComputer Science16 citations
TL;DR

This paper introduces null-text inversion, a two-stage method for high-fidelity text-based editing of real images using guided diffusion models. By combining pivotal inversion—optimizing around a DDIM-derived noise trajectory—and null-text optimization—fine-tuning only the unconditional text embedding—it enables precise image reconstruction and seamless prompt-to-prompt editing without model fine-tuning, achieving near-perfect fidelity and preserving editing capabilities.

ABSTRACT

Recent text-guided diffusion models provide powerful image generation capabilities. Currently, a massive effort is given to enable the modification of these images using text only as means to offer intuitive and versatile editing. To edit a real image using these state-of-the-art tools, one must first invert the image with a meaningful text prompt into the pretrained model's domain. In this paper, we introduce an accurate inversion technique and thus facilitate an intuitive text-based modification of the image. Our proposed inversion consists of two novel key components: (i) Pivotal inversion for diffusion models. While current methods aim at mapping random noise samples to a single input image, we use a single pivotal noise vector for each timestamp and optimize around it. We demonstrate that a direct inversion is inadequate on its own, but does provide a good anchor for our optimization. (ii) NULL-text optimization, where we only modify the unconditional textual embedding that is used for classifier-free guidance, rather than the input text embedding. This allows for keeping both the model weights and the conditional embedding intact and hence enables applying prompt-based editing while avoiding the cumbersome tuning of the model's weights. Our Null-text inversion, based on the publicly available Stable Diffusion model, is extensively evaluated on a variety of images and prompt editing, showing high-fidelity editing of real images.

Motivation & Objective

  • To enable intuitive, text-based editing of real images using state-of-the-art text-to-image diffusion models.
  • To address the challenge of inverting real images into the latent space of classifier-free guided diffusion models while preserving editing capabilities.
  • To develop a method that avoids computationally expensive model fine-tuning or weight updates for each image.
  • To achieve high-fidelity reconstruction of real images under text guidance, enabling subsequent editing with minimal distortion.

Proposed method

  • Proposes pivotal inversion: using a sequence of noisy latent codes from DDIM inversion as a fixed pivot for optimization, rather than optimizing over all noise vectors.
  • Introduces null-text optimization: instead of modifying the conditional text embedding, it optimizes the unconditional (null) text embedding to better reconstruct the input image.
  • Uses the Stable Diffusion model as the backbone, leveraging its classifier-free guidance mechanism to maintain editing flexibility.
  • Performs optimization around the DDIM inversion trajectory to correct reconstruction errors introduced by classifier-free guidance.
  • Applies the optimized null-text embedding to enable prompt-to-prompt editing on the inverted image, preserving identity and structure.
  • Avoids tuning model weights or conditional embeddings, ensuring the model’s prior remains intact and enabling efficient, repeated editing.

Experimental results

Research questions

  • RQ1Can real images be inverted into the latent space of a text-guided diffusion model with high fidelity while preserving editing capabilities?
  • RQ2How can classifier-free guidance, which amplifies reconstruction errors, be effectively managed during image inversion?
  • RQ3Can a single inversion enable multiple, diverse text-based edits without re-inverting the image?
  • RQ4Does optimizing only the null-text embedding yield better reconstruction than optimizing the conditional embedding or model weights?
  • RQ5Can the inversion method support advanced editing techniques like prompt-to-prompt while maintaining identity fidelity?

Key findings

  • Null-text inversion achieves near-perfect reconstruction of real images, with LPIPS perceptual distance significantly lower than baseline SDEdit when applied before editing.
  • The method enables high-fidelity editing using prompt-to-prompt, preserving the original image identity even under complex caption changes.
  • By optimizing only the null-text embedding, the approach avoids damaging the model’s prior and eliminates the need for model fine-tuning per image.
  • The ablation study confirms that both pivotal inversion and null-text optimization are essential, with each contributing significantly to reconstruction fidelity.
  • The method improves SDEdit results by reducing reconstruction error, especially when the target text alignment is balanced with input fidelity.
  • Despite a one-minute inversion time per image, the method enables infinite subsequent edits in under ten seconds each, making it efficient for repeated editing.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.