CCTech Soft Edge Preprocessor (PiDiNet) ⚡
PiDiNet soft edges — sharper than HED, but read the research-use license first
- image
- IMAGE
PiDiNet is the second soft-edge preprocessor in this pack, and it earns its place by being genuinely different from HED rather than a second copy. Where HED produces soft, gradient-y edges, PiDiNet (Pixel Difference Convolution) tends to give crisper, more defined lines while still keeping the forgiving soft-edge character. It's the one some people reach for when HED's output feels too wishy-washy, and it's faster too - the network is small and the pixel-difference trick does real work per parameter.
Soft edges remain a first-class condition across the modern ControlNet universe: the 2026 unions for Qwen-Image, Z-Image and Flux 2 all include a soft-edge/HED mode, so a PiDiNet map plugs straight into the control_image socket of whichever one you run.
How it works
PiDiNet replaces standard convolutions with pixel-difference convolutions - instead of just multiplying filter weights against pixels, it also computes differences between neighbouring pixels, which turns out to be a very efficient way to detect edges. This node is a from-scratch port of the architecture from comfyui_controlnet_aux (Apache-2.0), real inference code rather than a wrapper. The checkpoint downloads from HuggingFace on first use into ComfyUI/models/pidinet/.
Inputs and outputs that matter
image- the photo or render you want edges from.resolution(default 512, 64–2048) - the internal working resolution.safe(default off) - quantizes the edge map into discrete levels, cleaning up noise and flattening the gradient bands. Same toggle HED has, and it's the main knob you have here.
Output is one IMAGE: the soft edge map. Feed it to a soft-edge ControlNet's control_image or to an edit model that consumes structural input images.
The license catch
This is the one thing to read before you adopt this node for anything commercial. The original PiDiNet authors' license adds a restriction beyond plain MIT, quoted verbatim in the node's docstring and in vendor/pidinet.py: "It is just for research purpose, and commercial use should be contacted with authors first." The ported code here is Apache-2.0, but that doesn't lift the restriction on the architecture and weights. If you need a commercial-clean soft-edge node, use the pack's HED preprocessor instead - same inputs, same output contract, no research-only clause.
Installing it
Same pack as everything here: ChrisColeTech/ComfyUI-ControlNet-Nodes, found under 🤖 CCTech/Preprocessors. Install through ComfyUI Manager (search "ComfyUI-ControlNet-Nodes") or:
cd ComfyUI/custom_nodes
git clone https://github.com/ChrisColeTech/ComfyUI-ControlNet-Nodes
Restart ComfyUI. No dependencies beyond the pack's own huggingface_hub and opencv-python.
Common issues
Aside from the license, it behaves like the rest of the family: the first run pulls the checkpoint and takes a moment, the safe toggle exists to fix noisy maps, and the preview will look less pretty than the final output - judge the generated result, not the raw map. If you can't tell PiDiNet apart from HED on your subject, run both into a compare node; the difference shows up fastest on high-contrast organic shapes with fine texture.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| resolution | INT | 51264–2048 | — |
| safe | BOOLEAN | false | Quantize the edge map into discrete levels - reduces noise, matches the source pack's 'safe' toggle. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |