Direct Inversion: Boosting Diffusion-based Editing with 3 Lines of Code

Xuan Ju, Ailing Zeng, Yuxuan Bian, Shaoteng Liu, Qiang Xu
10/2/2023
cs.CV

No official code found. Best implementation: cure-lab/PnPInversion (411 stars, PyTorch, last commit 2024-03-12).

Abstract

Text-guided diffusion models have revolutionized image generation and editing, offering exceptional realism and diversity. Specifically, in the context of diffusion-based editing, where a source image is edited according to a target prompt, the process commences by acquiring a noisy latent vector corresponding to the source image via the diffusion model. This vector is subsequently fed into separate source and target diffusion branches for editing. The accuracy of this inversion process significantly impacts the final editing outcome, influencing both essential content preservation of the source image and edit fidelity according to the target prompt. Prior inversion techniques aimed at finding a unified solution in both the source and target diffusion branches. However, our theoretical and empirical analyses reveal that disentangling these branches leads to a distinct separation of responsibilities for preserving essential content and ensuring edit fidelity. Building on this insight, we introduce "Direct Inversion," a novel technique achieving optimal performance of both branches with just three lines of code. To assess image editing performance, we present PIE-Bench, an editing benchmark with 700 images showcasing diverse scenes and editing types, accompanied by versatile annotations and comprehensive evaluation metrics. Compared to state-of-the-art optimization-based inversion techniques, our solution not only yields superior performance across 8 editing methods but also achieves nearly an order of speed-up.

View on arXivView PDF

Code Implementations(1)

PyTorch

[ICLR2024] Official repo for paper "PnP Inversion: Boosting Diffusion-based Editing with 3 Lines of Code"

41122Shell, PythonOct 3, 20232 years ago
deep-learningdiffusion-inversiondiffusion-modeldiffusion-modelsiclr2024+5 more

Similar Papers

Cite this paper

@article{ju2023direct,
  title  = {Direct Inversion: Boosting Diffusion-based Editing with 3 Lines of Code},
  author = {Xuan Ju and Ailing Zeng and Yuxuan Bian and Shaoteng Liu and Qiang Xu},
  year   = {2023},
  eprint = {2310.01506},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2310.01506v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.01506.svg)](https://codeofpaper.com/paper/2310.01506)

Discussion