BrushNet

A text-guided image inpainting model that runs locally with Stable Diffusion or SDXL and supports object-shaped and irregular masks.

Screenshot of BrushNet website

BrushNet fills selected areas of an image using a text prompt while retaining the surrounding content. It's for developers and researchers who want local image editing with pretrained diffusion models.

  • Masked editing Supply an image, a mask and a prompt to generate content in the selected region, with support for editing inside or outside a mask.
  • Base model compatibility Checkpoints support Stable Diffusion 1.5 and Stable Diffusion XL, and compatible community models include DreamShaper, epiCRealism, MeinaMix and Realistic Vision.
  • Mask and guidance control Separate checkpoints target object-shaped segmentation masks and general irregular masks, while adjustable control strength changes how closely generation follows the input image.
  • Custom training and evaluation Train on your own datasets or use BrushData for segmentation-based training and BrushBench for evaluation with human-annotated masks and captions.

The Python and PyTorch implementation includes local inference and a Gradio demo. The base model influences the visual style of an edit, with examples covering photographs, anime, pencil drawings and watercolor.

The pretrained model targets general scenes. Specialized applications such as product displays and virtual try-on may need training on your own data.

The published BrushNet models support SD 1.5 and SDXL inpainting workflows. The BrushNet license uses Apache 2.0 with exceptions for third-party components. The underlying Stable Diffusion model retains its own weight license; BrushNet’s code license does not replace it.

Similar to BrushNet