PyraCanny
Fooocus's pyramid Canny for ComfyUI
- image
- IMAGE
PyraCanny is a Canny edge detector with a twist: it runs edge detection across an image pyramid - multiple scales - and merges the results, instead of doing a single pass at one resolution. The payoff is an edge map that catches both the big structural contours and the finer detail lines, and tends to look cleaner and more coherent than a bare Canny on complex images. If you came here from Fooocus, this is the same PyraCanny you knew there; it originated in that project (lllyasviel's beginner-friendly UI) and got ported into this pack so ComfyUI users could use it too.
Why you'd reach for it
Canny is the classic edge preprocessor - great for architecture, mechanical objects, anything with clear hard contours. Plain Canny does one thresholded pass, which means on a busy photo it can either miss faint-but-important edges or drown you in noise, depending on where you set the thresholds. PyraCanny's multi-scale approach smooths that tradeoff: by looking at the image at several sizes it picks up the strong lines and the subtle ones without a single threshold pair having to be perfect for the whole frame. For a lot of real photos, it's a more forgiving Canny. It's real and in active use - it shows up steadily in community workflows, mostly among people who first met it in Fooocus.
The inputs that matter
Same two thresholds as regular Canny, and they work the same way:
low_threshold(default 64) andhigh_threshold(default 128) - the edge sensitivity gates. Pixels with gradients above the high threshold are definitely edges; below the low threshold, definitely not; in between, they count only if connected to a strong edge. Lower both to catch more (busier map, more detail, more noise); raise both to keep only the boldest structural lines. Note these defaults (64/128) are gentler than plain Canny's typical 100/200, which is part of why PyraCanny picks up more of the mid-tones.resolution(default 512) - working size; match it to your render for clean alignment.
The single output is an IMAGE - the edge map, white lines on black. Feed it into a ControlNet Apply node with a Canny ControlNet (control_v11p_sd15_canny, control_canny, or the canny mode of whatever union model your base uses). The node makes the hint image; the ControlNet model is separate.
Installing it
ComfyUI Manager: search ComfyUI's ControlNet Auxiliary Preprocessors, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/Fannovel16/comfyui_controlnet_aux
pip install -r requirements.txt
Restart ComfyUI. PyraCanny is a pure algorithm - no neural weights to download - so it runs instantly with no first-run pause.
Where people get burned
First, thresholds are the whole game with any Canny variant, and defaults won't be right for every image. If your edge map is a solid mess of lines, raise both thresholds; if it's missing the shape you care about, lower them. Preview the map before you commit to a full generation - a bad edge map guarantees a bad result. Second, remember Canny (pyramid or not) captures edges, not depth or pose - it'll happily trace the texture of a brick wall as faithfully as the outline of a building, so it's strongest on subjects where the outline is the structure. Third, don't overthink PyraCanny-vs-Canny: they feed the same ControlNet and for many images the difference is modest. Reach for PyraCanny when a plain Canny map looks too noisy or too sparse and you're tired of chasing thresholds; the multi-scale pass often just handles it.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| low_thresholdopt | INT | 640–255 | — |
| high_thresholdopt | INT | 1280–255 | — |
| resolutionopt | INT | 51264–16384 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |