not
Flip any boolean, fix any backwards checkbox
- BOOLEAN
Every boolean you've ever wanted to flip, this is the node that flips it. not takes a single true/false and returns the opposite - the simplest node in Basic data handling and one of the most frequently needed, because the logic of real workflows is forever "run this unless that." You need NOT constantly, and it's the rare invert node that doesn't ask questions.
The concrete situation: some node hands you "face detected" when what you actually want is "no face" - a negative condition. Or a checkbox's semantics are backwards for your workflow and you'd rather not rebuild it. Wire the value through not and suddenly the logic reads the way your brain reads it.
How it works
One input, one output, pure inversion: not input. True becomes false, false becomes true. That's it - no truth table worth drawing, no edge cases, no coercion. It's the not you remember from every programming language, and because it's Boolean-in/Boolean-out, you can chain it with the pack's and, or, xor, and the comparison nodes without thinking about types.
The inputs and the output
input(BOOLEAN, default False) - the value to invert.BOOLEAN(output) - the opposite of the input.
That's the whole node. It's the boolean equivalent of a passthrough with a twist, and it composes with everything else in the pack's BOOLEAN category.
Installing it
Install Basic data handling from ComfyUI Manager (search "Basic data handling"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart ComfyUI. No dependencies, no models to download.
Troubleshooting
- "I need to invert a non-boolean - a number or a string." Don't reach for
notdirectly; Python's truthiness will surprise you (an empty string and a zero are "false-ish," butnot ""gives true whilenot "hello"gives false - andnot 3is false). Cast first with the pack'sto BOOLEAN, then invert if you still need to.notis for real booleans. - "Double negation reads confusingly."
notwired into anothernotcancels out - it's technically fine, but if you catch yourself doing it, one of the two is redundant. Remove it and the graph gets clearer. - "My branch runs when I told it not to." If the value feeding
notis unconnected, the default is False and the output is True - so an unconnectednotpasses "true" downstream, and whatever gate you thought you closed is wide open. Connect something or accept the default deliberately.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| BOOLEAN | BOOLEAN | — |