[论文解读] Null-text Inversion for Editing Real Images using Guided Diffusion Models
本文提出了一种名为零文本反演(null-text inversion)的两阶段方法,利用引导扩散模型实现对真实图像的高保真度文本编辑。通过结合关键点反演(pivotal inversion)——在DDIM推导的噪声轨迹周围进行优化——与零文本优化(null-text optimization)——仅微调无条件文本嵌入——该方法实现了精确的图像重建,并实现了无需模型微调的无缝提示到提示(prompt-to-prompt)编辑,达到了近乎完美的保真度并保留了编辑能力。
Recent text-guided diffusion models provide powerful image generation capabilities. Currently, a massive effort is given to enable the modification of these images using text only as means to offer intuitive and versatile editing. To edit a real image using these state-of-the-art tools, one must first invert the image with a meaningful text prompt into the pretrained model's domain. In this paper, we introduce an accurate inversion technique and thus facilitate an intuitive text-based modification of the image. Our proposed inversion consists of two novel key components: (i) Pivotal inversion for diffusion models. While current methods aim at mapping random noise samples to a single input image, we use a single pivotal noise vector for each timestamp and optimize around it. We demonstrate that a direct inversion is inadequate on its own, but does provide a good anchor for our optimization. (ii) NULL-text optimization, where we only modify the unconditional textual embedding that is used for classifier-free guidance, rather than the input text embedding. This allows for keeping both the model weights and the conditional embedding intact and hence enables applying prompt-based editing while avoiding the cumbersome tuning of the model's weights. Our Null-text inversion, based on the publicly available Stable Diffusion model, is extensively evaluated on a variety of images and prompt editing, showing high-fidelity editing of real images.
研究动机与目标
- 利用最先进的文本到图像扩散模型,实现直观的、基于文本的真实图像编辑。
- 解决将真实图像反演到无分类器引导扩散模型潜在空间的挑战,同时保持编辑能力。
- 开发一种方法,避免为每张图像进行计算成本高昂的模型微调或权重更新。
- 在文本引导下实现真实图像的高保真重建,从而实现后续编辑时失真最小化。
提出的方法
- 提出关键点反演:使用DDIM反演生成的一系列噪声潜在码作为固定的优化基准,而非对所有噪声向量进行优化。
- 引入零文本优化:不修改条件文本嵌入,而是优化无条件(零)文本嵌入,以更好地重建输入图像。
- 以Stable Diffusion模型为骨干网络,利用其无分类器引导机制以保持编辑灵活性。
- 围绕DDIM反演轨迹进行优化,以纠正无分类器引导引入的重建误差。
- 将优化后的零文本嵌入应用于反演图像,以实现提示到提示的编辑,同时保持身份和结构一致性。
- 避免调整模型权重或条件嵌入,确保模型先验保持完整,从而实现高效、可重复的编辑。
实验结果
研究问题
- RQ1能否在保留编辑能力的前提下,以高保真度将真实图像反演到文本引导扩散模型的潜在空间?
- RQ2在图像反演过程中,如何有效管理无分类器引导所放大的重建误差?
- RQ3一次反演是否能够支持无需重新反演图像的多次、多样化基于文本的编辑?
- RQ4仅优化零文本嵌入是否能获得比优化条件嵌入或模型权重更好的重建效果?
- RQ5该反演方法是否能够支持高级编辑技术(如提示到提示编辑),同时保持身份保真度?
主要发现
- 零文本反演实现了真实图像的近乎完美重建,其LPIPS感知距离显著低于基线方法SDEdit在编辑前的应用结果。
- 该方法实现了高保真度编辑,支持提示到提示编辑,即使在复杂提示变更下也能保持原始图像的身份特征。
- 通过仅优化零文本嵌入,该方法避免破坏模型先验,同时消除了每张图像都需要模型微调的需要。
- 消融实验证实,关键点反演与零文本优化均至关重要,两者对重建保真度均有显著贡献。
- 该方法通过降低重建误差,提升了SDEdit的性能,尤其在目标文本对齐与输入保真度之间取得平衡时效果更明显。
- 尽管每张图像的反演耗时约一分钟,但后续每次编辑可在十秒内完成,支持无限次重复编辑,整体效率极高。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。