EraseAnything: Enabling Concept Erasure in Rectified Flow Transformers

Daiheng Gao, Shilin Lu, Shaw Walters, Wenbo Zhou, Jiaming Chu +6 more
12/29/2024
cs.CV

No official code found. Best implementation: tomguluson92/EraseAnything (45 stars, BSD-3-Clause, last commit 2025-09-28).

Abstract

Removing unwanted concepts from large-scale text-to-image (T2I) diffusion models while maintaining their overall generative quality remains an open challenge. This difficulty is especially pronounced in emerging paradigms, such as Stable Diffusion (SD) v3 and Flux, which incorporate flow matching and transformer-based architectures. These advancements limit the transferability of existing concept-erasure techniques that were originally designed for the previous T2I paradigm (e.g., SD v1.4). In this work, we introduce EraseAnything, the first method specifically developed to address concept erasure within the latest flow-based T2I framework. We formulate concept erasure as a bi-level optimization problem, employing LoRA-based parameter tuning and an attention map regularizer to selectively suppress undesirable activations. Furthermore, we propose a self-contrastive learning strategy to ensure that removing unwanted concepts does not inadvertently harm performance on unrelated ones. Experimental results demonstrate that EraseAnything successfully fills the research gap left by earlier methods in this new T2I paradigm, achieving state-of-the-art performance across a wide range of concept erasure tasks.

View on arXivView PDF

Code Implementations(1)

BSD-3-Clause

EraseAnything, ICML 2025

453C++, CudaMay 3, 20251 years agoBSD-3-Clause

Similar Papers

Cite this paper

@article{gao2024eraseanything,
  title  = {EraseAnything: Enabling Concept Erasure in Rectified Flow Transformers},
  author = {Daiheng Gao and Shilin Lu and Shaw Walters and Wenbo Zhou and Jiaming Chu and Jie Zhang and Bang Zhang and Mengxi Jia and Jian Zhao and Zhaoxin Fan and Weiming Zhang},
  year   = {2024},
  eprint = {2412.20413},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.20413v2}
}

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

Discussion