Nodes/ComfyUI-Flow-Control/Flow - Clip Condition
ComfyUI Node

Flow - Clip Condition

One workflow that runs on SD15 and SDXL checkpoints

By krich-cto·Created 2 years ago·Updated 2 years ago· 1
Flow - Clip Condition
  • clip
  • base
  • SD15 clip
  • SDXL clip

Here's the trickiest idea in ComfyUI-Flow-Control: one saved workflow that works on both SD15 and SDXL checkpoints, without you rebuilding it every time you switch. FlowClipCondition takes your CLIP, looks at which "base" your graph says is active, and fans the clip out to two outputs - an SD15 path and an SDXL path. Then the pack quietly deletes whichever half of the graph you're not using before it samples.

It's the beginning-condition node for CLIPs, the text-side sibling of FlowImageCondition and FlowLatentCondition. The thing that makes it work is the pack's patched prompt validation, which doesn't just mute the dead branch - it removes the nodes from the prompt entirely.

How it works

You feed it a clip and a base input. The base input is where a FlowGate connects; the gate's string value (e.g. SD15 or SDXL) is what the pack reads. The node itself just returns (clip, clip) - the same CLIP on both the "SD15 clip" and "SDXL clip" outputs. All the decision happens elsewhere.

At validation time the pack's flow hook reads the gate value and maps it to a hardcoded pair of gates: SD15 opens gate 1, while Pony and SDXL both open gate 2 (Pony is treated as SDXL, which is correct). Then it walks the graph and deletes every node downstream of the closed output - recursively, including children of deleted nodes. So you build an SD15 sampling path off "SD15 clip" and an SDXL path off "SDXL clip", both feeding a FlowConditioningAutoSwitch, and whichever matches the checkpoint you loaded is the only half that actually runs.

That's the magic, and it's why the pack patches ComfyUI's execution.validate_prompt at import time. It's global behavior, but it only kicks in when one of these condition nodes is in the graph.

The inputs that matter

  • clip - from your checkpoint loader.
  • base - the FlowGate connection that says which family is active. This is where the gate's gates string lands.

Outputs are literally named "SD15 clip" and "SDXL clip". Build a text-encode + sampler branch off each and merge with FlowConditioningAutoSwitch.

Install

Part of ComfyUI-Flow-Control:

cd ComfyUI/custom_nodes
git clone https://github.com/krich-cto/ComfyUI-Flow-Control

Restart ComfyUI, or Manager → "ComfyUI-Flow-Control".

Gotchas

This is the least polished of the pack's condition nodes - it's got zero search impressions for a reason, and the intended wiring (gate into base) is the least documented. The gate mapping is hardcoded to SD15 vs SDXL/Pony, so it's strictly for that split; it won't branch into three families. And because the pruning deletes nodes from the executed prompt, a misconfiguration means a silent half-empty graph rather than an error - if output vanishes, check which base the gate is set to. It also assumes the whole Flow pipe: stock loaders won't produce the base metadata this relies on. Honestly, if you don't juggle SD15 and SDXL in one workflow, this node is solving a problem you don't have.

CategoryFlow/begin-conditions

Inputs (2)

NameTypeDefaultDescription
clipCLIP
baseBASE

Outputs (2)

NameTypeDescription
SD15 clipCLIP
SDXL clipCLIP