ReNoise: Real Image Inversion Through Iterative Noising

1Tel-Aviv University     2Google Research

ECCV 2024


Our ReNoise inversion technique can be applied to various diffusion models, including recent few-step ones. This figure illustrates the performance of our method with SDXL Turbo and LCM models, showing its effectiveness compared to DDIM inversion. Additionally, we demonstrate that the quality of our inversions allows prompt-driven editing. As illustrated on the right, our approach also allows for prompt-driven image edits.

Abstract

Recent advancements in text-guided diffusion models have unlocked powerful image manipulation capabilities. However, applying these methods to real images necessitates the inversion of the images into the domain of the pretrained diffusion model. Achieving faithful inversion remains a challenge, particularly for more recent models trained to generate images with a small number of denoising steps. In this work, we introduce an inversion method with a high quality-to-operation ratio, enhancing reconstruction accuracy without increasing the number of operations. Building on reversing the diffusion sampling process, our method employs an iterative renoising mechanism at each inversion sampling step. This mechanism refines the approximation of a predicted point along the forward diffusion trajectory, by iteratively applying the pretrained diffusion model, and averaging these predictions. We evaluate the performance of our ReNoise technique using various sampling algorithms and models, including recent accelerated diffusion models. Through comprehensive evaluations and comparisons, we show its effectiveness in terms of both accuracy and speed. Furthermore, we confirm that our method preserves editability by demonstrating text-driven image editing on real images.

Editing Results with SDXL Turbo and LCM LoRA

Geometric intuition for ReNoise

  • At each inversion step, we are trying to estimate \(z_t\) (marked with a red star) based on \(z_{t-1}\).
  • The straightforward approach is to use the reverse direction of the denoising step from \(z_{t-1}\) (dashed green arrow), assuming the trajectory is approximately linear. However, this assumption is inaccurate, especially in few-step models, where the size of the steps is not small.
  • We use the linearity assumption only as an initial estimation and keep improving the estimation.
  • We recalculate the denoising step from the previous estimation, \(z_t^{(i)}\)(a blue point which is closer to the target \(z_t\)), and then proceed with its opposite direction from \(z_{t-1}\)(see the orange vectors).

How does it work?

  • Given an input image \(z_0\), we iteratively compute \(z_1, ..., z_T\) , where each \(z_t\) is calculated from \(z_{t-1}\)
  • At each time step, we apply the UNet (\(\epsilon_\theta\)) \(\mathcal{K}+1\) times, each using a better approximation of \(z_t\) as the input. The initial approximation is \(z_{t-1}\). The next one, \(z_t^{(1)}\), is the result of the reversed sampler step (i.e., DDIM). The reversed step begins at \(z_{t-1}\) and follows the direction of \(\epsilon_\theta(z_{t-1}, t)\). At the \(k\) renoising iteration, \(z_t^{(k)}\) is the input to the UNet, and we obtain a better \(z_t\) approximation.
  • To improve the reconstruction-editability tradeoff
    1. For the lasts iterations, we optimize \(\epsilon_\theta(z_{t}^{(k)}, t)\) to increase editability.
    2. As the final denoising direction, we use the average of the UNet predictions of the last few iterations.
  • This process is repeated across multiple timesteps of the inversion process resulting in \(z_T\).

Image Reconstruction Results

Image reconstruction results comparing sampler reversing inversion techniques across different samplers (e.g., vanilla DDIM inversion) with our ReNoise method using the same sampler. The number of denoising steps remains constant. However, the number of UNet passes varies, with the sampler reversing approach increasing the number of inversion steps, while our method increases the number of renoising iterations. We present various configuration options for our method, including options with or without edit enhancement loss and Noise Correction (NC).


BibTeX


      @misc{garibi2024renoise,
        title={ReNoise: Real Image Inversion Through Iterative Noising}, 
        author={Daniel Garibi and Or Patashnik and Andrey Voynov and Hadar Averbuch-Elor and Daniel Cohen-Or},
        year={2024},
        eprint={2403.14602},
        archivePrefix={arXiv},
        primaryClass={cs.CV}
      }