Nodes/ComfyUI LC123 Nodes/LC Invert Boolean
ComfyUI Node

LC Invert Boolean

Not this one — the boolean flip that accepts anything

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

You want the opposite of a value, but the value isn't a clean boolean - it's a number, a text field, or a node that only outputs strings. That's the entire pitch of LC Invert Boolean: it takes almost anything, coerces it to true/false the way you'd expect, then flips it. One input, one boolean out, and the result is printed on the node face so there's no guessing what it decided.

How it works

The input value is a wildcard socket, so it accepts BOOLEAN, INT, FLOAT, or anything number-like. The coercion rules are the sensible ones:

  • True, non-zero numbers, and strings like "1", "true", "on", "yes" → true
  • False, 0, 0.0, None, and strings like "", "0", "false", "off" → false
  • Anything else truthy → true (Python's usual rules)

Then it negates. So feed it 1 and you get false; feed it 0 and you get true. The output is a real BOOLEAN, which means it drops into any boolean socket - switch selectors, bypasser logic, conditional save nodes - without you caring how the source encoded its answer.

This is the "gate" half of the graph-as-program pattern: a condition from one branch inverted to drive another. It pairs naturally with the pack's LC Boolean (which does the same coercion without the flip) and its boolean switches, and it's the kind of node you didn't know you wanted until you're three nodes deep in "if the seed is 0, do the other thing."

The one trap

Because the coercion is Python-flavored, a string like "False" (capital F) still parses as false, but a string like "no thanks" is truthy and inverts to false - you may not get what you meant. If you're feeding it free text, normalize it first. Also note it doesn't exist to handle None-with-a-message; a missing input reads as false and inverts to true, which is a quiet surprise if you expected nothing to come through.

Install

Ships in ComfyUI LC123 Nodes (MIT, 89 nodes). ComfyUI Manager → search "ComfyUI LC123 Nodes", or:

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

Restart. No extra dependencies. On hosted platforms like RunningHub, request the pack and they install it for you.

When to reach for it

Any time a downstream node wants a boolean and the thing you have is "a number that is 0 or not 0" or "a string that says true/false." If you only ever feed it real booleans, it's still handy - it's a named, visible "not" in a graph where core ComfyUI will make you build one out of math. Small node, zero magic, exactly what the label says.

CategoryLC123/utils

Inputs (1)

NameTypeDefaultDescription
value*BOOLEAN, INT, FLOAT, or number. Non-zero / True → true, else false; then inverted.

Outputs (1)

NameTypeDescription
BOOLEANBOOLEAN