画像編集のためのグループ相対的アテンションガイダンス
Group Relative Attention Guidance for Image Editing
October 28, 2025
著者: Xuanpu Zhang, Xuesong Niu, Ruidong Chen, Dan Song, Jianhao Zeng, Penghui Du, Haoxiang Cao, Kai Wu, An-an Liu
cs.AI
要旨
最近、Diffusion-in-Transformerモデルに基づく画像編集技術は急速な発展を遂げています。しかし、既存の編集手法では編集の度合いを効果的に制御することが難しく、よりカスタマイズされた結果を得る能力が限られています。この課題を解決するため、我々はDiTモデル内のMM-Attentionメカニズムを調査し、QueryトークンとKeyトークンがレイヤ依存のバイアスベクトルを共有していることを発見しました。このバイアスはモデル固有の編集挙動を表し、各トークンと対応するバイアスとの差分はコンテンツ固有の編集信号を符号化していると解釈します。この知見に基づき、我々はGroup Relative Attention Guidance(GRAG)を提案します。これは異なるトークンの差分値を再重み付けすることで、編集指示に対するモデルの入力画像への注目度を調整し、チューニングなしで編集強度の連続的できめ細かい制御を可能とするシンプルかつ効果的な手法です。既存の画像編集フレワークを用いた大規模な実験により、GRAGがわずか4行のコードで統合可能であり、編集品質を一貫して向上させることが実証されました。さらに、一般的に使用されるClassifier-Free Guidanceと比較して、GRAGは編集の度合いに関してより滑らかで精密な制御を実現します。コードはhttps://github.com/little-misfit/GRAG-Image-Editingで公開予定です。
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.