[论文解读] StyleDiffusion: Prompt-Embedding Inversion for Text-Based Editing
StyleDiffusion 从真实图像学习提示嵌入以进行编辑,使用跨注意力中的值路径,结合注意力正则化,以及同时使用无条件分支以获得更准确的编辑的 P2Plus 编辑方案。
A significant research effort is focused on exploiting the amazing capacities of pretrained diffusion models for the editing of images.They either finetune the model, or invert the image in the latent space of the pretrained model. However, they suffer from two problems: (1) Unsatisfying results for selected regions and unexpected changes in non-selected regions.(2) They require careful text prompt editing where the prompt should include all visual objects in the input image.To address this, we propose two improvements: (1) Only optimizing the input of the value linear network in the cross-attention layers is sufficiently powerful to reconstruct a real image. (2) We propose attention regularization to preserve the object-like attention maps after reconstruction and editing, enabling us to obtain accurate style editing without invoking significant structural changes. We further improve the editing technique that is used for the unconditional branch of classifier-free guidance as used by P2P. Extensive experimental prompt-editing results on a variety of images demonstrate qualitatively and quantitatively that our method has superior editing capabilities compared to existing and concurrent works. See our accompanying code in Stylediffusion: \url{https://github.com/sen-mao/StyleDiffusion}.
研究动机与目标
- 在不进行广泛提示工程或完整模型微调的情况下,促进使用扩散模型对真实图像进行准确的文本引导编辑。
- 提出将输入图像映射到值分支(prompt-embedding),同时冻结键分支以保留注意力图。
- 引入注意力正则化以提高重建和编辑保真度。
- 开发 P2Plus,一种增强的编辑策略,亦交换无条件自注意力图以应对大规模结构化编辑。
- 通过定性与定量指标的对比,经验性地证明相对于基线在编辑精度和结构保留方面的优越性。
提出的方法
- 以 DDIM 反演作为起点,获取真实图像的潜在编码和注意力图。
- 将输入图像映射到提示嵌入,供跨注意力中的值流使用,同时保持键嵌入冻结。
- 训练映射网络 M_t,使用重建损失和注意力损失来对齐反演与重建的潜在变量和注意力图(L_rec + L_att)。
- 提出 P2Plus,用于替换条件分支和无条件分支中的自注意力图(带有可调注入时间步 tau_u),以实现更忠实的结构性编辑。
- 通过类似 P2P 的提示到提示引导(及其无条件分支扩展)来增强编辑,以在保持背景结构的同时改进对象级编辑。
实验结果
研究问题
- RQ1如何在不降低非编辑区域质量或不进行穷尽提示工程的情况下实现真实图像的编辑?
- RQ2是否将编辑限制在跨注意力中的值路径以保持结构,同时实现有针对性的风格编辑?
- RQ3通过 P2Plus 引入无条件分支注意力是否能在大结构编辑方面优于 P2P?
- RQ4注意力正则化与基于 DDIM 的反演是否比现有反演方法在重建和可编辑性方面表现更好?
主要发现
| Metric | Structure-dist ↓ | NS-LPIPS ↓ | Clipscore ↑ |
|---|---|---|---|
| DDIM | 0.092 | 0.4131 | 81.9 % |
| SDEit | 0.046 | 0.2473 | 78.0 % |
| Null-text | 0.027 | 0.1480 | 75.2 % |
| Ours | 0.026 | 0.1165 | 77.9 % |
| Inference Time (per timestep) | - | - | - |
- StyleDiffusion 在定性与定量指标上实现比基线更准确的重建与编辑。
- 注意力正则化提高了重建保真度,使跨注意力图与 DDIM 反演的注意力图对齐。
- P2Plus 编辑还能将无条件分支注入,比 P2P 在处理大结构变更方面更好。
- 在一个 100 图像数据集上,StyleDiffusion 实现了最佳 Structure-dist 与 NS-LPIPS 分数,并在 Clipscore 上与基线相比具有竞争力。
- 该方法在重建时保持较高的 PSNR/SSIM,推理时开销仅 modest。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。