β Boolean Not
The one-input node that flips any condition
- Result
Sometimes the simplest node is the one you forget exists. You build a gate with an If condition and a boolean from a Compare node, then realize you want the opposite branch to run. You could rewire everything. Or you could drop a "β Boolean Not" in the middle and be done in five seconds.
That's this node: one BOOLEAN in, one BOOLEAN out, and the output is the exact negation of the input. The code is literally return (not In,). There is no widget, no dropdown, no settings. It's the graph equivalent of Python's not, which is what it calls.
What you'd actually use it for
ComfyUI is full of situations where you want the inverse of a signal. A few that come up constantly:
- You have an
==Compare and you want!=without changing the Compare node's dropdown - though honestly, most Compare nodes just have both options. - You're using an π If condition and you want to flip which branch fires. Put a Boolean Not on the
Boolinput and the True/False outputs swap roles. - You want a gate that passes when something is not connected or not set. Pair it with a fallback-style node that outputs
None/empty when a branch is dead, and Boolean Not turns "empty" into "active."
Because the input type is strictly BOOLEAN, this node stays honest: it can't accidentally invert a number or a string. If you're feeding it from something that isn't a clean boolean - say a node that outputs an int - run it through FlowNodes' "Convert" node first (its bool conversion, unlike Python's raw bool("false"), actually handles "true"/"false"/"0"/"1" strings sensibly instead of returning True for any non-empty string).
The one catch: unwired inputs are False
An unconnected BOOLEAN input arrives as False, so an unwired Boolean Not silently outputs True. That's usually what you want (a dangling safety switch defaults to off), but it's a debugging trap if you've half-wired a branch and the graph "just works" for the wrong reason. If something downstream is behaving the opposite of your expectations, trace the wire - you've probably got a Not sitting on top of a False-by-default input.
Installing
This node ships in the FlowNodes pack, so you install the pack, not the node. In ComfyUI Manager, search FlowNodes, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/gitmylo/FlowNodes
# restart ComfyUI
No dependencies, no model downloads - pure standard-library Python. The pack is young and WIP, so weird behavior belongs on the GitHub issues page.
Where to put it
Boolean Not composes with the rest of FlowNodes' logic family: out of a π 2 Boolean operation, into a π Boolean Switch expression, or straight into the Bool socket of an If condition. It's also handy before a "control_after_generate"-style widget if you've converted one to an input and need the inverse. It won't change the world, but it will stop you from rebuilding a branch just because you wanted the other side.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| In | BOOLEAN | β |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Result | BOOLEAN | β |