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

2 Oct 2023  ·  Xuan Ju, Ailing Zeng, Yuxuan Bian, Shaoteng Liu, Qiang Xu ·

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.

PDF Abstract

Datasets


Introduced in the Paper:

PIE-Bench
Task Dataset Model Metric Name Metric Value Global Rank Result Benchmark
Text-based Image Editing PIE-Bench Direct Inversion+Prompt-to-Prompt CLIPSIM 25.02 # 4
Structure Distance 11.65 # 1
Background PSNR 27.22 # 3
Background LPIPS 54.55 # 3
Text-based Image Editing PIE-Bench Direct Inversion+Plug-and-Play CLIPSIM 25.41 # 1
Structure Distance 24.29 # 8
Background PSNR 22.46 # 9
Background LPIPS 106.06 # 9
Text-based Image Editing PIE-Bench Direct Inversion+Pix2Pix-Zero CLIPSIM 23.31 # 13
Structure Distance 49.22 # 12
Background PSNR 21.53 # 12
Background LPIPS 138.98 # 12
Text-based Image Editing PIE-Bench Direct Inversion+MasaCtrl CLIPSIM 24.38 # 11
Structure Distance 24.70 # 9
Background PSNR 22.64 # 8
Background LPIPS 87.94 # 8

Methods