Diffusion inversion is the problem of taking an image and a text prompt that describes it, and finding a noise latent that would generate the image. Most current inversion techniques operate by approximately solving an implicit equation, and may converge slowly or yield poor reconstructed images.

Here, we formulate the problem as finding the roots of an implicit equation and design a method to solve it efficiently. Our solution is based on Newton-Raphson (NR), a well-known technique in numerical analysis. A naive application of NR may be computationally infeasible and tends to converge to incorrect solutions. We describe an efficient regularized formulation that converges quickly to solution that provide high-quality reconstructions. We also identify a source of inconsistency stemming from prompt conditioning during the inversion process, which significantly degrades the inversion quality. To address this, we introduce a prompt-aware adjustment of the encoding, effectively correcting this issue.

Our solution, **R**egularized **N**ewton-**R**aphson **I**nversion, inverts an
image within 0.5 sec for
latent consistency models, opening the door for interactive image editing.
We further demonstrate improved results in image interpolation and generation of rare
objects.

(b) Prior effect on convergence. Incorporating our prior not only aids in finding the correct solution but also accelerates convergence.

```
@misc{samuel2023regularized,
author = {Dvir Samuel and Barak Meiri and Nir Darshan and Shai Avidan and Gal Chechik and Rami Ben-Ari},
title = {Regularized Newton Raphson Inversion for Text-to-Image Diffusion Models},
year = {2023}
}
```