Nodes/CMK Flow/CMK Module Bypass Gate
ComfyUI Node

CMK Module Bypass Gate

CMK Module Bypass Gate

By CMKFlow·Created 3 months ago·Updated 2 days ago· 6
CMK Module Bypass Gate
  • MODEL BYPASS
  • IMAGE BYPASS
  • LOG BYPASS
  • MODEL ACTIVE
  • IMAGE ACTIVE
  • LOG ACTIVE
  • DIAGNOSTIC ACTIVE
  • VISUAL BYPASS
  • VISUAL ACTIVE
  • PROCESS BYPASS
  • PROCESS ACTIVE
  • MODEL
  • IMAGE
  • LOG
  • diagnostic
  • VISUAL
  • PROCESS
◄ENABLEfalse►

ComfyUI gives you bypass for free - Ctrl+B on any node, or the Fast Groups Bypasser in rgthree. So why does this pack ship its own gate?

Because a bypassed node in ComfyUI still participates in the routing. Bypass a module with six inputs and four outputs and the engine has to figure out what "the output" even means, which is why bypassing anything but a trivially wired node produces the famous red-wire disaster. CMK Module Bypass Gate makes the choice explicit instead: two complete sets of wires, one boolean.

The shape of it

Required: ENABLE, a boolean defaulting to false.

Optional, and this is the whole design: MODEL BYPASS, IMAGE BYPASS, LOG BYPASS on one side, MODEL ACTIVE, IMAGE ACTIVE, LOG ACTIVE on the other, plus DIAGNOSTIC ACTIVE.

Outputs: MODEL (CMK_MODEL_PIPE), IMAGE, LOG (CMK_LOG_PIPE), diagnostic.

ENABLE false → you get the BYPASS triple. ENABLE true → the ACTIVE triple. It's an A/B switch with a friendly name, wired so that both branches already flow into the node and the boundary downstream only sees one.

The diagnostic output is the tell that this is a real pack node and not a generic switch: when ENABLE is false it returns an ExecutionBlocker(None) rather than a placeholder, so the inactive branch's diagnostic tree genuinely doesn't propagate.

Lazy, and why that's the point

Every optional input is declared lazy: True, and check_lazy_status only requests inputs for the branch that's about to run. When ENABLE is false, the active branch's nodes are never evaluated.

That has a direct consequence for your GPU: skipping a module this way isn't just cosmetic in the graph, it's a real skip. The README's development rule is explicit that a CMK solution "does not re-execute unchanged expensive modules" - these gates plus the branch caches are how that's enforced.

It also has a sharp edge. Your workflow has a SAVE ENABLED-style discipline everywhere, and a gate whose inactive branch still has expensive nodes wired will still load their models, because ComfyUI loads models at execution time for whatever branch does run. Bypassing a module doesn't unload the checkpoint the module was using.

When to reach for it

  • You have an optional stage you want to compare with and without. ControlNet, an InstantID pass, a face detailer. Wire both paths once, flip one boolean, keep your graph readable.
  • You're building a module and want a proper boundary. The architecture doc requires module boundaries before comparers, before subsequent modules, and before public outputs. This node is one of the sanctioned ways to make one.
  • You want a bypass that the downstream doesn't have to know about. Because the outputs are always CMK_MODEL_PIPE/IMAGE/CMK_LOG_PIPE, the consumer's wiring never changes.

What it is not for: muting a group of unrelated nodes. For that, rgthree's group muting is still better, and the KB's plumbing doc is right that the two are different tools.

Install

ComfyUI Manager → search CMK Flow → install the CMKFlow entry → restart. Manual, ComfyUI fully closed first:

git clone https://github.com/CMKFlow/cmk_nodes.git custom_nodes/cmk_nodes
python3 custom_nodes/cmk_nodes/scripts/install_cmk_requirements.py

Wait for CMK dependency check: OK. Nothing here needs a model, but the pack as a whole pulls ultralytics, onnxruntime, insightface, segment-anything, nudenet and opencv-python, so expect a chunky install.

Traps

It raises if the selected branch is incomplete. IMAGE and LOG must both be present on whichever side you selected - the code checks values[1] and values[2] and throws a named error. MODEL is allowed to be None, because plenty of CMK paths are image-only.

ENABLE defaults to false. So a freshly dropped gate passes the BYPASS side. If your "active" module isn't running, check the boolean before you check anything else.

Match the visible enable to the pack's two-level scheme. CMK distinguishes a global enable for the module from a local enable for each parallel instance, and a module only truly runs when both are on. This gate is a boundary switch, not a replacement for a module's own enable.

CategoryCMK/Internal/Gates

Inputs (12)

NameTypeDefaultDescription
ENABLEBOOLEANfalse—
MODEL BYPASSopt*—
IMAGE BYPASSopt*—
LOG BYPASSopt*—
MODEL ACTIVEopt*—
IMAGE ACTIVEopt*—
LOG ACTIVEopt*—
DIAGNOSTIC ACTIVEoptCMK_DIAGNOSTIC—
VISUAL BYPASSoptCMK_VISUAL_PIPE—
VISUAL ACTIVEoptCMK_VISUAL_PIPE—
PROCESS BYPASSopt*—
PROCESS ACTIVEopt*—

Outputs (6)

NameTypeDescription
MODELCMK_MODEL_PIPE—
IMAGEIMAGE—
LOGCMK_LOG_PIPE—
diagnosticCMK_DIAGNOSTIC—
VISUALCMK_VISUAL_PIPE—
PROCESS*—