# Poster 28072

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/28072

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

Hi, my name is Dvir Samuel and I'm excited to present our work Lightning Fast Image Inversion and Editing for Text to Image Diffusion Models. This is a joint project with collaborators from ImagineAI, Tel Aviv University, Bar-Ilan University, The Technion and NVIDIA Research. Let's start with the task of image editing from text. The idea is simple, take an input image and modify it based on a textual description.
For example changing a cat into a dog or a pizza into a bread just by changing the prompt. This lets users make intuitive high-level edits without touching any pixels. Today this is most commonly done using diffusion model inversion, which have become the leading approach for high quality text-guided image generation. To understand how they work let's take a quick look about what are diffusion models and what is inversion.
In a nutshell, this is how diffusion models work: you start with an image to which you gradually add noise, until you are left with just a noise distribution which can be called seed. Diffusion models train a deep neural network to reverse this process and map noise into images. During inference, a new noise seed is sampled from a high-dimensional Gaussian distribution, and the reverse process is run conditioned on a desired prompt to generate a new image.
Different seeds and prompts will lead to different results. Image inversion aims to find an initial noise seed for a given image that when processed with a prompt generates back the input image. Essentially, it maps an image back to its latent seed. Existing inversion methods often struggle with the trade-off between speed and accuracy. For instance, DDIM is very fast but suffers from poor reconstruction quality.
On the other hand, methods like exact DPM are more accurate but require several minutes to recover a single seed. Other approaches fall somewhere in between but none offer both high speed and high fidelity. Our goal is to invert a given image both quickly and accurately. Let's take a closer look how diffusion models work.
Each step is a Gaussian transition that we denote by Q parameterized by schedule parameters alpha. DTM scheduler denoises the latent noise vector by adjusting it based on schedule parameters and the predicted noise. DTM proposed a simple inversion technique. Here the equation from the previous slide is rewritten using transposition of the equation terms. Note that this is an implicit equation of Zt.
Trying to avoid solving this implicit function, TDM proposed to approximate Z_t with Z_t minus 1, under the assumption that for relatively small steps, these Z_t's are relatively close. TDM inversion is fast but introduces cumulative errors, disrupting consistency and leading to poor image reconstruction. This is particularly problematic in models with few reverse steps.
Recent work tries to address this challenge by solving the implicit function as a root-finding problem, essentially minimizing their residual which is the difference between the two sides of the equation. They use numerical techniques like fixed point iteration or optimization methods such as gradient descent.
While these approaches improve accuracy, they still require many iterations and are far too slow for real-time applications. Can we do better? We propose to use the Newton-Raphson inversion method to solve the implicit function. Newton-Raphson is known for its fast convergence and we want to apply it here. But directly applying it here is infeasible. The future models operate in very high dimensional spaces, making Jacobian inversion computationally impossible.
To solve this we reduce the problem to a scalar function. So the Jacobian becomes a vector which we can handle efficiently using orthograd functions. While Newton-Raphson converges quickly in theory, in practice it often leads to out-of-distribution solutions and pure re-constructions. So we need a better guidance strategy. To address the undetermined nature of the inversion problem we introduce a guidance term which is a soft constraint into the Newton-Raphson objective.
We know that each step in the diffusion process follows a Gaussian distribution. We can use this information as prior over the latent variables Zt, ensuring our solution stays within the distribution. We do this by adding a negative log-likelihood penalty to the objective. This type of probabilistic guidance isn't used in current methods, and it opens the door for more stable and accurate future approaches.
We call our approach Guided Newton-Raphson Inversion, or GNR-I. Here we show a construction array Q_S_C of GNR -I compared to other methods. On the left, A, we plot PSNR versus runtime. GNR-I clearly stands out, it achieves the best reconstruction quality while being significantly faster than other approaches. On the top right, B, we show the convergence of the residual norm.
GNI reduces the residual quickly and reaches a low error within just one to two iterations and in C we track how PSNR improves with more iterations.
Genealogy reaches near-peak performance within two steps, requiring only 0.4 seconds compared to other 16 seconds for gradient descent methods. Due to its speed, our method enables real-time editing, a first in this field. On the left you can see interactive editing using our approach, GNRI.
Genelei precisely changes the target object without altering the background. On the right you can watch a real-time editing video demonstrating the efficiency and the effectiveness of our approach in practical applications. Thank you for listening.
