Skip to main content
ControlNet adds spatial conditioning to diffusion models, letting you control outputs with structured inputs like edge maps, depth maps, and pose skeletons. Instead of a text prompt alone, you pair each training image with a conditioning image that encodes the spatial structure you want the model to learn to follow.
Common conditioning image types include:
  • Canny — edge detection (white lines on black background)
  • Depth — depth maps (lighter = closer)
  • Pose — skeletal pose estimation (e.g., OpenPose)
  • Segmentation — semantic segmentation maps
  • Scribble — rough sketch lines
Each conditioning type must be trained separately with its own matched dataset.

Two approaches

Standard ControlNet

Full ControlNet architecture. Higher capacity, larger output file. Uses train_controlnet.py (SD 1.x/2.x) or sdxl_train_control_net.py (SDXL).

ControlNet-LLLite

Lightweight “LoRA Like Lite” implementation. Smaller model, faster training, less VRAM. Currently SDXL only. Uses sdxl_train_control_net_lllite.py.

ControlNet-LLLite

ControlNet-LLLite is a lighter alternative to full ControlNet, inspired by LoRA’s adapter architecture. Each LLLite module consists of:
  1. A conditioning image embedding that maps a conditioning image into latent space.
  2. A small LoRA-like network added to the U-Net’s Linear and Conv layers (currently CrossAttention: attn1 q/k/v, attn2 q).
This design is much smaller than full ControlNet and works well for most conditioning types, though it has limited capacity for complex conditioning signals or non-standard art styles.
ControlNet-LLLite is an experimental implementation and may change significantly in future releases. It currently supports SDXL only.

Preparing the dataset

ControlNet-LLLite uses the DreamBooth-style dataset format. For each training image, you need a matching conditioning image with the same filename (base name without extension).
  • The conditioning image must have the same base filename as the training image.
  • Conditioning images are automatically resized to match the training image.
  • Conditioning images do not need caption files.
  • random_crop is not supported for ControlNet-LLLite datasets.
  • The finetuning-method dataset format (in_json) is not supported; use the DreamBooth directory format.

Generating a synthetic dataset

The easiest way to build a dataset is to:
1

Generate training images

Use your base SDXL model to generate a diverse set of images at 1024×1024. Store them in a directory.
2

Process conditioning images

Apply your conditioning transform (e.g., Canny edge detection) to each generated image. Save results to a separate directory with the same filenames.Example Canny processing script:
3

Create caption files

Create a .txt caption file for each training image. If you generated the images with sdxl_gen_img.py, you can extract captions from the image metadata:

Training configuration

Use a .toml configuration file for your training run:
Key parameters:

Training command

Or pass all arguments directly:

Standard ControlNet (SDXL)

For full ControlNet capacity, use sdxl_train_control_net.py. This produces a larger model with more representational power.

Inference

To generate images using a trained LLLite model, use sdxl_gen_img.py:
The --guide_image_path must already be a processed conditioning image (e.g., a Canny-processed image with white edges on black background). The script does not apply any preprocessing to the guide image.