Manuscript Offprint

arXiv:2610.18072

LensErase: A Foundation Model for Erase Anything

Yunuo Chen, Xiuyu Wu, Qinhong Yang, Jinjing Zhao, Yanchen Dong, Sirui Zhang, Dong Chen, Fangyun Wei, Lei Shi, Ji Li, Dongdong Chen, Guo Lu, Yan Lu, Baining Guo

Yunuo Chen 1,∗^{1,*}, Xiuyu Wu 2,∗^{2,*}, Qinhong Yang 3^{3}, Jinjing Zhao 4^{4}, Yanchen Dong 5^{5}

Sirui Zhang 3^{3} Dong Chen 6,†^{6,\dagger} Fangyun Wei 6,†^{6,\dagger} Lei Shi 6^{6} Ji Li 6^{6}

Dongdong Chen 6^{6} Guo Lu 1,†^{1,\dagger} Yan Lu 6^{6} Baining Guo 6^{6}

1^{1} Shanghai Jiao Tong University 2^{2} Nankai University 3^{3} USTC

4^{4} University of Sydney 5^{5} Peking University 6^{6} Microsoft

  • Equal contribution. †\dagger Corresponding authors. ‡\ddagger Project lead.

General Object Removal

Figure

Visual Text Removal

Figure

Watermark Removal

Multi-Object Removal

Figure

Associated-Effect Removal

Figure

High-Fidelity Inpainting

Figure

Figure 1 LensErase across diverse removal scenarios. Each pair shows a source image with highlighted removal targets and the corresponding LensErase result. Examples cover general objects, visual text, watermarks, multiple objects, coupled effects, and high-fidelity inpainting.

We introduce LensErase, a general-purpose mask-based Erase Anything foundation model designed to cover a broad spectrum of real-world erase scenarios. LensErase supports diverse objects, visual text, watermarks, associated visual effects, multiple-object removal, and a wide range of object scales, aspect ratios, and image resolutions. First, to enable such broad coverage, we construct LensErase-100M, a large-scale dataset containing 101.07 million paired source-mask-target examples spanning diverse erase scenarios. Second, we pretrain LensErase from the text-to-image model Lens, adapting its strong generative prior to mask-based erasing. To efficiently incorporate the source image and erase mask, we propose Mask-Aware RoPE, a 3D rotary positional encoding that directly injects mask information into the source-image tokens without introducing a separate mask token sequence. Finally, we refine the model through supervised fine-tuning and reinforcement learning with contract-guided, region-aware rewards, and apply TraceFusion at inference to preserve high-fidelity content outside the effective edit region. Across six public benchmarks and the proposed LensErase-Bench, LensErase achieves substantial improvements under both reference-based objective metrics and reference-free VLM evaluation. We hope LensErase can serve as a foundational model for erase-related applications and systems.

Project Page: https://lensfamily.github.io/LensErase/

1 Introduction

Object erasing [1–3] is a fundamental image-editing capability with broad applications in photography, content creation, graphic design, and automated visual-production pipelines. Given an input image and a user-specified region, an ideal erase model should understand what the user intends to remove, eliminate all visual evidence associated with the target, and plausibly reconstruct content that is geometrically, semantically, and visually consistent with the surrounding scene, while preserving the remainder of the image.

However, building a single erase model that works reliably across the diverse requests encountered in real-world applications remains challenging. Handling targets across a wide range of spatial scales, from tiny objects occupying less than 1% of an image to dominant foreground objects covering nearly half of the scene, requires both precise local editing and reconstruction of large missing regions. Erasing diverse target types poses distinct reconstruction challenges: text and logos require removing fine strokes without damaging nearby details, while translucent watermarks require recovering underlying content from blended pixels. Multi-object removal requires clearing every selected instance while maintaining scene consistency across spatially separated edits. Removing associated visual effects, such as reflections and shadows, requires recognizing and removing target-dependent changes that may extend beyond the selection mask [1, 3].

We introduce LensErase, a general-purpose Erase Anything model conditioned only on a source image and an erase mask. To enable broad coverage, we construct LensErase-100M, a large-scale dataset containing 101.07 million paired training examples, each consisting of a source image, an erase mask, and a target image. LensErase-100M is two to three orders of magnitude larger than representative object-removal datasets, which contain approximately 100K–1M training examples [2, 4, 5]. Beyond scale, LensErase-100M is systematically constructed to cover diverse object categories, visual text, watermark types, object scales, image resolutions, and multi-object settings. We use domain-specific construction and validation pipelines to ensure reliable source-target supervision. General Data is constructed by inserting scene-compatible objects into clean real-world images and reversing the pairs, preserving the original images as removal targets. Specialized pipelines use alpha compositing for watermarks, layer rendering for posters, verified teacher edits for visual text, and foreground compositing for large objects.

LensErase builds upon a pretrained text-to-image model, Lens [6], leveraging its strong generative prior to reconstruct realistic and contextually coherent content in erased regions. Since both the condition and output are visual, we initialize both the image branch and condition branch from the pretrained Lens image branch. The condition branch receives the intact source image, allowing the model to identify the target and its associated effects, such as shadows and reflections. Mask-Aware RoPE injects region identity directly into the source-image tokens without introducing a separate mask token sequence. Region-weighted supervision further emphasizes the intended edit during pretraining, producing LensErase-Base. We then refine the model through supervised fine-tuning on curated high-quality, high-resolution data.

While large-scale supervised training equips the model with broad erase capabilities, removal quality can still vary across stochastic samples for the same input. Some outputs achieve complete and clean removal, while others may leave target fragments or residual effects, or alter neighboring content. We therefore further optimize the supervised model with reinforcement learning (RL) using DiffusionNFT [7]. Region-aware rewards encourage complete removal, plausible reconstruction, and preservation of non-target content. At inference, TraceFusion estimates the effective edit region from the selection mask and source–output residuals, and selectively restores the source image outside this region to improve fidelity. Together, RL and TraceFusion yield LensErase, combining reliable removal with high-fidelity preservation.

We also introduce LensErase-Bench, a benchmark of 500 removal cases spanning natural images, posters, watermarks, and visual text. Its reference-free visual evaluation assesses removal correctness, reconstruction quality, content preservation and visual cleanliness, complementing reference-based metrics when multiple plausible reconstructions exist. We evaluate LensErase against 12 existing methods on LensErase-Bench and six public benchmarks. LensErase achieves substantial gains under both reference-based objective metrics and reference-free VLM evaluation, demonstrating strong and consistent performance across diverse erase scenarios. We aim for LensErase to serve as a general-purpose erase model for diverse visual-generation and editing systems.

References (75)