ComfyUI Node

Show Boolean

Surface a true/false value in the UI and the API response

By lldacing·Created 3 years ago·Updated 8 months ago· 96
Show Boolean
    • BOOLEAN
    Bool
    keytext

    Somewhere in your workflow you've computed a true/false - maybe ImageEqual (also in this pack) telling you whether a mask came back all-black, maybe some conditional gate deciding whether to run an upscale pass. The problem with a boolean deep in a ComfyUI graph is that it's invisible: there's no widget that shows you "this was true" the way a Preview Image node shows you a picture. ShowBoolean is that missing display node, and - because this pack is built for API use as much as UI use - it does double duty as a way to tag that value so an external caller can pull it straight out of the response.

    What it actually does

    ShowBoolean is an output node (is_output_node: true), which in ComfyUI terms means it always runs when it's part of the graph, whether or not anything downstream consumes its result - the same category PreviewImage and SaveImage live in. When it executes, it reports the boolean it received, tagged with whatever string you gave the key field, into the run's output message. Watching the queue in the browser, you'll see it show up there. Calling the API directly and reading back the execution history or the websocket messages, that same {key: value} pair is what you're grepping for - the same pattern this pack's base64 image nodes use, where they stuff base64Images/base64Type into the message; ShowBoolean stuffs your chosen key and the boolean.

    It also passes the boolean straight through as an output, so dropping a ShowBoolean into the middle of a wire to inspect it doesn't dead-end the graph - whatever was downstream of the original value can now hang off the ShowBoolean node instead.

    Inputs and outputs that matter

    Only two fields, both required:

    • Bool - the boolean value to display and report.
    • key (default "text") - the label this value shows up under in the output message. If you have more than one Show* node in a workflow that's going to be called via API, give each one a distinct key - otherwise you can't tell which value is which once they're both sitting in the response under "text".

    The single output, BOOLEAN, is the same value passed through unchanged, ready to wire into a Switch, a Reroute, or whatever conditional node needs it next.

    Installing it

    ComfyUI Manager: search comfyui-easyapi-nodes. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lldacing/comfyui-easyapi-nodes.git
    cd comfyui-easyapi-nodes
    pip install -r requirements.txt
    

    Restart. ShowBoolean has no model weights or heavy dependencies of its own - it's part of the same lightweight glue-node family as ShowString, ShowInt, ShowFloat and ShowNumber, all installed together with the pack.

    Where people get tripped up

    The default key is "text", and it's shared with the default key on ShowString and the other Show* nodes - drop two of them into a workflow without renaming the key, and they'll both try to report under the same label, so you'll only reliably get one of them back through the API. Rename the key the moment you add a second Show* node, not after you've spent twenty minutes wondering why a value looks missing.

    The other thing worth knowing: because it's an output node, ShowBoolean always executes and always shows up in a "Save (API Format)" export as one of the things the run reports. If you only wanted it for debugging in the UI and don't actually want it cluttering a production API response, delete it (or bypass it) before you export the API-format workflow - it doesn't get automatically stripped just because you're done looking at it.

    CategoryEasyApi/Boolean

    Inputs (2)

    NameTypeDefaultDescription
    BoolBOOLEAN
    keySTRINGtext

    Outputs (1)

    NameTypeDescription
    BOOLEANBOOLEAN