arXiv:2512.08477cs.CVcs.AI2025-12

无需反演也能精准拖拽编辑,保留纹理和语义一致性。

ContextDrag: Precise Drag-Based Image Editing via Context-Preserving Token Injection and Position-Aligned Attention

  • 用空间对齐的特征注入实现无反演的精确拖拽控制。
  • 在两个基准上达到最优编辑精度与视觉质量。
  • 适合需要高保真图像编辑的研究者与设计师。

拖拽式图像编辑通过点操作实现直观的视觉修改。现有方法主要依赖扩散反演或像素空间变形加修补,但反演会引入近似误差导致纹理失真,而刚性像素操作会丢失语义上下文并产生不自然形变。为此,我们提出ContextDrag,据知是首个将拖拽操作引入上下文感知图像编辑范式的框架。借助编辑模型(如FLUX-Kontext)的上下文能力,ContextDrag可在无需反演或微调的情况下实现精准拖拽。首先提出上下文保持的特征注入(CTI),通过直接从用户指定控制点估计的潜在空间对应关系,将VAE编码的参考特征注入注意力层中的空间对齐目标位置。由于操作的是干净编码特征而非噪声反演输出,CTI有效保留了丰富纹理细节并实现精确控制。其次提出位置对齐注意力(PAA),消除参考特征空间偏移带来的干扰:重新编码偏移参考标记的位置嵌入以匹配目标位置,并掩码源与目标区域重叠部分,防止冲突特征破坏视觉一致性。在DragBench-SR与DragBench-DR上的实验表明,ContextDrag在编辑准确率与整体质量上均达当前最优,全面消融实验验证了各组件有效性。代码将公开。

原文摘要 · Abstract (English)

Drag-based image editing enables intuitive visual manipulation through point-based drag operations. Existing methods mainly rely on diffusion inversion or pixel-space warping with inpainting. However, inversion inherently introduces approximation errors that degrade texture fidelity, whereas rigid pixel-space operations discard semantic context and produce unnatural deformations. To address these issues, we introduce ContextDrag, to our knowledge the first framework that brings drag-based manipulation into the in-context image editing paradigm. By leveraging the in-context capabilities of editing models (e.g., FLUX-Kontext), ContextDrag enables precise drag editing without inversion or fine-tuning. Specifically, we first propose Context-preserving Token Injection (CTI), which injects VAE-encoded reference features into attention layers at spatially aligned target positions, guided by latent-space correspondences estimated directly from user-specified control points. By operating on clean, directly encoded features rather than noisy inversion outputs, CTI preserves rich texture details and enables precise drag control. Second, we propose Position-Aligned Attention (PAA) to eliminate interference caused by spatial displacement of reference features. PAA re-encodes positional embeddings of displaced reference tokens to match their target locations, and masks overlapping regions between source and destination to prevent conflicting features from degrading visual consistency. Experiments on DragBench-SR and DragBench-DR demonstrate that ContextDrag achieves SOTA editing accuracy and overall quality, and comprehensive ablations validate the effectiveness of each proposed component. Code will be publicly available.

图像编辑拖拽操作上下文感知扩散模型

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