CMK Flow · 05 ControlNet ZIT
Canny-only ControlNet for Z-Image, and the resolution setting that catches everyone
- PROCESS
- IMAGE
- LOG
- VISUAL
- REFERENCE IMAGE INPUT
- PROCESS
- IMAGE
- LOG
- VISUAL
- diagnostic
- CONTROLNET IMAGE
ControlNet is the step where a Z-Image Turbo render stops being purely prompt-driven and starts obeying a picture. CMK Flow · 05 ControlNet ZIT is the ZIT-family prepare module: it takes a reference image or your own base image, turns it into a conditioning hint, stuffs that into the process pipe, and lets the sampler pick it up.
Category is CMK/Flow/Process/ZIT - the Flow half of the pack, so it's a numbered stage (05, same slot as the SDXL ControlNet module) in the guided chain rather than a loose tool. If you're on the SDXL path you want the SDXL prepare node; the two are deliberately separate because the families are mechanically separate contracts, which is also why the node hard-rejects a process pipe that isn't ZIT.
What it actually prepares: canny
Here's the honest limitation up front. The module runs Canny, and only Canny - the source sets zit_controlnet_type to "canny" and the log block prints CONTROL TYPE : CANNY. The Fun ControlNet family underneath it supports more conditions than that, but this node gives you one, with two thresholds. If you came for depth or pose, you're building that yourself.
The chain is straightforward:
- Pick the source.
IMAGE SOURCEisBase Image(use whatever the previous stage produced) orReference Image(load a file, either from the input directory viaREFERENCE IMAGEor from a wired image viaREFERENCE IMAGE INPUT). - Optionally apply the process mask if
APPLY MASKis on. - Scale with core
ImageScaleToMaxDimension, lanczos, so the longest side hitsresolution(default 1024). - Run core
Cannywithlow_threshold(0.1) andhigh_threshold(0.32). - Write the result into the process pipe: the control image, the strength, the patch name, and
generation_mode: "controlnet".
The sampler then loads the patch through core ModelPatchLoader and applies it via ZImageFunControlnet (with QwenImageDiffsynthControlnet as a fallback name), using the VAE from the model pipe. Note what that means for res: ZImageFunControlnet takes its width and height from the control image, so when ControlNet is enabled this node's resolution effectively sets your sampling resolution. That surprises people who set 1024 for a fast canny pass and watch their output size change.
MODEL PATCH is the Fun union file - Z-Image-Turbo-Fun-Controlnet-Union.safetensors by default - and it must exist. Z-Image is unusually well served here: separate Apache 2.0 unions for Turbo and Base, seven conditions, an inpaint mode and a dedicated tile model. This module uses the Turbo union as a patch on the ZIT model.
Inputs and outputs
Worth setting: ENABLE (default off - a dropped-in module does nothing until you turn it on), IMAGE SOURCE, REFERENCE IMAGE, STRENGTH (0–2, default 1.0), and resolution if your ZIT renders want a different size. low_threshold/high_threshold are advanced; lower the low threshold for more edges (and more noise), raise both for sparser lines.
Also here: PROCESS (CMK_PROCESS_Z_IMAGE), IMAGE (lazy), APPLY MASK, optional LOG, VISUAL, REFERENCE IMAGE INPUT (lazy), REFERENCE IMAGE NAME.
Outputs: PROCESS, IMAGE (unchanged, authoritative, for the next ZIT module), LOG, VISUAL (unchanged), diagnostic, and CONTROLNET IMAGE - the canny result, for previewing. With ENABLE off, PROCESS comes back with ControlNet fields cleared and the diagnostic and CONTROLNET IMAGE outputs are blocked rather than empty. Wire PROCESS and IMAGE onward; treat CONTROLNET IMAGE as a preview tap.
Install
Manager → search CMK Flow → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/CMKFlow/cmk_nodes
python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py
python3 custom_nodes/cmk_nodes/scripts/check_cmk_resources.py --models-root "/path/to/shared/models"
The union file is multiple gigabytes, so the checker confirms it separately and only downloads on an explicit yes. ComfyUI's Vue Nodes / Nodes 2.0 setting should be on - CMK warns at startup otherwise and the dynamic module UI degrades.
Common issues
- "CMK ZIT ControlNet accepts only PROCESS ZIT." You're on the SDXL or HYBRID branch, or the process pipe lost its family metadata. Use the matching prepare node.
- Output resolution changed when you enabled ControlNet. By design - the canny image's dimensions set the sample size. Set
resolutiondeliberately. - No effect at low strength, burnt-in artefacts at high. Strength is 0–2 with no magic number: start at 1.0 and move in 0.05 steps; above ~1.5 you're mostly fighting the model rather than guiding it.
- The CONTROLNET IMAGE wire reports nothing. Expected when
ENABLEis off, and expected to be preview-only even when on - it's not the pipeline's image. - Edges look wrong. Thresholds are the whole game with canny.
0.1/0.32is a sane default for photographic references; line art and flat-colour references usually want a lower pair.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| PROCESS | CMK_PROCESS_Z_IMAGE | — | |
| IMAGE | IMAGE | — | |
| ENABLE | BOOLEAN | false | — |
| IMAGE SOURCE | COMBO | Reference Image | 2 options: Base Image, Reference Image |
| REFERENCE IMAGE | COMBO | 2 options: CMK Package · controlnet_reference.png, example.png | |
| APPLY MASK | BOOLEAN | false | — |
| STRENGTH | FLOAT | 1.000–2 | — |
| resolution | INT | 102464–8192 | — |
| low_threshold | FLOAT | 0.100–1 | — |
| high_threshold | FLOAT | 0.320–1 | — |
| MODEL PATCH | COMBO | Z-Image-Turbo-Fun-Controlnet-Union.safetensors | 1 options: Z-Image-Turbo-Fun-Controlnet-Union.safetensors |
| LOGopt | CMK_LOG_PIPE | — | |
| VISUALopt | CMK_VISUAL_PIPE | — | |
| REFERENCE IMAGE INPUTopt | IMAGE | — | |
| REFERENCE IMAGE NAMEopt | STRING | — |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| PROCESS | CMK_PROCESS_Z_IMAGE | ZIT process with optional ControlNet preparation. |
| IMAGE | IMAGE | Unchanged authoritative IMAGE for the following ZIT module. |
| LOG | CMK_LOG_PIPE | Structured Flow log. |
| VISUAL | CMK_VISUAL_PIPE | Unchanged visual provider pipe. |
| diagnostic | CMK_DIAGNOSTIC | Optional diagnostic information. |
| CONTROLNET IMAGE | IMAGE | Prepared ControlNet image for the visual provider. |