Attentive Eraser: Unleashing Diffusion Model's Object Removal Potential via Self-Attention Redirection Guidance

Wenhao Sun, Benlei Cui, Xue-Mei Dong, Jingqun Tang
12/17/2024
84 citations
cs.CV
diffusion-flowtransformer-attention

No official code found. Best implementation: Alibaba-YuFeng/AttentiveEraser (221 stars, Jupyter Notebook, Apache-2.0, last commit 2025-05-09).

Abstract

Recently, diffusion models have emerged as promising newcomers in the field of generative models, shining brightly in image generation. However, when employed for object removal tasks, they still encounter issues such as generating random artifacts and the incapacity to repaint foreground object areas with appropriate content after removal.

Show full abstract

To tackle these problems, we propose Attentive Eraser, a tuning-free method to empower pre-trained diffusion models for stable and effective object removal. Firstly, in light of the observation that the self-attention maps influence the structure and shape details of the generated images, we propose Attention Activation and Suppression (ASS), which re-engineers the self-attention mechanism within the pre-trained diffusion models based on the given mask, thereby prioritizing the background over the foreground object during the reverse generation process. Moreover, we introduce Self-Attention Redirection Guidance (SARG), which utilizes the self-attention redirected by ASS to guide the generation process, effectively removing foreground objects within the mask while simultaneously generating content that is both plausible and coherent. Experiments demonstrate the stability and effectiveness of Attentive Eraser in object removal across a variety of pre-trained diffusion models, outperforming even training-based methods. Furthermore, Attentive Eraser can be implemented in various diffusion model architectures and checkpoints, enabling excellent scalability. Code is available at https://github.com/Anonym0u3/AttentiveEraser.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Official implementation of the paper "Attentive Eraser: Unleashing Diffusion Model’s Object Removal Potential via Self-Attention Redirection Guidance" (AAAI 2025 Oral)

22110Jupyter Notebook, PythonApr 21, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{sun2024attentive,
  title  = {Attentive Eraser: Unleashing Diffusion Model's Object Removal Potential via Self-Attention Redirection Guidance},
  author = {Wenhao Sun and Benlei Cui and Xue-Mei Dong and Jingqun Tang},
  year   = {2024},
  eprint = {2412.12974},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.12974v8}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2412.12974.svg)](https://codeofpaper.com/paper/2412.12974)

Discussion