Edge Preprocessor (nikosis)
Five edge detectors in one node, and the default is the one you didn't know you wanted
- image
- IMAGE
Canny edge maps are the oldest trick in the ControlNet book - thin, clean outlines that tell the model where your architecture, machinery, or composition boundaries are. This node packs five different edge detectors into one box: canny, laplacian, prewitt, sobel, and pyracanny, which happens to be the default. And here's the nice part: it's all OpenCV. No weights, no model downloads, no first-run fetch. Install the pack once and it just works, even offline.
What each "model" actually is
The model input is an algorithm selector, not a neural net - don't expect a download. Your choices:
- pyracanny (default) - pyramid Canny. It runs the Canny detector at nine scales from 0.2x to 1.0x and accumulates the results. That's a lot of compute, but the point is real: this is the preprocessor SAI trained Control-Lora Canny on, and it's far more forgiving about weird input resolutions than plain Canny. If you use the Control-Lora Canny model, this is the map it expects.
- canny - the classic
cv2.Canny, thin hard edges. The safe, standard choice for regular Canny ControlNets. - sobel / prewitt - gradient-magnitude detectors; sobel uses the standard 3x3 kernel, prewitt a slightly softer one. Both get thresholded the same way. Fine when you want stronger, chunkier edges than Canny gives.
- laplacian - second-derivative edge detection. Doubles up on both sides of an edge; better for blur/focus work than for clean ControlNet conditioning. (This pack also ships it as its own standalone node.)
Inputs that matter
- image - your input.
- low_threshold / high_threshold (default 100/200, range 0–255) - the two knobs you'll actually tune. Pixels above the high threshold become strong edges; pixels between low and high become weak ones. Both up to kill noise, both down to catch faint detail. Canny purists know this as the classic double-threshold pair.
- resolution (default 512, 64–2048, step 16) - the target for the shorter side of the image.
- keep_proportion (default on) - on, it keeps aspect ratio and crops the leftover to a multiple of 16 (symmetric crop); off, it stretches slightly to hit a clean dimension. Leave it on unless you need exact output sizes.
Output is a single IMAGE: white edges on black, 3-channel, ready to plug into a Canny/edge ControlNet or Control-Lora.
Installing it
This node lives in the ComfyUI-Nikosis-Preprocessors pack from Nikosis (the same author as the ComfyUI-Nikosis-Nodes prompt pack that gets recommended on r/comfyui - a real author, just not a household name).
- ComfyUI Manager: search ComfyUI-Nikosis-Preprocessors → Install → restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/Nikosis/ComfyUI-Nikosis-Preprocessors comfyui-nikosis-preprocessors, thenpip install -r requirements.txt(Windows portable uses..\..\..\python_embeded\python.exe -m pip install -r requirements.txt), restart.
The one dependency that actually matters here is opencv-python - that's the whole engine of this node. It's in requirements.txt, so a clean install gets it. If you see an import error for cv2, that's the thing to install.
Gotchas
- PyraCanny is slower than plain Canny by design (nine passes). On a big batch, that adds up - switch to plain
cannyfor a quick preview pass. - Thresholds behave the same across all five detectors, but the "look" differs wildly: don't tune pyracanny, then swap to sobel and expect the same map.
- This node is a genuinely lighter alternative to installing controlnet_aux just for edges - but if you're already running controlnet_aux, you have Canny/Sobel covered and only pyracanny here is the rare find.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| model | COMBO | pyracanny | 5 options: canny, laplacian, prewitt, pyracanny, sobel |
| low_threshold | INT | 1000–255 | — |
| high_threshold | INT | 2000–255 | — |
| resolution | INT | 51264–2048 | — |
| keep_proportion | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |