Nodes/ComfyUI-TinyBee/Int to Boolean
ComfyUI Node

Int to Boolean

The one-liner that turns numbers into yes/no

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Int to Boolean
    • boolean
    integer0

    This node does exactly one thing: it takes an integer and turns it into a boolean. 0 becomes False; literally anything else - including negative numbers - becomes True. That's the whole function, and you'd be surprised how often you need it once your workflows stop being a straight line.

    Why you'd reach for it

    ComfyUI is full of inputs that want a BOOLEAN, but a lot of your graph logic produces integers. The classic case: you have a counter or an Incrementer ticking up, and you want to flip something off when it reaches zero. Or you're comparing values with a node that hands you a 1/0 and the downstream node insists on a real True/False. Instead of hand-wiring a primitive, drop this between the integer and whatever boolean gate comes next.

    It's a casting node, the same family as the pack's Boolean to Int, Float to Int and Int to Float - TinyBee groups them all under the 🐝TinyBee/Casting menu, and they exist because ComfyUI's type system is strict about these.

    How it works

    The implementation is one line of Python: return (integer != 0,). Python's truthiness does the rest, which is why -5 counts as True. Nothing cached, nothing clever - feed it an integer, get a boolean out the other side.

    The inputs that matter

    • integer - the value to convert. Defaults to 0, takes the full int32 range.

    And one output:

    • boolean - False if the input was 0, True otherwise. Wire this into any BOOLEAN input on a Switch, a condition, or a node that toggles behavior.

    Installing it

    This ships in the TinyBee pack, so you install the pack, not the node. Easiest route is ComfyUI Manager → Install Custom Nodes, search "ComfyUI-TinyBee", install, restart. No Manager? Then:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
    

    Restart ComfyUI and the node appears under 🐝TinyBee/Casting. The pack's dependencies (pillow, jsonata) are optional for this node - it uses only the standard library.

    Common issues

    The only real trap is expectations. If you're coming from a language where "truthy" means "non-empty but also positive", this node won't match - -1 is True here. If you specifically want "greater than zero", do the comparison upstream with an Int Compare node and let this one be a pure pass-through. Otherwise, there's genuinely not much to get wrong with a node whose entire body is one comparison.

    Category🐝TinyBee/Casting

    Inputs (1)

    NameTypeDefaultDescription
    integerINT0-2147483648–2147483647

    Outputs (1)

    NameTypeDescription
    booleanBOOLEAN