[Inference.Core] Diffusion Edge (batch size ↑ => speed ↑, VRAM ↑)
Edge Detection That's Actually a Diffusion Model
- image
- IMAGE
Most edge detectors in this pack are either a classical filter (Canny, Binary, Lineart Standard) or a fairly light neural pass (HED-based Fake Scribble). DiffusionEdge is a different animal entirely - it's a genuine diffusion model that denoises its way toward an edge map instead of predicting one in a single forward pass. That's a heavier way to solve the problem, and it shows in the results: on tricky source images with uneven lighting, low contrast, or noisy detail, it tends to produce noticeably cleaner edges than Canny would on the same image, because it's iteratively refining rather than making one threshold-based pass.
The node's own display name spells out the cost of that quality honestly: "Diffusion Edge (batch size ↑ => speed ↑, VRAM ↑)." That's not marketing copy, that's a direct warning that this thing is meaningfully more expensive to run than the rest of the preprocessors in this pack, and the tradeoff is tunable rather than fixed.
What you set: image is required. environment (enum, default "indoor," with "urban" and "natural" as the other choices) picks between differently-trained checkpoints tuned for different scene types - match it to what's actually in your source image: interiors and architecture for "indoor," streets and cityscapes for "urban," landscapes and outdoor scenes for "natural." Picking the wrong environment won't error, but you'll likely get a noticeably worse edge map than the matching one would produce. patch_batch_size (default 4, range 1–16) is the VRAM/speed knob the display name is warning you about - it processes the image in patches, and this controls how many patches run in parallel. Push it up if you have VRAM to spare and want faster processing; drop it to 1 if you're VRAM-constrained and hitting out-of-memory errors. resolution (default 512) is the standard preprocessing size shared across this pack. The single IMAGE output goes into a ControlNet Apply node paired with an edge-family ControlNet checkpoint - typically the same Canny or Lineart ControlNet you'd use with any other edge preprocessor, since the output format is the same kind of edge map, just derived differently.
The honest take: this is the heaviest, most obscure node in the whole pack, and it's a reasonable one to skip entirely unless you've specifically hit a source image where Canny and Lineart are both struggling - low-light photos, heavy noise, or scenes where hard thresholding just isn't finding clean contours. For everyday use, Canny is faster and good enough. Reach for this when you need the extra quality and can afford the extra compute.
Installing it: this ships in LykosAI's ComfyUI-Inference-Core-Nodes pack - LykosAI also builds Stability Matrix, the meta-installer a lot of people use for local SD UIs, so this pack's install is more deliberately packaged than most solo repos. Search "ComfyUI-Inference-Core-Nodes" in ComfyUI Manager, or manually: cd ComfyUI/custom_nodes && git clone https://github.com/LykosAI/ComfyUI-Inference-Core-Nodes, then run install.py against ComfyUI's Python environment, or pip install -e .[cuda] / .[cuda12] / .[rocm] / .[directml] / .[cpu] matched to your hardware, or a plain pip install -e . without acceleration extras. Restart ComfyUI once done. Expect a real weight download the first time this specific node runs, since it's loading actual pretrained checkpoints per environment rather than running a classical filter.
Troubleshooting: beyond the pack-wide ModuleNotFoundError: No module named 'inference_core_nodes' issue (a failed or wrong-interpreter Python install step, common on portable ComfyUI builds), this node's specific failure mode is running out of VRAM - if you hit an OOM here and nowhere else in your graph, patch_batch_size is almost always the fix, not a broader system problem. If the edge map looks noticeably worse than expected, double-check environment matches your source image type before assuming something's wrong with the node itself.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| environmentopt | COMBO | indoor | 3 options: indoor, urban, natrual |
| patch_batch_sizeopt | INT | 41–16 | — |
| resolutionopt | INT | 51264–2048 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |