Nodes/ComfyUI-JNodes/Boolean Selector + String
ComfyUI Node

Boolean Selector + String

One true/false toggle, two typed outputs

By JaredTherriault·Created 3 years ago·Updated about a month ago· 91
Boolean Selector + String
    • BOOLEAN
    • STRING
    booleantrue

    A dead-simple utility node with a specific reason to exist. It's a single true/false toggle that hands you the value two ways at once: as a real BOOLEAN for the nodes that want a boolean, and as a STRING ("true" / "false" text) for the nodes that want text. That "and also as a string" part is the whole point - plenty of nodes take text input where you'd like to pass a yes/no, and plenty of times you want the same toggle to both control a switch and get written into a prompt or metadata as words.

    You reach for it when one decision needs to reach two kinds of inputs. Rather than set a boolean in one place and separately type "true" into a text field somewhere else - and inevitably let them drift out of sync - you flip one toggle and both outputs update together. It's part of a family of JNodes "selector with string" nodes built on the same idea: pick a value, get it back as its native type and as text.

    How it works

    There's nothing clever under the hood - you set the toggle, it emits the boolean and the equivalent string. The value is the value; the node just presents it in both forms so you don't maintain two sources of truth for one decision.

    The inputs and outputs that matter

    • boolean - the toggle itself, defaults to true. That's the only input; everything downstream follows from it.

    Two outputs:

    • BOOLEAN - the native true/false, into any boolean input (a switch, a bypass toggle, a conditional node).
    • STRING - the same value as text, into a prompt field, a metadata writer, or anywhere a node reads words instead of a bool.

    How to install it

    ComfyUI Manager, search JNodes, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/JaredTherriault/ComfyUI-JNodes
    pip install -r ComfyUI-JNodes/requirements.txt
    

    No models needed.

    Common issues & troubleshooting

    The string output isn't the format a downstream node wants. It emits "true"/"false" text. If some node expects "1"/"0" or "yes"/"no", this won't magically match - run it through a search-and-replace (the pack has nodes for that) or feed the boolean output into whatever actually wants a bool.

    Nothing changes when I flip it. Confirm you wired the output that matches the target's type - the boolean pin into boolean inputs, the string pin into string inputs. Crossing them either won't connect or won't behave.

    Do I even need this? Honest answer: if you only need a boolean, ComfyUI's built-in primitive is fine. This node earns its place specifically when the same toggle has to feed both a boolean input and a text field at once. If that's not your situation, skip it.

    Categorysd

    Inputs (1)

    NameTypeDefaultDescription
    booleanBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    BOOLEANBOOLEAN
    STRINGSTRING