Nodes/CMK Flow/CMK Flow · 05 ControlNet ZIT
ComfyUI Node

CMK Flow · 05 ControlNet ZIT

Canny-only ControlNet for Z-Image, and the resolution setting that catches everyone

By CMKFlow·Created 3 months ago·Updated a day ago· 6
CMK Flow · 05 ControlNet ZIT
  • PROCESS
  • IMAGE
  • LOG
  • VISUAL
  • REFERENCE IMAGE INPUT
  • PROCESS
  • IMAGE
  • LOG
  • VISUAL
  • diagnostic
  • CONTROLNET IMAGE
◄ENABLEfalse►
◄IMAGE SOURCEReference Image►
◄REFERENCE IMAGE▾►
◄APPLY MASKfalse►
◄STRENGTH1.00►
◄resolution1024►
◄low_threshold0.10►
◄high_threshold0.32►
◄MODEL PATCHZ-Image-Turbo-Fun-Controlnet-Union.safetensors►
◄REFERENCE IMAGE NAME—►

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:

  1. Pick the source. IMAGE SOURCE is Base Image (use whatever the previous stage produced) or Reference Image (load a file, either from the input directory via REFERENCE IMAGE or from a wired image via REFERENCE IMAGE INPUT).
  2. Optionally apply the process mask if APPLY MASK is on.
  3. Scale with core ImageScaleToMaxDimension, lanczos, so the longest side hits resolution (default 1024).
  4. Run core Canny with low_threshold (0.1) and high_threshold (0.32).
  5. 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 resolution deliberately.
  • 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 ENABLE is 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.32 is a sane default for photographic references; line art and flat-colour references usually want a lower pair.
CategoryCMK/Flow/Process

Inputs (15)

NameTypeDefaultDescription
PROCESSCMK_PROCESS_Z_IMAGE—
IMAGEIMAGE—
ENABLEBOOLEANfalse—
IMAGE SOURCECOMBOReference Image2 options: Base Image, Reference Image
REFERENCE IMAGECOMBO2 options: CMK Package · controlnet_reference.png, example.png
APPLY MASKBOOLEANfalse—
STRENGTHFLOAT1.000–2—
resolutionINT102464–8192—
low_thresholdFLOAT0.100–1—
high_thresholdFLOAT0.320–1—
MODEL PATCHCOMBOZ-Image-Turbo-Fun-Controlnet-Union.safetensors1 options: Z-Image-Turbo-Fun-Controlnet-Union.safetensors
LOGoptCMK_LOG_PIPE—
VISUALoptCMK_VISUAL_PIPE—
REFERENCE IMAGE INPUToptIMAGE—
REFERENCE IMAGE NAMEoptSTRING—

Outputs (6)

NameTypeDescription
PROCESSCMK_PROCESS_Z_IMAGEZIT process with optional ControlNet preparation.
IMAGEIMAGEUnchanged authoritative IMAGE for the following ZIT module.
LOGCMK_LOG_PIPEStructured Flow log.
VISUALCMK_VISUAL_PIPEUnchanged visual provider pipe.
diagnosticCMK_DIAGNOSTICOptional diagnostic information.
CONTROLNET IMAGEIMAGEPrepared ControlNet image for the visual provider.