BrushNet  by TencentARC

Image inpainting model using decomposed dual-branch diffusion

Created 1 year ago
1,658 stars

Top 25.5% on SourcePulse

GitHubView on GitHub
Project Summary

BrushNet is a plug-and-play diffusion model for image inpainting, designed to integrate seamlessly with existing pre-trained diffusion models like Stable Diffusion v1.5 and SDXL. It addresses the challenge of image inpainting by decomposing the learning process, allowing it to be applied to various inpainting scenarios with improved fidelity and control. The target audience includes researchers and developers working on image generation and editing tasks.

How It Works

BrushNet employs a dual-branch diffusion architecture that separates masked image features from noisy latent representations. This decomposition reduces the model's learning burden and enhances its ability to handle image inpainting tasks. By leveraging dense, per-pixel control throughout the pre-trained diffusion model, BrushNet achieves greater suitability for precise image manipulation.

Quick Start & Requirements

  • Install: Clone the repository and install dependencies using pip install -e . and pip install -r examples/brushnet/requirements.txt.
  • Prerequisites: PyTorch 1.12.1, Python 3.9. CUDA is implicitly required for GPU acceleration.
  • Data: Download BrushData, BrushBench, and EditBench datasets. Checkpoints for SD v1.5 and SDXL are available.
  • Demo: A Gradio demo is available via python examples/brushnet/app_brushnet.py.
  • Docs: Project page, ArXiv paper, and video are linked in the README.

Highlighted Details

  • Plug-and-play integration with Stable Diffusion v1.5 and SDXL.
  • Supports both segmentation mask-guided and random mask inpainting.
  • Achieved top prize in the CVPR2024 GenAI Media Generation Challenge.
  • Offers training and evaluation scripts for custom datasets and benchmarks.

Maintenance & Community

The project is from TencentARC, with contributions from researchers at The Chinese University of Hong Kong. Updates include the release of BrushEdit and stronger BrushNetX models. Community interaction points are not explicitly listed, but the project is associated with ECCV 2024.

Licensing & Compatibility

The repository is released under an unspecified license. The data download agreement includes terms and conditions. Compatibility for commercial use or closed-source linking is not detailed.

Limitations & Caveats

The provided SDXL checkpoint is an early version trained with a small batch size and may not perform optimally. Users are advised to train on custom data for specific industrial applications. The evaluation script requires disabling an NSFW detector for accurate results, and image generation may vary across different hardware setups.

Health Check
Last Commit

9 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
9 stars in the last 30 days

Explore Similar Projects

Starred by Robin Rombach Robin Rombach(Cofounder of Black Forest Labs), Patrick von Platen Patrick von Platen(Author of Hugging Face Diffusers; Research Engineer at Mistral), and
2 more.

Kandinsky-2 by ai-forever

0.0%
3k
Multilingual text-to-image latent diffusion model
Created 2 years ago
Updated 1 year ago
Starred by Robin Huang Robin Huang(Cofounder of Comfy Org), Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), and
17 more.

stablediffusion by Stability-AI

0.1%
42k
Latent diffusion model for high-resolution image synthesis
Created 2 years ago
Updated 2 months ago
Feedback? Help us improve.