[论文解读] Prompt-to-Prompt Image Editing with Cross Attention Control
本文提出一个仅文本的 Prompt-to-Prompt 编辑框架,通过在扩散模型内部操作跨注意力映射来通过编辑 prompts 来编辑图像,同时在不使用掩模的情况下保留原始结构。
Recent large-scale text-driven synthesis models have attracted much attention thanks to their remarkable capabilities of generating highly diverse images that follow given text prompts. Such text-based synthesis methods are particularly appealing to humans who are used to verbally describe their intent. Therefore, it is only natural to extend the text-driven image synthesis to text-driven image editing. Editing is challenging for these generative models, since an innate property of an editing technique is to preserve most of the original image, while in the text-based models, even a small modification of the text prompt often leads to a completely different outcome. State-of-the-art methods mitigate this by requiring the users to provide a spatial mask to localize the edit, hence, ignoring the original structure and content within the masked region. In this paper, we pursue an intuitive prompt-to-prompt editing framework, where the edits are controlled by text only. To this end, we analyze a text-conditioned model in depth and observe that the cross-attention layers are the key to controlling the relation between the spatial layout of the image to each word in the prompt. With this observation, we present several applications which monitor the image synthesis by editing the textual prompt only. This includes localized editing by replacing a word, global editing by adding a specification, and even delicately controlling the extent to which a word is reflected in the image. We present our results over diverse images and prompts, demonstrating high-quality synthesis and fidelity to the edited prompts.
研究动机与目标
- 旨在在不需要用户提供掩模或额外训练的情况下实现直观、基于文本的图像编辑的动机。
- 研究跨注意力层作为提示标记与图像区域之间的语义桥梁。
- 开发基于提示的编辑操作,利用注意力操控来改变或保留图像结构。
提出的方法
- 分析文本条件扩散模型中的跨注意力,以将提示标记与空间图像区域相关联。
- 在扩散过程中将源图像的注意力映射注入并覆盖到已编辑的提示上以保持布局。
- 通过在扩散步骤中进行受控的注意力注入来定义编辑操作(词语替换、添加短语、注意力再加权)。
- 提供一个基于扩散的迭代算法,对源提示和编辑后的提示运行编辑,使用共享随机性以保持结构。
- 引入处理部分标记对齐和带时间戳的注入的机制,以在保真度和可编辑性之间取得平衡。
实验结果
研究问题
- RQ1如何在文本到图像扩散模型中利用跨注意力映射来在编辑过程中控制空间布局?
- RQ2是否可以通过编辑提示在不使用掩模或重新训练的情况下实现局部或全局的图像编辑?
- RQ3在应用提示更改时,哪些有效策略(例如注入时机、软约束)可以在保持原始构图的同时实现?
- RQ4通过反演在真实图像上,该方法的表现如何以及它的局限性?
- RQ5对编辑后提示的保真度与保留源图像结构之间的权衡是什么?
主要发现
- 跨注意力映射将像素与提示词紧密耦合,并且可以被操作来控制图像布局。
- 将源注意力映射注入到编辑后的提示中可保持构图,同时实现语义变更。
- 软性与部分注意力注入(通过时间戳 tau)降低过约束并保持可编辑性。
- 该方法支持词语替换、添加新短语和注意力再加权,以实现精细控制。
- 初步结果表明通过反演的真实图像编辑是可能的,结合基于掩模的改进可解决重建差距。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。