Use ControlNet to guide a Stable Diffusion image

Choose a compatible control map and model, then follow the official ComfyUI scribble workflow or use your existing A1111 setup.

A porcelain chair outlined in cobalt with a translucent blue depth plane behind it

Choose the part of a reference image you want Stable Diffusion to follow, then feed that information to a compatible ControlNet alongside your prompt. Use Canny for outlines, pose control for body position, depth for spatial layout, or scribble for a rough drawing. I'd start with one control and inspect its input map before increasing its strength. The ControlNet weights must match your base-model family and the kind of map you're supplying.

Choose the information to preserve

ControlNet adds spatial guidance to image generation. A preprocessor extracts information from a reference, such as edges or a pose skeleton. The ControlNet model uses the resulting control image to influence the diffusion model. These are separate components: selecting a detector doesn't supply the matching ControlNet weights.

The original ControlNet model cards show the expected input representations. Choose the representation that retains the information your next image needs.

  • Canny: preserve visible outlines and composition. Edges can include background clutter, so check that the map doesn't lock in details you want to change.
  • Pose: preserve detected body keypoints. A skeleton leaves clothing and appearance open to generation; it doesn't establish a person's identity or guarantee correct anatomy.
  • Depth: preserve the arrangement of nearer and farther surfaces. An estimated depth map can be useful for a room or scene, but it isn't a measured 3D reconstruction.
  • Scribble: guide the composition with a rough drawing. This is my starting choice when I want to place shapes without extracting every edge from a photograph.

For example, an outline map of a chair may retain its decorative frame. A rough sketch can leave those decorations unspecified. Pick the amount of structure you want to keep before asking the prompt to change the material or style.

Sketch guidance has a published experimental basis. In the original ControlNet paper's user study, 12 participants ranked results for 20 unseen hand-drawn sketches across five methods. Table 1 reports average rankings of 4.22 for image quality and 4.28 for sketch fidelity for ControlNet, on a scale where 1 is worst and 5 is best. These are the paper authors' preference rankings for that experiment, rather than percentages or a prediction for your checkpoint. They support judging visual quality and adherence separately: a pleasing image can still miss the structure you asked to preserve.

Match the model and control image

Check the base checkpoint's family before downloading a ControlNet. The original Canny checkpoint recommends Stable Diffusion 1.5. The separate SDXL Canny weights were trained on SDXL base 1.0. Sharing the word “Canny” doesn't make these weights interchangeable. Your interface must also support the particular ControlNet format and model.

If you're still choosing the base file, check the Stable Diffusion checkpoint and its license first. Then read the ControlNet model card for the required family and input representation. Keep track of the actual filenames; the extension's version and the base-model version describe different things.

Match the map type as carefully as the model family. The ControlNet 1.1 specifications list acceptable preprocessors for each model. For example, its Canny model accepts Canny maps, while its depth model lists MiDaS, LeReS, and Zoe depth. A photo sent directly to an edge-conditioned model isn't the same input as an extracted edge map.

A prepared map can go directly to the appropriate model. You don't need to run a detector over an already prepared skeleton or scribble. Follow the model's required polarity and colors: the original Canny and scribble cards show white lines on black. Don't assume that inverting a map or substituting another detector preserves its meaning.

Set the intended output shape before evaluating the map. If you need a full standing pose, keep the feet inside the control canvas and use a compatible aspect ratio. Stretching a portrait map into a wide canvas changes its geometry; cropping can remove the very joints you're trying to preserve.

Run the ComfyUI scribble example

For an existing working ComfyUI installation, I'd begin with the official SD 1.5 scribble workflow. It supplies a workflow PNG and a prepared input drawing, so the first run doesn't depend on installing a preprocessor pack. ComfyUI has native ControlNet application nodes; its core nodes don't include every kind of image preprocessor.

  1. Open the documented workflow. Download the workflow image from the official tutorial and drag it into ComfyUI, or use Workflows → Open. Use the original downloadable PNG so its embedded workflow is retained. Read the model requirements before accepting any download.
  2. Check the required files. This example uses dreamCreationVirtual3DECommerce_v10.safetensors in ComfyUI/models/checkpoints/, control_v11p_sd15_scribble_fp16.safetensors in ComfyUI/models/controlnet/, and vae-ft-mse-840000-ema-pruned.safetensors in ComfyUI/models/vae/. These filenames belong to this example, not every ControlNet workflow.
  3. Select the loaded components. Confirm the checkpoint in Load Checkpoint and the scribble weights in Load ControlNet. The example's separate Load VAE supplies the decoder in VAE Decode; the tutorial also permits the checkpoint's embedded VAE. Preserve the example's wiring while establishing the baseline.
  4. Load the prepared drawing. Download the tutorial's input image and use Upload in Load Image. Its image output feeds Apply ControlNet. Review the supplied positive and negative text in the two CLIP Text Encode nodes. Their conditioning passes through Apply ControlNet before reaching the corresponding KSampler inputs. Check the output width and height in Empty Latent Image, keeping the square shape for this square drawing.
  5. Generate and inspect. Keep the example's initial settings, then click Queue or use Ctrl/Cmd + Enter. The sampler output goes through VAE Decode to Save Image. Check the main shapes against the drawing before changing the prompt or adding a second control.

The VAE input visible on Apply ControlNet isn't a demand to attach a new VAE to every workflow. It is optional in the core node definition, and the official scribble graph leaves that particular input unconnected. Other model workflows can need it; follow their documented connections.

ComfyUI Apply ControlNet node with positive and negative conditioning, model and image inputs, and strength, start_percent, and end_percent controls
Apply ControlNet passes the guided positive and negative conditioning onward. Strength changes the amount of influence; start_percent and end_percent set its interval. Scroll sideways on a narrow screen to read the controls. View larger

Once the supplied drawing works, try a different scribble with the same setup. For a photograph, choose a suitable preprocessor or prepare the required map first. Installing a custom node pack is a separate setup decision; the official tutorial links supported options when the needed detector isn't available.

Use an existing A1111 setup

If you already work in AUTOMATIC1111, keep that interface. Its ControlNet extension has its own installation and model instructions. The original ControlNet research repository is a different project; don't paste its URL into A1111's extension installer.

In the extension's ControlNet panel, upload the reference and turn on Enable. Select a preprocessor and a compatible ControlNet model, then use Allow Preview and the preprocessor preview button to inspect the control map. If you supply a prepared map, choose None for preprocessing. Verify the model selection instead of relying only on the Control Type filter.

Pixel Perfect calculates the annotator resolution from the generation settings. It doesn't repair a missed pose or supply a missing model. When the reference and output shapes differ, inspect the resize choice: Just Resize stretches to fit, Crop and Resize can cut off edges, and Resize and Fill preserves the fitted map with extra space. Start with one enabled unit and use the txt2img generation button after checking its map. The extension calls the influence control Control Weight and the interval controls Starting Control Step and Ending Control Step. If newly added weights are missing from the model list, use the refresh button beside Model after checking their folder.

Adjust guidance and check the result

First separate three controls that can all make an image look more or less like a reference.

  • ControlNet strength or weight changes the influence of the control signal. In ComfyUI, strength = 1 is the core node's default, and 0 bypasses its effect. One isn't its maximum or a promise of exact copying.
  • The control interval determines when that guidance applies during sampling. ComfyUI's start_percent = 0 and end_percent = 1 cover the full interval. For example, end_percent = 0.8 stops guidance at 80% of the diffusion process; it doesn't mean 80% similarity.
  • Img2img denoising strength changes the noise added to a starting image. This is separate from ControlNet's conditioning scale. A txt2img workflow can use a control image without using that image as its img2img starting canvas.

The core Apply ControlNet definition confirms the strength and interval controls. The distinction between a starting image and a control image is explicit in Diffusers' img2img ControlNet parameters. Values from one workflow shouldn't be copied into a different control merely because both are called strength.

I'd keep the seed and other generation settings fixed while adjusting one control. That makes the change easier to assess within the same setup. Compare the map with the output: check a pose's joint positions, a chair's silhouette, or the foreground/background arrangement, depending on the condition you chose.

When the map is correct but the result follows it too weakly, check that Apply ControlNet's outputs feed the sampler and that the control interval is active. In A1111, check the unit's Enable setting and selected model instead. Then increase influence cautiously. If the result is overly constrained or develops artifacts, reduce the weight or end the guidance earlier and compare again. The right amount depends on the particular weights and task.

Fix a defective map before increasing strength. A missing hand in a pose map needs a better detection or a corrected map. Unwanted background edges need a cleaner input or a different control type. A dimension error after changing checkpoints calls for a family and component check; a file missing from the loader calls for a folder and model-list check. These failures need different repairs.

After the structure works, change the prompt to describe the subject and appearance you want. If unwanted details remain, adjust the negative prompt for that narrower problem. Save the useful workflow and its model identities before trying another control; the AI image workflows hub gives you a route to the next image task.