AttentionDrag: Exploiting Latent Correlation Knowledge in Pre-trained Diffusion Models for Image Editing

Biao Yang, Muqi Huang, Yuhui Zhang, Yun Xiong, Kun Zhou, Xi Chen, Shiyang Zhou, Huishuai Bao, Chuan Li, Feng Shi, Hualei Liu

TL;DR

AttentionDrag is a training-free, one-step point-based image editing framework that leverages the latent feature correlations already embedded within pre-trained diffusion models. By utilizing self-attention maps from the DDIM inversion process, it automatically generates masks, shifts latent elements semantically, and interpolates blank regions—achieving high-quality, context-aware edits in a fraction of the time required by iterative optimization methods.

What Problem Does This Paper Address?

Point-based image editing—where a user "drags" a handle point to a target location to alter an image—offers precise spatial control. However, existing approaches suffer from a clear trade-off between speed and semantic consistency.

Traditional methods (like DragDiffusion) rely on multi-step iterative optimization. They track points and optimize latent representations over multiple steps, which is computationally expensive, slow, and prone to introducing instability or breaking global semantic consistency. On the other hand, recent one-step geometric methods (like FastDrag) are fast but require manual user masks and often ignore the intrinsic semantic relationships within the image, leading to unnatural distortions.

AttentionDrag addresses this gap by eliminating both the slow iterative loops and the need for manual masking, utilizing the pre-trained model's internal "knowledge" to keep edits semantically coherent.

Methods

Instead of treating the diffusion model as a black box that needs external optimization, AttentionDrag exploits the self-attention mechanism inside the U-Net module during Denoising Diffusion Implicit Models (DDIM) inversion.

The framework operates in three distinct, one-step phases:

  1. Automatic Mask Generation: The system extracts and aggregates self-attention maps across multiple timesteps during DDIM inversion. By applying a threshold ($\tau$) to the attention scores relative to the user's handle point, it automatically isolates the editable object or region without requiring manual user input.
  2. Semantic-based Element Movement: Rather than applying a uniform geometric warp, the displacement of each latent coordinate is scaled proportionally to its semantic relevance (attention score) to the handle point. This ensures that related parts of an object move naturally together while background elements remain unaffected.
  3. Semantic-based Interpolation: Moving latent elements inevitably leaves behind "blank" regions. AttentionDrag fills these gaps by using the self-attention scores to seamlessly blend and transfer relevant semantic information from the surrounding context, preserving visual coherence.
Figure 2: The pipeline of our framework, which mainly consists of Automatic Mask Generation, Semantic-based Element Movement and Semantic-based Interpolation.

Datasets

The authors evaluated their method using the DragBench dataset, a standard benchmark consisting of 211 distinct image categories and 349 handle-target point pairs designed to test the precision and quality of drag-based image manipulation.

Key Insights and Ideas

  • The U-Net Already Knows: Pre-trained diffusion models inherently understand the structural and semantic relationships of an image through their self-attention layers. AttentionDrag shows that we can repurpose these attention maps directly to guide spatial manipulation, bypassing the need for fine-tuning or LoRA training.
  • Proportional Latent Shifting: By tying latent pixel displacement directly to attention weights, the model avoids the rigid distortions typical of purely geometric one-step methods. For example, dragging a dog's ear naturally deforms the surrounding head and fur because they share high attention correlations.
  • Versatility Beyond Dragging: Because the framework relies fundamentally on attention-guided feature filling, it can function as a plug-and-play tool for other low-level vision tasks, such as mask-based image inpainting, without any architectural modifications.
Qualitative results demonstrating AttentionDrag's performance on single-point image editing compared to other state-of-the-art methods.

Key Results

AttentionDrag was compared against several state-of-the-art multi-step and one-step editing methods using Mean Distance (MD) for drag precision and 1-LPIPS for image fidelity:

  • Speed: AttentionDrag achieves an editing time of 5.50 seconds per point with 0 preparation time. This matches the speed of the fastest one-step geometric methods (FastDrag at 5.66s) and drastically outperforms iterative methods like DragDiffusion (21.54s editing + 1 min LoRA preparation).
  • Accuracy & Fidelity: On DragBench, AttentionDrag achieved a Mean Distance of 29.66 and a 1-LPIPS score of 0.87. This significantly outperforms the leading one-step baseline, FastDrag (MD: 32.23, 1-LPIPS: 0.86), demonstrating a superior balance between spatial accuracy and image quality.
  • Inpainting: When tested purely on mask-based inpainting tasks, the attention-guided interpolation successfully filled missing regions with contextually appropriate textures.

Limitations and Future Work

While AttentionDrag delivers impressive efficiency gains, the authors note a few areas for future exploration:

  • Dataset Complexity: The current implementation needs further validation on more complex, cluttered, and highly diverse datasets to test the boundaries of the automatic masking feature.
  • Real-Time Interactive Scaling: Future work will focus on optimizing the pipeline further to support fully real-time, interactive, user-guided applications.

Summary updated

BibTeX
@inproceedings{yang2025attentiondrag,
  author = {Biao Yang and Muqi Huang and Yuhui Zhang and Yun Xiong and Kun Zhou and Xi Chen and Shiyang Zhou and Huishuai Bao and Chuan Li and Feng Shi and Hualei Liu},
  title = {{AttentionDrag: Exploiting Latent Correlation Knowledge in Pre-trained Diffusion Models for Image Editing}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/244},
}
Figure