Group Relative Attention Guidance for Image Editing
该论文提出了一种名为“Group Relative Attention Guidance (GRAG)”的图像编辑方法,通过重新加权不同标记的delta值来调节模型对输入图像的关注点,从而实现对编辑强度的连续和细粒度控制。
更新于 2025-10-29。作者:Xuanpu Zhang、Xuesong Niu、Ruidong Chen、Dan Song、Jianhao Zeng、Penghui Du、Haoxiang Cao、Kai Wu、An-an Liu。
中文摘要
最近,基于Diffusion-in-Transformer模型的图像编辑技术得到了迅速发展。然而,现有的编辑方法往往缺乏对编辑程度的有效控制,限制了它们实现更定制化结果的能力。为了解决这一限制,我们研究了DiT模型中的MM-Attention机制,并观察到Query和Key标记共享一个仅与层相关的偏置向量。我们将这个偏置解释为模型固有的编辑行为,而每个标记与其对应偏置之间的差值则编码了内容特定的编辑信号。基于这一洞察,我们提出了组相对注意力引导(Group Relative Attention Guidance,简称GRAG),这是一种简单而有效的方法,通过重新加权不同标记的差值来调节模型对输入图像的关注度,相对于编辑指令,实现了连续和细粒度的编辑强度控制,无需任何调整。在现有图像编辑框架上进行的广泛实验表明,GRAG可以通过仅四行代码即可集成,并一致地提高编辑质量。此外,与常用的无分类器引导(Classifier-Free Guidance)相比,GRAG在控制编辑程度方面实现了更平滑和更精确的控制。我们的代码将在https://github.com/little-misfit/GRAG-Image-Editing上发布。
英文摘要
Recently, image editing based on Diffusion-in-Transformer models has undergone rapid development. However, existing editing methods often lack effective control over the degree of editing, limiting their ability to achieve more customized results. To address this limitation, we investigate the MM-Attention mechanism within the DiT model and observe that the Query and Key tokens share a bias vector that is only layer-dependent. We interpret this bias as representing the model's inherent editing behavior, while the delta between each token and its corresponding bias encodes the content-specific editing signals. Based on this insight, we propose Group Relative Attention Guidance, a simple yet effective method that reweights the delta values of different tokens to modulate the focus of the model on the input image relative to the editing instruction, enabling continuous and fine-grained control over editing intensity without any tuning. Extensive experiments conducted on existing image editing frameworks demonstrate that GRAG can be integrated with as few as four lines of code, consistently enhancing editing quality. Moreover, compared to the commonly used Classifier-Free Guidance, GRAG achieves smoother and more precise control over the degree of editing. Our code will be released at https://github.com/little-misfit/GRAG-Image-Editing.
解读
一句话总结
该论文提出了一种名为“Group Relative Attention Guidance (GRAG)”的图像编辑方法,通过重新加权不同标记的delta值来调节模型对输入图像的关注点,从而实现对编辑强度的连续和细粒度控制。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:现有的基于Diffusion-in-Transformer (DiT)模型的图像编辑方法通常缺乏对编辑程度的有效控制,限制了其实现更定制化结果的能力。
- 现有方案不足:现有的编辑方法往往无法平衡保持源图像的保真度和对编辑指令的响应性,导致用户需要依赖外部提示工程工具或进行多次推理才能获得满意的结果。
- 研究目标:提出一种新的方法,以实现对编辑强度的连续和细粒度控制,同时保持图像的保真度。
问题2:论文的核心创新点是什么?
- 技术创新:提出了Group Relative Attention Guidance (GRAG)机制,通过重新加权不同标记的delta值来调节模型对输入图像的关注点。
- 方法改进:利用了DiT模型中MM-Attention机制的Query和Key标记共享的偏置向量,该向量表示模型的固有编辑行为,而每个标记与其对应偏置之间的差值编码了内容特定的编辑信号。
- 优势:与常用的Classifier-Free Guidance相比,GRAG能够实现更平滑和更精确的编辑强度控制。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在现有的图像编辑框架上进行了大量实验,证明了GRAG能够通过少量代码集成,并一致地提高编辑质量。
- 性能提升:与基线方法相比,GRAG在LPIPS、SSIM、Cons、PF和EditScore等指标上均有所提升。
- 对比结果:与Classifier-Free Guidance相比,GRAG在编辑强度控制上表现出更平滑和精确的性能。
问题4:这个研究的实际应用价值是什么?
- 应用场景:GRAG可以应用于各种图像编辑任务,如对象添加/删除、风格转换和姿态修改。
- 实施建议:GRAG可以轻松集成到现有的DiT-based编辑器中,并提高其可控性和保真度。
- 局限与展望:在无训练设置中,GRAG的稳定性低于基于训练的模型。未来研究可以探索如何改进GRAG在无训练设置中的表现。