ComfyUI Node

modaux: canny

Canny without a model download

By madtunebk·Created 2 years ago·Updated 2 years ago· 17
modaux: canny
  • image
  • IMAGE
detect_resolution512
image_resolution512
low_threshold100
high_threshold200

Of all the ControlNet preprocessors, canny is the one that never goes away, and this node is the version with zero baggage: no weights to download, no VRAM to spend, just OpenCV doing its classic edge detection. modaux: canny from the ControlNet Auxiliar pack runs cv2.Canny on your image and hands you a clean white-on-black edge map. That's the entire mechanism, and it's the reason canny is still the preprocessor people use when they want structure without any style bias baked in.

Reach for it when your subject is defined by hard edges: architecture, machinery, product renders, anything with clear contours and flat surfaces. The edge map says "here's where the lines are" and the ControlNet does its best to honor them while the prompt fills in material, color, and lighting. It's also the condition with the most forgiving ControlNet support anywhere - canny is in every union checkpoint for every modern base (SDXL's xinsir, the Flux and Z-Image unions), so a map from this node wires into almost anything.

The inputs that matter

The usual three, plus the two that make canny, canny:

  • image - the reference.
  • detect_resolution (default 512) - resolution the edge detection runs at.
  • image_resolution (default 512) - the size the map is returned at, to match your generation.
  • low_threshold (default 100) - the hysteresis low threshold. Pixels with gradient strength above this start an edge.
  • high_threshold (default 200) - the high threshold. Edges above this are definitely kept, edges between the two are kept only if connected to a strong edge.

That last pair is where 90% of canny troubleshooting lives. Too many stray lines and noise? Raise both thresholds. Barely any edges coming through? Lower the high one. Keep low below high - if you invert them, the behavior gets mushy. If the source image is noisy, denoise or downscale it before it hits the node; garbage in, edge-noise out.

The output IMAGE feeds a ControlNet Apply node with a canny ControlNet (on SD 1.5, control_v11p_sd15_canny; on the unions, canny mode).

Install

Boring and small, which is the appeal:

cd ComfyUI/custom_nodes
git clone https://github.com/madtunebk/ComfyUI-ControlnetAux.git
cd ComfyUI-ControlnetAux
pip install -r requirements.txt

Or just search "ControlNet Auxiliar" in ComfyUI Manager. Restart, and the node is ready instantly - unlike the depth and pose siblings in this pack, there's no first-run weight download to wait through, because CannyDetector loads no model at all.

The honest take

Canny has rivals now - HED and its variants give soft, more forgiving edges, and lineart gives a stylized outline - but none of them beat canny on price. It's deterministic, free, and instant, and for anything with a hard-edged subject it's still the right first choice. Where people get burned is assuming the default thresholds work for every image. They're a starting point tuned for average photos, not a universal answer; the two threshold sliders exist for a reason and you will touch them.

One more thing worth knowing: this whole pack is a "work in progress" (v0.3 beta), so treat it as a convenient wrapper rather than a mission-critical dependency. For a more maintained and much bigger preprocessor collection, the ecosystem's mainstream auxiliary pack covers the same ground and more - but if you just need a canny map with no fuss, this node delivers it in one click.

CategoryControlNet Auxiliar

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
detect_resolutionINT512256–1024
image_resolutionINT512256–1024
low_thresholdoptINT1001–200
high_thresholdoptINT2001–200

Outputs (1)

NameTypeDescription
IMAGEIMAGE