Nodes/CMK Flow/CMK Sampler Bypass Gate
ComfyUI Node

CMK Sampler Bypass Gate

How a switched-off module stops costing you a render

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

Most nodes that offer a bypass switch are lying a little. You toggle the module off, the graph still evaluates everything upstream, and you just get the bypassed value handed through - wasted compute you never see. CMK Sampler Bypass Gate is the honest version: one boolean, and the branch you turned off does not run at all.

What it is

It picks between two complete sampler results: an InstantID sampler's output (MODEL, SAMPLED, LOG on the ACTIVE sockets) and the untouched sampled input that came in before it (MODEL, SAMPLED, LOG on the BYPASS sockets). ENABLE decides which one you get out. You'd reach for it when you want InstantID available in a workflow but off by default, without paying for its detection models, its encoder pass and its extra sampling steps every time you render something that doesn't need them.

The mechanism, and why it matters

The gate implements check_lazy_status. ComfyUI's lazy execution only materialises what a node asks for, so the gate asks for precisely one side: MODEL ACTIVE / SAMPLED ACTIVE / LOG ACTIVE when ENABLE is true, and the three BYPASS sockets when it's false. The other branch is never requested, so its upstream nodes never execute - no cache lookup, no model load, no second pass. The pack's design guidelines make this a rule rather than a feature: a module with a bypass must keep prepare, execute, merge, preview and boundary-cache nodes completely unrequested while disabled.

Where the honest part shows: when the module is off, diagnostic returns an execution blocker rather than a fabricated payload. So a disabled gate produces no diagnostic, which is the truthful state - nothing ran, there's nothing to report. Wire it into a log or visualizer that expects something there and you'll notice the difference, which is the point.

The ENABLE default is False, and the required MODEL, SAMPLED and LOG of whichever side you selected must all be present - the node raises "CMK Sampler Bypass Gate is missing the BYPASS result" rather than silently passing a None into your sampling chain. The InstantID sampler path uses SAMPLED rather than IMAGE because the refiner downstream needs the first-pass latent, not a decoded picture.

Inputs: ENABLE, plus optional MODEL BYPASS, SAMPLED BYPASS, LOG BYPASS, MODEL ACTIVE, SAMPLED ACTIVE, LOG ACTIVE, DIAGNOSTIC ACTIVE. Outputs: MODEL, SAMPLED, LOG, diagnostic.

Installing

ComfyUI Manager → search CMK Flow → install the CMKFlow entry → restart. Or:

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

That helper is not optional for a manual clone - a bare git clone never runs pip, and CMK needs ultralytics, insightface, onnxruntime and friends for its detection and face paths. Wait for CMK dependency check: OK, then start ComfyUI.

The one that catches people

This node is DEV_ONLY, so it doesn't appear in the ordinary node search - everywhere in CMK that a gate exists, it's internal infrastructure that ships inside the subgraph, registered so saved workflows still resolve it. If you're searching for "Sampler Bypass Gate" on a blank canvas and finding nothing, nothing is broken. Open a shipped CMK workflow, or unpack the relevant subgraph, and you'll see it doing its job. Also worth knowing: toggling the module on isn't free - the active path will run detection and identity conditioning, so expect the first enabled render to be the slow one, not the one after.

CategoryCMK/Internal/Gates

Inputs (10)

NameTypeDefaultDescription
ENABLEBOOLEANfalse—
MODEL BYPASSoptCMK_MODEL_PIPE—
SAMPLED BYPASSoptCMK_SAMPLED_PIPE—
LOG BYPASSoptCMK_LOG_PIPE—
MODEL ACTIVEoptCMK_MODEL_PIPE—
SAMPLED ACTIVEoptCMK_SAMPLED_PIPE—
LOG ACTIVEoptCMK_LOG_PIPE—
DIAGNOSTIC ACTIVEoptCMK_DIAGNOSTIC—
VISUAL BYPASSoptCMK_VISUAL_PIPE—
VISUAL ACTIVEoptCMK_VISUAL_PIPE—

Outputs (5)

NameTypeDescription
MODELCMK_MODEL_PIPE—
SAMPLEDCMK_SAMPLED_PIPE—
LOGCMK_LOG_PIPE—
diagnosticCMK_DIAGNOSTIC—
VISUALCMK_VISUAL_PIPE—