controlnet
ControlNet solves a problem that text alone cannot: precise spatial control. A prompt can ask for 'a person dancing,' but it cannot specify the exact pose, the precise outline, or the depth layout you have in mind. ControlNet (Zhang, Rao, Agrawala, 2023) lets you hand the diffusion model an extra spatial map — an edge drawing, a stick-figure pose skeleton, a depth map, a segmentation mask, a scribble — and the model generates an image that follows that map while still honoring the text prompt. It is what turns text-to-image from a slot machine into a steerable tool.
The clever part is how it adds this control without retraining or damaging the powerful base model. ControlNet makes a trainable copy of the diffusion U-Net's encoder blocks, feeds the spatial condition into that copy, and connects the copy back into the original frozen network through 'zero-convolution' layers — convolutions initialized to all zeros. Because they start at zero, at the beginning of training ControlNet adds exactly nothing, so the base model's behavior is perfectly preserved and training can only gradually, safely learn to inject the new control. The original weights stay frozen throughout, so you keep all the base model's quality and just bolt on a new control channel; you can even stack several ControlNets at once.
This made fine-grained, reproducible control practical on consumer hardware and is now a standard part of professional generative workflows: matching a product's exact silhouette, retargeting a reference pose onto a new character, enforcing architectural perspective, or coloring a line drawing. Each control type is a separately trained ControlNet on paired data (e.g., images paired with their Canny edges or their estimated depth). The main subtleties are choosing the right preprocessor to extract the control map cleanly, and balancing control strength against the prompt — too strong and the output rigidly traces the map, too weak and the control is ignored.
Workflow: take a photo of a friend standing in a pose, run an OpenPose preprocessor to extract a stick-figure skeleton, feed that skeleton to a pose ControlNet with the prompt 'an astronaut on the moon.' The output is an astronaut standing in your friend's exact pose — the skeleton fixes the geometry, the prompt fixes the content, and the frozen base model supplies the photorealism.