Nodes/ComfyUI-tbox/Canny Edge Estimator
ComfyUI Node

Canny Edge Estimator

The classic edge detector, and it needs no model at all

By er1cw00·Created 2 years ago·Updated about a year ago· 26
Canny Edge Estimator
  • image
  • IMAGE
low_threshold100
high_threshold100
resolution512

Canny is the ControlNet preprocessor everyone reaches for first, and for good reason: it's "the classic... produces clean, thin edge maps," best on architecture, mechanical objects, and anything with clear hard contours. It's also the one preprocessor in tbox's ControlNet set that needs zero model weights - it's decades-old classical computer vision, not a neural net, so it's instant and runs fine on CPU.

How it works

Canny edge detection is a deterministic algorithm, not a learned model: it looks at intensity gradients across the image and flags pixels as edges based on two thresholds. Above the high threshold, a pixel is a definite edge. Below the low threshold, it's discarded. In between, it only counts as an edge if it's connected to a definite one - that connecting step (hysteresis) is why you get clean, continuous lines instead of scattered dots. There's no download, no warm-up, nothing to go wrong on first run - this is the one preprocessor in the pack you can just drop in and trust.

Canny has also aged well as a conditioning type: while a lot of the more exotic ControlNet conditions from the SDXL era (segmentation, normal maps, QR/brightness) never got proper post-Flux equivalents, canny is one of the small set every major union ControlNet model still ships - Flux, Qwen-Image, Z-Image all support it. If you're building something that needs to survive a base-model swap later, canny is one of the safer bets.

The inputs and outputs that matter

  • image (required) - your source image.
  • low_threshold and high_threshold (both default 100, range 0–255) - the two knobs that actually matter. Raise both together for a cleaner, sparser edge map that only picks up strong contours; lower both together if you're missing detail you want (fine folds, texture) and are fine with a busier result.
  • resolution (default 512, range 64–16384) - internal processing size before edge detection runs. Bump it up if your source has fine detail the default resolution is smoothing over.

Output: IMAGE - the edge map. Feed it into your ControlNet apply node alongside a canny ControlNet checkpoint (or a union model set to canny mode).

How to install it

Via ComfyUI Manager: search ComfyUI-tbox, install, restart. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ai-shizuka/ComfyUI-tbox

then restart. Nothing extra to fetch for this node specifically - no weights, no special runtime. Worth knowing the pack's README itself is essentially empty (three section headers, no body text), but for Canny that's a non-issue since there's nothing it needed to document.

Common issues & troubleshooting

Edge map is noisy - picking up skin texture, film grain, JPEG artifacts. Raise both thresholds together to keep only stronger contours.

Edge map is missing detail you actually want. Lower both thresholds together; you'll get more lines, including weaker ones.

Edges look broken or patchy on a subject you care about. That's the hysteresis gap between your two thresholds. Narrowing the gap between low_threshold and high_threshold changes how aggressively fragments get connected into continuous lines - worth experimenting with rather than assuming the image itself is the problem.

Right structure, wrong image. Canny is a structure-lock tool, not a content generator - if the edges are correct but the render still isn't what you wanted, that's your prompt or your ControlNet strength downstream, not this node.

Categorytbox/ControlNet Preprocessors

Inputs (4)

NameTypeDefaultDescription
imageIMAGE
low_thresholdoptINT1000–255
high_thresholdoptINT1000–255
resolutionoptINT51264–16384

Outputs (1)

NameTypeDescription
IMAGEIMAGE