ComfyUI Node

Bool To String (Soze)

Turn true/false into text ComfyUI's string nodes can use

By SozeInc·Created 2 years ago·Updated 5 days ago· 10
Bool To String (Soze)
    • STRING
    boolfalse

    ComfyUI's sockets are typed, and a BOOLEAN doesn't just plug into something expecting a STRING - even though half the time what you actually want is exactly that: a boolean rendered as readable text. A filename builder, a log line, a text preview widget, a JSON payload you're assembling by hand - all of those want a STRING, and this node is the one-step conversion to get you there.

    How it works

    There's no logic beyond the type conversion itself: bool in, STRING out. The schema doesn't specify the exact casing or format of what comes back ("True" vs "true" vs something else entirely), so if you're about to build comparison logic downstream that depends on the precise string value, check it once with a text preview node before assuming a particular format.

    It looks trivial, and mechanically it is - but the reason a "quality of life" pack bothers to ship a one-line type converter at all is that ComfyUI won't do this cast for you implicitly anywhere. Sockets check types strictly; a BOOLEAN output simply cannot be dropped onto a STRING input, full stop, no matter how obviously convertible the value is to a human reading the graph. Every gap like that is a node someone eventually had to write.

    The inputs and outputs that matter

    One input, bool (required, BOOLEAN, default false). One output, STRING.

    How to install it

    ComfyUI Manager → search "ComfyUI_Soze" → install → restart. Manual:

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

    then restart. No dependency beyond the base pack - it's a few lines of Python, nothing that needs a heavier install than the rest of the collection.

    Common issues & troubleshooting

    Practically the only real gotcha is the unstated exact string format mentioned above - if you're wiring this into a comparison node or a conditional check further downstream (rather than just displaying or logging it), verify the actual text once rather than guessing at the casing.

    Good pairings: feed a debug or config boolean through this and into Output Filename's file-input slots so a batch run's output files self-label with which branch or setting fired, or into Append To Text File to log which flag was active on a given run. And if what you actually need is the opposite boolean before converting it, chain Boolean Inverter in front rather than trying to string-manipulate your way to the flipped value after the fact.

    CategorySoze Nodes

    Inputs (1)

    NameTypeDefaultDescription
    boolBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    STRINGSTRING