Abstract
Object removal in image editing remains a significant challenge for modern diffusion models, which often tend to reconstruct or replace masked objects rather than eliminate them. This paper introduces EraDiff, a novel framework that re-calibrates the diffusion process for effective erasure. By implementing Chain-Rectifying Optimization (CRO) to simulate object-to-background transitions and Self-Rectifying Attention (SRA) to filter out mask-induced artifacts, EraDiff achieves state-of-the-art performance in producing clean, contextually coherent backgrounds.
Introduction
While Latent Diffusion Models (LDMs) have revolutionized generative art, their application to precise editing tasks like object removal is frequently hampered by the "stubborn object" phenomenon. When a user masks an object for removal, standard models often treat the area as missing data to be filled with contextually plausible—but often unwanted—objects. This occurs because the model's reverse sampling trajectory is inherently biased toward object creation.
Researchers from Alibaba Group propose that this failure stems from a misalignment between the training objective (noise-to-image reconstruction) and the task objective (object-to-background erasure). To bridge this gap, they present EraDiff, which "unleashes the potential erasure power" of diffusion models through pathway calibration.
Methodology
EraDiff introduces two primary technical innovations designed to redirect the model's generative focus.
Chain-Rectifying Optimization (CRO)
Traditional training paradigms optimize for the transition from Gaussian noise to a clean image. EraDiff introduces a new pathway: Object → Background. During training, the system synthesizes dynamic images where target objects gradually fade into the background across diffusion time steps. By minimizing the distance between the predicted latent state and the ground-truth background state at each step, the model learns that the ultimate goal of the denoising process is the total elimination of the object.
Self-Rectifying Attention (SRA)
Even with optimized training, the geometric constraints of a mask can leak information that leads to "ghosting" or artifacts. Standard self-attention allows pixels within the masked region to attend to one another, potentially amplifying errors. EraDiff's SRA mechanism modifies the attention layers to ensure that pixels in the erased area look only at the surrounding background context. This structural constraint prevents the model from latching onto internal artifacts, effectively "blinding" it to the object it is tasked to remove.
Experimental Results
EraDiff was evaluated against leading inpainting models, including SD2-Inpaint, LaMa, and PowerPaint, using the OpenImages V5 dataset.
Quantitative Performance
EraDiff demonstrated superior performance in local quality metrics. It achieved a Local FID of 3.799 and an LPIPS of 0.192, significantly outperforming baseline models in the accuracy of the reconstructed area. While some models achieved comparable global FID scores, EraDiff's strength lies in its ability to eliminate objects without leaving traces.
Qualitative Analysis
Visual evaluations confirm that EraDiff excels in complex scenarios, such as removing pedestrians from crowded streets or deleting specific food items from a plate. Unlike standard models that might replace a removed pizza slice with a blurry texture or another slice, EraDiff successfully reconstructs the underlying plate and table texture.
Conclusion
EraDiff represents a paradigm shift in how we approach object removal in diffusion models. By moving away from simple reconstruction and toward calibrated erasure pathways, the model provides a robust solution to the "stubborn object" problem. This approach not only improves the quality of image editing but also suggests new directions for task-specific calibration in generative AI.
Summary updated