Nodes/ComfyUI-Switchboard/Value on Boolean
ComfyUI Node

Value on Boolean

Value on Boolean is the switch that speaks every type

By Oratorian·Created 3 months ago·Updated 2 months ago· 9
Value on Boolean
    • float
    • int
    • string
    • boolean
    booleantrue
    value_if_true1.00
    value_if_false0.00

    Value on Boolean turns a single toggle into a fan-out. Give it a boolean and two numbers, it picks one of those numbers - value_if_true when the boolean is True, value_if_false otherwise - and hands it to you in four flavors at once: FLOAT, INT, STRING, plus the original boolean passed through. That's the whole trick, and it's a genuinely useful one, because it kills a class of "I just need this one number to be bigger sometimes" wiring that otherwise means convert nodes cluttering the graph.

    Concretely: one toggle can flip CFG between 7.0 and 3.5, drop denoise from 0.6 to 0.4, and - through the boolean passthrough - tell a Switchboard Group Controller to switch whole sections of the graph on or off at the same time. One decision, several effects. That's the pitch of this pack: a handful of inputs driving a full conditional pipeline, no separate utility pack (the README name-checks Comfyroll as the thing you no longer need for this).

    The inputs that matter (all required):

    • boolean - a toggle widget on the node itself, default True. Unlike the pack's Boolean Switch, this one does have a widget, so you can flip it by hand or wire a BOOLEAN into the socket from elsewhere.
    • value_if_true / value_if_false - FLOAT widgets, default 1 and 0, range ±1,000,000,000, step 0.01. Just type the two values you want to swap between.

    The outputs:

    • float - the chosen value as-is. CFG, denoise, guidance, LoRA/ControlNet/IPAdapter weights, any FLOAT input.
    • int - the chosen value rounded to a whole number (Python round(), so 0.5 rounds to 0 - quirks included). Steps, seed, width/height, batch size, a switch's select index.
    • string - the value as text, e.g. "2.0". Filename prefixes, labels, anything taking a STRING.
    • boolean - the input boolean, passed through untouched. This is the output that makes the fan-out work: chain it into another node's boolean, a Boolean Switch, or a Controller's BOOLEAN input.

    ComfyUI highlights compatible sockets when you drag from each output, so just pick the one whose type matches the target. No convert node in between.

    Install

    ComfyUI Manager, search ComfyUI-Switchboard, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Oratorian/ComfyUI-Switchboard
    

    Then restart ComfyUI and hard-reload the browser (Ctrl/Cmd+Shift+R). This is a real backend Python node, unlike the pack's browser-side Controllers, so a server restart is mandatory - a page refresh alone won't register it. No external Python dependencies, no model downloads; it appears under the 🎛️ Switchboard category in the Add-Node menu.

    Troubleshooting

    • "The int output isn't what I typed." Right - it rounds, it doesn't truncate. For a step count that's usually what you want anyway; just know it's rounding, not flooring.
    • "I need to switch actual text, not a number." This isn't that node. The string output is only the chosen number as text. For real arbitrary-value switching, use the Boolean Switch.
    • Runtime vs browser. Like the Boolean Switch, this evaluates at queue time, so a boolean computed by another node mid-run is read correctly - no browser-side pre-read limitation like the Controllers have.

    Small node, small footprint, real payoff. If you're already running Switchboard's Controllers, this is the missing half of the conditional-pipeline story; if you're not, it's still the cheapest way in ComfyUI to make one toggle change three settings at once.

    Category🎛️ Switchboard

    Inputs (3)

    NameTypeDefaultDescription
    booleanBOOLEANtrue
    value_if_trueFLOAT1.00-1000000000–1000000000
    value_if_falseFLOAT0.00-1000000000–1000000000

    Outputs (4)

    NameTypeDescription
    floatFLOAT
    intINT
    stringSTRING
    booleanBOOLEAN