ComfyUI Node

CN Preprocessor

Canny, depth, pose, and more — a ControlNet preprocessor without the bloat

By creativeself-kim·Created 10 months ago·Updated 6 months ago· 1
CN Preprocessor
  • image
  • image
preprocessorcanny
resolution512
low_threshold100
high_threshold200

ControlNet conditioning is only as good as the preprocessor that turns your reference into edges, depth, or a pose skeleton. This node bundles five of the classic ones - canny, depth, lineart, pose, and mlsd - behind a single dropdown, and it does it without dragging in the heavyweight controlnet_aux dependency most packs use. The pack's changelog says that was a deliberate move: direct implementations, lazily imported, so the node only pulls the models it actually needs.

How it works

You feed in an IMAGE, pick a preprocessor, and set a resolution. The node runs the detector per-image across your batch and returns a matching IMAGE. The heavy models are cached once loaded, so the first call for a given preprocessor is slow and subsequent ones are fast.

The five modes aren't equal under the hood. canny is pure OpenCV - no model download at all, just edge detection with the two thresholds. depth uses a MiDaS/DPT model, lineart and mlsd download their weights from the lllyasviel/Annotators Hugging Face repo, and pose pulls the OpenPose body model. That means your first depth or pose run will hang on a download before it does anything.

The inputs

  • image (IMAGE) - your reference batch.
  • preprocessor - canny / depth / lineart / pose / mlsd.
  • resolution (INT, default 512, 256–2048) - the internal detect/resize resolution. Bigger is more detail and more VRAM.
  • low_threshold / high_threshold (INT, canny only, defaults 100/200) - canny's edge thresholds. If you accidentally invert them, the node swaps them for you.

Output is a single image (IMAGE) ready for whatever ControlNet model your workflow uses.

Choosing a mode

Canny is the workhorse for architecture and hard-edged subjects - thin, clean contours. Lineart gives softer, sketch-like lines that pair well with character work. Depth is the pick when you care about spatial arrangement over edges. Pose is for anything with people whose stance you want to lock down. MLSD is the niche one - straight-line structural detection, great for interiors and man-made scenes. If you're new to this, the KB's ControlNet essay is the right background read: the preprocessor choice is the artistic decision here, more than the weight.

Install and troubleshooting

Ships in the IXIWORKS pack: ComfyUI Manager → search ComfyUI-VideoDescription → Install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/IXIWORKS-KIMJUNGHO/ComfyUI-VideoDescription

The pack's requirements add opencv-python-headless (headless deliberately, to avoid clashing with ComfyUI's own opencv) and huggingface-hub for the model downloads - both are light and ComfyUI already brings torch/pillow/numpy. The failure mode people actually hit: first use of depth/lineart/pose/mlsd downloads weights, so if a run looks frozen, check the console log for the Hugging Face download rather than restarting. Canny is the zero-download option if you want to smoke-test the node first.

CategoryIXIWORKS/ControlNet

Inputs (5)

NameTypeDefaultDescription
imageIMAGE
preprocessorCOMBOcanny5 options: canny, depth, lineart, pose, mlsd
resolutionINT512256–2048
low_thresholdoptINT1000–255
high_thresholdoptINT2000–255

Outputs (1)

NameTypeDescription
imageIMAGE