ControlNet Preprocess Canny
The edge-map factory for cloud ControlNet
- image
- image
ControlNet is how you tell a diffusion model where things go, not just what to draw, and Canny edge maps are its oldest, most reliable language: hard, thin lines that say "the structure of the image goes here." This node (Runware_controlnet_preprocess_canny) extracts exactly that from an IMAGE - one input, one output, and the thresholds you'd expect from the classic preprocessor.
It's part of the Runware pack's builder pipeline, so it's usually not a standalone step. The typical graph is: load a reference image → this node produces the edge map → feed it into the pack's ControlNet builder → wire that into a model node's controlNet socket (like RunwareArch_sdxl). That's the whole ControlNet recipe, and this node is the first ingredient. If you've used ComfyUI's built-in Canny preprocessor locally, this is the same operation, just running on Runware's side so it plugs into their cloud models.
How it works
The node sends a controlNetPreprocess request (runware:controlnet-preprocess@canny AIR) with your image base64-encoded, and the edge map comes back as an IMAGE. Canny detection works by finding sharp intensity gradients and keeping only the ones that connect into contours - two thresholds decide how much survives:
settings.highThresholdCanny- default 200. Edges with gradient strength above this are kept unconditionally. Raise it for fewer, cleaner lines; lower it to catch faint structure.settings.lowThresholdCanny- default 100. Gradient strength below this is discarded; anything between the two thresholds is kept only if it connects to a strong edge.
The classic beginner move is cranking both up because the map looks noisy - but a too-thin edge map gives the downstream model almost nothing to anchor on, which shows up as weak structure adherence. The defaults are well-chosen; nudge, don't panic.
The inputs that matter
image(required) - the referenceIMAGE.settings.highThresholdCanny/settings.lowThresholdCanny- the two thresholds above. These are the only parameters that matter.ttl/outputFormat- the standard plumbing; irrelevant for the tensor output you'll actually wire onward.
The output is a single image - the edge map. Don't expect a pretty picture; it's a gray line drawing, and that's correct.
Installing it
Install the pack. ComfyUI Manager → search Runware → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt
Key from runware.ai/api-keys → ComfyUI Settings → Runware API key (or RUNWARE_API_KEY).
Where people get burned
- The edge map alone does nothing. This is a preprocessing node - it must feed a ControlNet builder, which feeds a model. Wiring it to a preview and wondering why nothing changed is the classic miss.
- Canny isn't for every subject. It's best for architecture, mechanical objects, and scenes with clear contours. For organic subjects (people, animals), the pack's other preprocessors - depth, softedge, openpose - are usually a better fit. The controlnet KB calls this out explicitly.
- Threshold extremes both bite. Too low = noise that confuses the model; too high = no structure to follow. Stay near the 100/200 defaults and tune in small moves.
- Cost and latency. Each preprocess is a metered cloud call; it's cheap but it's a round-trip. Local ComfyUI has this preprocessor built in for free - this node exists to serve the cloud model path.
Runware_controlnet_preprocess_canny is a small, correct tool: feed it a reference, get an edge map, feed that into ControlNet, get structure. Learn the two thresholds and it'll never surprise you.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| settings.highThresholdCannyopt | INT | 2001–255 | High threshold for Canny edge detection. |
| settings.lowThresholdCannyopt | INT | 1000–255 | Low threshold for Canny edge detection. |
| ttlopt | BOOLEAN | false | Enable to set ttl. Off uses the model's default. |
| ttl_valueopt | INT | 60 | Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`. |
| outputFormatopt | COMBO | JPG | File format for the generated image. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |