MagicEraser: Erasing Any Objects via Semantics-Aware Control

Fan Li, Zixiao Zhang, Yi Huang, Jianzhuang Liu, Renjing Pei +2 more
2/14/2026

No official code found. Best implementation: lifan724/magic_eraser (20 stars, last commit 2024-07-14).

Abstract

The traditional image inpainting task aims to restore corrupted regions by referencing surrounding background and foreground. However, the object erasure task, which is in increasing demand, aims to erase objects and generate harmonious background. Previous GAN-based inpainting methods struggle with intricate texture generation. Emerging diffusion model-based algorithms, such as Stable Diffusion Inpainting, exhibit the capability to generate novel content, but they often produce incongruent results at the locations of the erased objects and require high-quality text prompt inputs. To address these challenges, we introduce MagicEraser, a diffusion model-based framework tailored for the object erasure task. It consists of two phases: content initialization and controllable generation. In the latter phase, we develop two plug-and-play modules called prompt tuning and semantics-aware attention refocus. Additionally, we propose a data construction strategy that generates training data specially suitable for this task. MagicEraser achieves fine and effective control of content generation while mitigating undesired artifacts. Experimental results highlight a valuable advancement of our approach in the object erasure task.

View on arXivView PDF

Code Implementations(1)

202PythonJul 10, 20242 years ago

Similar Papers

Cite this paper

@article{li2026magiceraser,
  title  = {MagicEraser: Erasing Any Objects via Semantics-Aware Control},
  author = {Fan Li and Zixiao Zhang and Yi Huang and Jianzhuang Liu and Renjing Pei and Bin Shao and Songcen Xu},
  year   = {2026},
  eprint = {2410.10207},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2410.10207},
  journal = {ECCV 2024 2024}
}

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/2410.10207.svg)](https://codeofpaper.com/paper/2410.10207)

Discussion