Qwen Image Canny Preprocessor
The edge map that feeds a Qwen ControlNet — no DiffSynth plumbing required
- image
- IMAGE
Qwen Image is a 20B MMDiT, and when it launched in August 2025 it took the community about a week to bolt a ControlNet onto it. The first ones were DiffSynth-Studio's "blockwise" controlnets - Canny, Depth, Inpaint - and this pack is a community attempt to run them in ComfyUI. This node is the piece of that pack you'll actually keep: a plain, boring Canny edge detector.
It takes an image and turns it into a white-on-black edge map, the classic preprocessor for structure control. Architectural shots, mechanical objects, anything with clear contours - that's Canny territory. If you already run comfyui_controlnet_aux, you have a Canny node that does the same job, and you don't strictly need this one. But it ships with the Qwen blockwise nodes so the map lands in the exact format they expect, and unlike the rest of the pack it needs none of the machinery: no DiffSynth pipe, no 20B Qwen model, no companion custom node. It works standalone.
The two knobs are the standard Canny thresholds:
low_threshold- INT, 0–255, default 100. Catches weak edges.high_threshold- INT, 0–255, default 200. Prunes everything noisier than this.
The defaults are fine for most work. Reach for the controls when the map is too busy (raise low_threshold to kill texture noise) or too empty (lower high_threshold to let faint details through). Rule of thumb: keep the ratio around 1:2 and you won't go far wrong.
Mechanically it's nothing fancy: your ComfyUI tensor gets scaled up to 0–255, run through cv2.Canny in grayscale, then re-encoded as white-lines-on-black RGB so a ControlNet can read it. It needs opencv-python, which is in the pack's requirements.txt - that's the one real dependency, and it's cheap.
Installing
Either way is the standard dance:
cd ComfyUI/custom_nodes
git clone https://github.com/krigeta/qwen-image-controlnets-comfyui
cd qwen-image-controlnets-comfyui
pip install -r requirements.txt
…then restart ComfyUI. Or skip the terminal and search "qwen-image-controlnets-comfyui" in ComfyUI Manager. Note the pack's requirements.txt also pulls diffsynth and einops for its siblings - heavier than a Canny node deserves, but you'll want it anyway if you're running the blockwise Apply node in the same pack.
Common issues
ImportError: opencv-python is required- the environment skipped the requirements.pip install opencv-pythonfixes it; on Windows make sure you're installing into the same Python that runs ComfyUI.- "It works but nothing changes in my image" - the edge map alone does nothing; it has to feed a controlnet. If you're on a modern ComfyUI (September 2025 onward), the Qwen native ControlNet path uses
model_patchesand the InstantX union, and that's where this edge map actually earns its keep. The DiffSynth blockwise route this pack targets is the older, fiddlier one.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| low_threshold | INT | 1000–255 | — |
| high_threshold | INT | 2000–255 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |