ControlNet  by lllyasviel

Neural network structure for adding conditional control to diffusion models

created 2 years ago
32,820 stars

Top 1.1% on sourcepulse

GitHubView on GitHub
Project Summary

ControlNet provides a method to add conditional control to diffusion models, enabling fine-grained manipulation of image generation based on various inputs like edge maps, depth maps, or human poses. It's designed for researchers and artists looking to precisely guide text-to-image synthesis without compromising pre-trained diffusion models.

How It Works

ControlNet achieves control by duplicating diffusion model weights into a "locked" (original) and a "trainable" copy. The trainable copy learns the conditioning input via a "zero convolution" layer, which initially outputs zeros, preventing distortion. This architecture allows training on small datasets while preserving the integrity of the original, powerful diffusion model backbone.

Quick Start & Requirements

  • Install via conda env create -f environment.yaml and conda activate control.
  • Requires downloading pretrained models and detectors from Hugging Face.
  • Official implementation supports Stable Diffusion 1.5.
  • Demos available via python gradio_*.py scripts (e.g., gradio_canny2image.py).
  • See Hugging Face page for models and detectors.

Highlighted Details

  • ControlNet 1.1 released with new models.
  • Supports various conditioning inputs: Canny edges, M-LSD lines, HED boundaries, scribbles, human pose, semantic segmentation, depth maps, and normal maps.
  • "Guess Mode" allows generation without text prompts by inferring content from control maps.
  • ControlNets are composable for multi-condition control.
  • Feature for transferring ControlNet to any community SD1.X model.

Maintenance & Community

  • Active development with recent releases (ControlNet 1.1).
  • Mentions community contributions and related projects like Mikubill's A1111 Webui Plugin and ControlNet-for-Diffusers.
  • ArXiv link provided for the paper.

Licensing & Compatibility

  • License not explicitly stated in the README.
  • Compatible with Stable Diffusion 1.X models.

Limitations & Caveats

  • Some Gradio interfaces are noted as difficult to customize or buggy.
  • Anime Line Drawing model is not yet released due to risk evaluation.
  • Transferring ControlNet to community models is experimental.
Health Check
Last commit

1 year ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.