FL Switch
A lazy boolean switch that skips the branch you didn't pick
- on_false
- on_true
- *
FL_Switch looks trivial - a boolean picks between two inputs - but the detail that actually matters is right there in the pack's own description: it's lazy-evaluated. Wire two different paths into on_true and on_false, and only the branch matching switch actually runs. The other branch's upstream nodes never execute at all.
That distinction is the entire reason this node is worth using over just building the logic yourself with a naive picker. ComfyUI's execution model, left to its own devices, generally runs whatever's upstream of a node before that node can pick between the results - so a naive "choose A or B" implementation still pays the compute cost of both A and B, then throws one away. FL_Switch is built specifically to avoid that. If one of your branches is cheap (a local blur, a resize) and the other is expensive - or, worse, a paid API call to something like this same pack's FL_GPT_Image1 or FL_Veo3VideoGen - a non-lazy switch means you're paying for the branch you're about to discard every single time. FL_Switch means you're not.
The inputs are minimal by design. switch is a plain BOOLEAN (default off). on_false and on_true both accept the wildcard type * - meaning you can wire literally anything into them: images, conditioning, models, strings, latents, whatever your graph produces - as long as whatever's downstream of the output can actually accept what you send it. The output is the same wildcard *, carrying through whichever branch got selected.
- If
switchisFalse:on_falsegets evaluated and returned.on_truenever runs. - If
switchisTrue:on_truegets evaluated and returned.on_falsenever runs.
Practical uses: A/B testing two generation paths in the same graph without duplicating everything downstream of the split; toggling between a cheap local step and an expensive paid API node based on a flag; or building genuine conditional logic - "if this passed a quality check, use path A, otherwise path B" - when paired with something upstream that outputs a boolean.
Installing it is the standard Fill-Nodes routine: search "Fill-Nodes" in ComfyUI Manager, or clone it manually -
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI_Fill-Nodes
- then restart ComfyUI. Zero dependencies - this is pure Python control flow.
Where people get burned. Because the output type is a wildcard, ComfyUI can't type-check what you've wired it into ahead of time the way it does for a normal typed socket. If on_true and on_false feed genuinely incompatible types into the same downstream input - say, one branch produces an IMAGE and the other a STRING, and the next node down the line only accepts one of those - you won't find out until runtime, and only for whichever branch actually gets selected that run. Test both settings of switch explicitly rather than assuming a graph that works with it True will also work with it False. And if two branches aren't enough logic for what you're building, the pack ships a bigger sibling for exactly that: FL_Switch_Big, which handles five cases plus a default rather than a single true/false split.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| switch | BOOLEAN | false | — |
| on_false | * | — | |
| on_true | * | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |