Invert Boolean
The tiniest node that saves a real headache
- boolean
InvertBoolean does one thing: takes a true and returns false, takes a false and returns true. A boolean NOT gate. It's the kind of node you look at and think "surely I can just not have this" - and then you hit the case where it's genuinely the difference between a clean graph and a mess.
The classic case: you've got a checkbox or a PrimitiveBoolean driving some gate, and the semantics are inverted from what you want. Maybe a node's boolean input means "apply effect," but your toggle means "skip." Rather than re-labeling everything or converting widgets and chasing the wrong polarity through three nodes, you drop this in and flip the meaning in one place. It's also the natural companion to a switch node - Switch V2 in the same pack selects on_true when the boolean is high, and sometimes you just want the opposite branch selected without rebuilding the wiring.
How it works
There's no magic here, and there shouldn't be. One BOOLEAN input named boolean, one BOOLEAN output named boolean, and the execution is literally not boolean. The notable detail is that the input is input-only (force_input in the schema): there's no widget to type into, so you can't accidentally set a value that then disagrees with the wire. It takes a wire, inverts it, hands it back. That design choice is why it plays well with PrimitiveBoolean output chains - it's made to sit in a wiring path, not to be a standalone source.
The KB's node-plumbing doc frames the whole category: these value and logic nodes exist to fight repetition and illegibility. This one is all about the second - sometimes a NOT in the middle of a graph is easier to read and maintain than a boolean that's "true when we mean false."
Inputs and output
boolean- BOOLEAN input, must be wired. Source it fromPrimitiveBoolean, another node's boolean output, or a converted widget.boolean(output) - the inverted value. Feed it back into the same kinds of consumers.
That's the entire schema. Nothing to configure, nothing to tune.
Install
From the ComfyUI-FeiHou-Toolbox pack. ComfyUI Manager (search ComfyUI-FeiHou-Toolbox), or:
cd ComfyUI/custom_nodes
git clone https://github.com/FX-FeiHou/ComfyUI-FeiHou-Toolbox
Restart ComfyUI and hard-refresh the browser. No extra dependencies. The pack is written against ComfyUI's newer comfy_api.latest node API, so keep your ComfyUI reasonably current.
Gotchas
Only one worth mentioning: because the input is wired-only, you can't use this as a static true/false source. If you want a manual toggle, put a PrimitiveBoolean upstream and invert that. And if you find yourself chaining two InvertBooleans to get the original value back, that's a sign you'd be better off re-wiring the source - the node is for correcting polarity, not for cargo-culting a double negative into your graph.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| boolean | BOOLEAN | BOOLEAN input to invert. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| boolean | BOOLEAN | — |