ComfyUI Node

LC Boolean

Make any number a true/false, on the node face

By lonecatone23·Created 2 months ago·Updated 3 days ago· 18
LC Boolean
  • value
  • BOOLEAN

ComfyUI is happy to feed a switch an int or a float - a 1 from a math node, a 0 from a counter - but a lot of downstream logic wants a clean boolean, and the whole "is 0 falsy?" question can bite in either direction. LC Boolean exists to end that ambiguity: it takes a boolean, int, float, or any number, coerces it to a clean True or False, and prints the result on the node face so you can see what the graph is actually thinking.

The tooltip is the spec, quoted in full: "BOOLEAN, INT, FLOAT, or number → coerced to true/false (not inverted)." That last bit - "not inverted" - is the whole point of the node. In Python, 0, 0.0, None, and empty values are falsy; everything else is truthy. This node applies exactly that rule and then displays the verdict on the node body, which is the part people underestimate. In a big graph you can't always tell whether a switch is being driven by a 1 that's clearly true or a 0.0 that's doing something subtle - having the node visibly read True/False turns a silent bug into something you can spot at a glance.

The input is a single * socket, so anything connects: the output of a compare node, a seed's parity, a control_after_generate value pulled off a widget, whatever. The output is a single typed BOOLEAN, which is the key mechanical difference from a plain any-type pass-through - downstream boolean sockets validate against it, so you can wire it into nodes that require a real boolean instead of hoping the * output of a switch cooperates. That's the friction this node removes: the "I passed an int into a boolean input and the node silently treated it differently" class of problem.

Where people get confused is the pairing with LC Boolean Flip. If you want to invert a boolean - widget off → output on - that's LC Boolean Flip's job, and it takes a real boolean widget rather than any value. LC Boolean is the coercer; LC Boolean Flip is the inverter; LC Boolean Value is the source; LC Boolean Switch is the router. The pack splits these four apart on purpose, so reaching for the right one means asking "do I need to coerce, invert, emit, or route?"

The classic use: normalize the output of a comparison or a "has value" check before it drives a switch or a bypasser, so True means true and there's no intermediate 1 or 0.0 in the graph to misread. It's also genuinely useful when you're converting a node's numeric output into a flag for a conditional save or a notify.

It's the smallest kind of node - one input, one output, no settings - and that's fine. Not every node in a pack needs a page of features; the ones that remove ambiguity are the ones you reach for a hundred times. Install is the standard LC123 clone:

cd ComfyUI/custom_nodes
git clone https://github.com/lonecatone23/ComfyUI_LC123_nodes

Restart, no pip deps. If a switch has ever behaved the opposite of what you intended because of a stray numeric value, this is the node that makes the graph tell you the truth.

CategoryLC123/utils

Inputs (1)

NameTypeDefaultDescription
value*BOOLEAN, INT, FLOAT, or number → coerced to true/false (not inverted).

Outputs (1)

NameTypeDescription
BOOLEANBOOLEAN