Boolean Control Output
Boolean Control Output
- text
- float
- int
- is_true
- is_false
ComfyUI doesn't have real branching the way a programming language does - no if/else block, just wires. BooleanControlOutput is how you fake it: one boolean input drives which set of values comes out the other side, letting you build one graph that behaves two different ways instead of maintaining two separate graphs. The README states it directly: "outputs different values based on a boolean input. If the boolean input is True, it will output the values of true_text, true_float, true_int, True, and False. If the boolean input is False, it will output the values of false_text, false_float, false_int, False, and True."
The pattern is simple but genuinely useful once you see where it applies: a single checkpoint or LoRA loader stage that needs different trigger words depending on a toggle, a sampler that should use different step counts for a "draft" pass versus a "final" pass, or any workflow you want to flip between two configurations with one switch instead of rewiring. It's the same conditional-output idea this pack applies to gender specifically in GenderControlOutput - this is the generic, unopinionated version.
Inputs: boolean_input (default true) is the switch itself. true_text/false_text are multiline string fields for whatever text should come out in each state - prompt fragments, labels, file paths, anything text-shaped. true_float/false_float (defaults 1 and 0) and true_int/false_int (defaults 1 and 0) are the numeric equivalents, useful for things like CFG scale, step count, or strength values that should differ between the two states.
Outputs: text, float, and int give you whichever value matches the current boolean_input state. is_true and is_false are the boolean itself and its inverse, passed straight through as outputs - handy if you need to feed the same condition into a second control node downstream, or into another node in this pack that takes a boolean switch (VAEEncoderSwitch, ImageScaleToTotalPixelsSwitch, and the rest of the pack's "…Switch" family all take a plain boolean).
Install: search "ComfyUI-utils-nodes" in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/zhangp365/ComfyUI-utils-nodes
Restart afterward. No models, no API keys - this is pure graph-logic, zero dependencies beyond the base pack install.
What actually catches people out:
- The numeric defaults aren't symmetric -
true_float/true_intdefault to 1 while the false-side defaults to 0. If you're only setting one side and expecting the other to inherit a sensible mirrored default, it won't; set both explicitly. - This node evaluates its
boolean_inputonce per queue, like everything else in ComfyUI's graph - it's not a live runtime conditional you can flip mid-generation. If you want different behavior across a batch, you need to actually change the boolean value between runs (or drive it from an upstream node), not expect it to branch dynamically within a single execution. - Because
is_true/is_falseexist specifically so you can chain the same condition into a second switch node, it's easy to end up with several nodes gated on the same boolean but forget to update all of them when you change your mind about what the switch should control - worth tracing every consumer of a shared boolean before assuming a single toggle change did what you expected everywhere.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| boolean_input | BOOLEAN | true | — |
| true_text | STRING | — | |
| true_float | FLOAT | 1.00 | — |
| true_int | INT | 1 | — |
| false_text | STRING | — | |
| false_float | FLOAT | 0.0 | — |
| false_int | INT | 0 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| float | FLOAT | — |
| int | INT | — |
| is_true | BOOLEAN | — |
| is_false | BOOLEAN | — |