PnP Inversion: Boosting Diffusion-based Editing with 3 Lines of Code
Xuan Ju, Ailing Zeng, Yuxuan Bian, Shaoteng Liu, Qiang Xu
摘要
ABSTRACT Text-guided diffusion models have revolutionized image generation and editing, offering exceptional realism and diversity. Specifically, in the context of diffusionbased 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 "PnP 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. We assume a 2-step diffusion process for illustration. Due to nonexistent of ideal z I 2 , common practice uses DDIM Inversion (Song et al., 2020) to approximate z I t , resulting in z Ip t with perturbation. Diffusionbased editing methods start from the perturbed noisy latent z Ip 2 and perform DDIM sampling in a source and a target diffusion branch, further resulting in the distance shown on the figure. Null-Text Inversion and StyleDiffusion optimize a specific latent used in both source and target branches to reduce this distance. Negative-Prompt Inversion assigns the guidance scale to 1 to decrease the distance. In contrast, PnP Inversion disentangles source and target branches in editing. By leaving the target diffusion branch untouched, PnP Inversion retains the edit fidelity. By directly returning the source branch to z src 0 , PnP Inversion achieves the best possible essential content preservation. We use numbers to mark operation step order, where solid circles are steps added by PnP Inversion. Text-guided diffusion models (Rombach et al., 2022; Ramesh et al., 2022) have become the mainstream image generation technique, praised for their realism and diversity. As the noise latent space of diffusion models (Meng et al., 2022; Kawar et al., 2023; Hertz et al., 2023; Balaji et al., 2022; Liu et al., 2023a) possesses the capacity to retain and modify images, we can perform prompt-based editing with diffusion models, where a source image is edited according to a target prompt. The common practice is to maintain two diffusion branches: one for the source image and the other for the target image. By carefully exchanging information between the two branches, we can preserve the essential content in the source image while achieving edit fidelity according to the target prompt. However, such manipulations are only straightforward when the diffusion latent space (noisy latent in each diffusion step) corresponding to the source image is available. When editing images without known latent space, we have to invert the diffusion model to obtain their latent vectors first. While DDIM inversion is effective for unconditional diffusion (Song et al., 2020; Dhariwal & Nichol, 2021) , much of the research (Hertz et al., 2023; Han et al., 2023) has centered on inverting the diffusion process with conditional inputs. This is driven by the significance of conditions in applications like text-based image editing. However, introducing conditions undermines DDIM inversion quality, as evidenced in Figure 2 . With the advent of Null-Text Inversion (Mokady et al., 2023) , a prevailing consensus (Dong et al., 2023; Li et al., 2023b) has emerged: achieving superior inversion foot_0 necessitates rigorous optimization. Methods that forgo such optimization, such as Negative-Prompt Inversion (Miyake et al., 2023) , compromise editing outcomes. In this paper, we challenge this prevailing wisdom, posing two fundamental questions: What exactly are these optimization-based inversion methods truly aiming at? And, are such optimizations indispensable for diffusion-based image editing? As illustrated in Figure 2 , prior optimization-based approaches strive to minimize the distance between z src 0 and z Fsg 0 /z Ftg 0 by indirectly tweaking the generation model's input parameters. Given the magnitude of the optimization network, like UNet, and the impracticality of prolonged optimization durations, these methods often optimize the
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 79 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- High-Resolution Image Synthesis with Latent Diffusion Models 引用了 Diffusion Models Beat GANs on Image Synthesis
- High-Resolution Image Synthesis with Latent Diffusion Models 引用了 Denoising Diffusion Implicit Models
- Schedule Your Edit: A Simple yet Effective Diffusion Noise Schedule for Image Editing 引用了 High-Resolution Image Synthesis with Latent Diffusion Models
- Schedule Your Edit: A Simple yet Effective Diffusion Noise Schedule for Image Editing 引用了 Diffusion Models Beat GANs on Image Synthesis
- Schedule Your Edit: A Simple yet Effective Diffusion Noise Schedule for Image Editing 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Schedule Your Edit: A Simple yet Effective Diffusion Noise Schedule for Image Editing 引用了 Denoising Diffusion Implicit Models
- UniEdit-Flow: Unleashing Inversion and Editing in the Era of Flow Models 引用了 High-Resolution Image Synthesis with Latent Diffusion Models
- UniEdit-Flow: Unleashing Inversion and Editing in the Era of Flow Models 引用了 Learning Transferable Visual Models From Natural Language Supervision
- UniEdit-Flow: Unleashing Inversion and Editing in the Era of Flow Models 引用了 Denoising Diffusion Implicit Models
- Diffusion Models Beat GANs on Image Synthesis 引用了 Learning Transferable Visual Models From Natural Language Supervision
- Diffusion Models Beat GANs on Image Synthesis 引用了 Denoising Diffusion Implicit Models
- DiT4Edit: Diffusion Transformer for Image Editing 引用了 High-Resolution Image Synthesis with Latent Diffusion Models
- DiT4Edit: Diffusion Transformer for Image Editing 引用了 Denoising Diffusion Implicit Models
- FlowAlign: Trajectory-Regularized, Inversion-Free Flow-based Image Editing 引用了 Learning Transferable Visual Models From Natural Language Supervision
- FlowAlign: Trajectory-Regularized, Inversion-Free Flow-based Image Editing 引用了 Denoising Diffusion Implicit Models
引用它的顶会 Paper79
- DiT4Edit: Diffusion Transformer for Image EditingKunyu Feng, Yue Ma, Bingyuan Wang, Chenyang Qi 等AAAI 2025 · 92 次引用
- Pico-Banana-400K: A Large-Scale Dataset for Text-Guided Image EditingYusu Qian, Eli Bocek-Rivele, Liangchen Song, Jialing Tong 等CVPR 2026 · 63 次引用
- Schedule Your Edit: A Simple yet Effective Diffusion Noise Schedule for Image EditingHaonan Lin, Yan Chen, Jiahao Wang, Wenbin An 等NeurIPS 2024 · 46 次引用
- UniEdit-Flow: Unleashing Inversion and Editing in the Era of Flow ModelsGuanlong Jiao, Biqing Huang, Kuan-Chieh Wang, Renjie LiaoICLR 2026 · 42 次引用
- FlowAlign: Trajectory-Regularized, Inversion-Free Flow-based Image EditingJeongsol Kim, Yeobin Hong, Jonghyun Park, Jong Chul YeICLR 2026 · 35 次引用
它引用的 Paper41
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh 等ICML 2021 · 47,906 次引用
- Diffusion Models Beat GANs on Image SynthesisPrafulla Dhariwal, Alexander Quinn NicholNeurIPS 2021 · 13,211 次引用
- High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser 等CVPR 2022 · 13,123 次引用
- Denoising Diffusion Implicit ModelsJiaming Song, Chenlin Meng, Stefano ErmonICLR 2021 · 11,743 次引用
- BLIP-2: Bootstrapping Language-Image Pre-training with Frozen Image Encoders and Large Language ModelsJunnan Li, Dongxu Li, Silvio Savarese, Steven C. H. HoiICML 2023 · 7,873 次引用
相关 Paper
- Prompt Tuning Inversion for Text-Driven Image Editing Using Diffusion ModelsWenkai Dong, Song Xue, Xiaoyue Duan, Shumin HanICCV 2023 · 104 次引用
- Editable Noise Map Inversion: Encoding Target-image into Noise For High-Fidelity Image ManipulationMingyu Kang, Yong Suk ChoiICML 2025
- MelodyEdit: Zero-shot Music Editing with Disentangled Inversion ControlHuadai Liu, Jialei Wang, Xiangtai Li, Wen Wang 等ACM MM 2025
- Noise Map Guidance: Inversion with Spatial Context for Real Image EditingHansam Cho, Jonghyun Lee, Seoung Bum Kim, Tae-Hyun Oh 等ICLR 2024 · 26 次引用
- DCI: Dual-Conditional Inversion for Boosting Diffusion-Based Image EditingZixiang Li, Haoyu Wang, Wei Wang, Chuangchuang Tan 等NeurIPS 2025 · 5 次引用
