erasing  by rohitgandikota

Concept eraser for diffusion models

created 2 years ago
626 stars

Top 53.7% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a method for erasing specific concepts or attributes from pre-trained diffusion models, enabling users to remove unwanted visual elements while preserving the model's overall capabilities. It is targeted at researchers and developers working with generative AI who need to control or refine model outputs.

How It Works

The core approach involves fine-tuning the diffusion model using a short text description of the concept to be erased. The model is trained on conditioned and unconditioned scores from a frozen Stable Diffusion model, guiding the generation process away from the undesired concept. This method leverages the model's internal knowledge to steer its outputs, allowing for precise concept removal.

Quick Start & Requirements

  • Install via git clone https://github.com/rohitgandikota/erasing.git and pip install -r requirements.txt.
  • Requires Python. Specific version not stated.
  • Supports Stable Diffusion v1.4 and SDXL.
  • Demo available at http://127.0.0.1:7860/ (requires cloning demo repository and installing its requirements).
  • Official project website and Arxiv preprint linked in README.

Highlighted Details

  • Supports erasing specific attributes from concepts (e.g., "cowboy hat" from "cowboy").
  • Updated code offers significant speed improvements (5-8x faster) and reduced GPU memory usage compared to the older version.
  • Compatible with the diffusers library, allowing generalization to newer models.
  • Includes scripts for training, evaluation, and image generation.

Maintenance & Community

  • The project is associated with research from ICCV 2023.
  • No specific community channels (Discord/Slack) or roadmap are mentioned in the README.

Licensing & Compatibility

  • The README does not explicitly state a license. The code is publicly available on GitHub.
  • Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

  • The 'esd-u' training method for SDXL is noted as experimental and may produce artifacts.
  • The NSFW task results require a specific NudeNet checkpoint download.
Health Check
Last commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
2
Star History
27 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.