arXiv:2510.24657cs.CV2025-10被引 6

通过重加权注意力差值实现图像编辑强度的精细控制。

Group Relative Attention Guidance for Image Editing

  • 基于查询与键的偏差差值重加权,调节模型关注点。
  • 无需调参即可实现连续可控的编辑强度,提升质量。
  • 仅需四行代码集成,适合快速部署的编辑任务。

基于Diffusion-in-Transformer的图像编辑技术发展迅速,但现有方法对编辑程度的控制能力不足,难以实现定制化结果。我们研究了DiT模型中的MM-Attention机制,发现查询与键令牌共享仅与层相关的偏置向量,该偏置反映模型固有的编辑行为,而各令牌与其对应偏置的差值则编码内容相关的编辑信号。基于此洞察,提出群组相对注意力引导(GRAG),通过重加权不同令牌的差值,调节模型对输入图像与编辑指令的关注度,实现无需调参的连续且精细的编辑强度控制。在多个现有图像编辑框架上的实验表明,GRAG仅需四行代码即可集成,持续提升编辑质量;相比常用的无分类器引导,能实现更平滑、更精确的编辑程度控制。代码将公开于https://github.com/little-misfit/GRAG-Image-Editing。

原文摘要 · Abstract (English)

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.

图像编辑注意力机制扩散模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。