基于组相对注意力的图像编辑
Group Relative Attention Guidance for Image Editing
AI总结:
GRAG通过组相对注意力机制实现对图像编辑强度的连续精细控制,无需额外调整。
摘要:
近年来,基于扩散-变换器模型的图像编辑技术已迅速发展。然而,现有编辑方法往往缺乏对编辑程度的有效控制,限制了其实现更定制化结果的能力。为了解决这一限制,我们研究了DiT模型中的MM-Attention机制,并发现查询和键标记共享一个仅与层数相关的偏差向量。我们将这个偏差解释为模型固有的编辑行为,而每个标记与相应偏差之间的差异编码了内容特定的编辑信号。基于这一见解,我们提出了组相对注意力引导(GRAG),一种简单而有效的方法,通过重新加权不同标记的差异值来调节模型对输入图像相对于编辑指令的关注程度,使能够连续且精细地控制编辑强度而无需任何调整。在现有图像编辑框架上进行的广泛实验表明,GRAG可以以最少的四行代码集成,一致地提升编辑质量。此外,与常用的分类器自由引导相比,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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。