Nodes/ControlFlowUtils/🚫 NOT (Invert Condition)
ComfyUI Node

🚫 NOT (Invert Condition)

The Humble NOT Gate Every Branching Graph Needs

By VykosXΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 147
🚫 NOT (Invert Condition)
  • input
  • output
β—„modetrueβ–Ί

Logic in ComfyUI has a recurring annoyance: you've got a condition that's exactly backwards from what you need. You want to act when a check is false, but your node only fires on true. InvertCondition (🚫 NOT (Invert Condition), from ControlFlowUtils) is a one-wire NOT gate: True goes in, False comes out, done.

It's the smallest node in the pack, and it's exactly the sort of thing that looks pointless until you need it three times in one workflow. A classic example: a cycle's "finished" flag. You want to continue while the cycle isn't finished - but the flag is True when it is finished. One InvertCondition between them and the logic reads naturally.

The inputs and output

  • input - any value to invert. Bools are the obvious case, but anything Python can evaluate goes through.
  • mode - which inversion to perform. This is the only input that's not purely obvious:
    • Default (boolean) - standard not: True ↔ False.
    • Logical - a bitwise NOT (two's complement) instead, meant for numbers. Feed it an integer and you get its bitwise complement, which is almost certainly not what you want unless you're doing deliberate bit math. The description helpfully points you to the Wikipedia article on two's complement, which is a strong hint that 99% of users should never touch this mode.

The single output is the inverted value, passed through.

Where it earns its place

Branching graphs. This pack's IfConditionSelector already has a NOT toggle, so you might think you never need this node - but InvertCondition is for the cases where the value itself, not the comparison, needs flipping. Feed it a raw boolean from a Cycle's FINISHED? output, from a Memory Storage, or from any node that emits a True/False you need negated before it reaches the next condition. It's also a handy passthrough: since it forwards data, you can drop it inline on a wire to flip a value without rerouting anything.

The honest take: if you're not doing logic-heavy workflows, this node is skippable - you can put a not in a Data Monitor FORMULA or an IF custom expression instead. But once you start chaining conditions, having a visible, obvious NOT gate in the graph is genuinely nicer to read than burying a negation in an expression string. It's a "draw the circuit clearly" tool.

One trap: mode is a widget toggle, and it's easy to flip it by accident. If you wire a boolean through and get weird integer results, check that mode is still on the default boolean setting, not Logical.

Install

InvertCondition ships in VykosX/ControlFlowUtils:

# ComfyUI Manager β†’ Install Custom Nodes β†’ search "ControlFlowUtils"
# or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/VykosX/ControlFlowUtils

Restart, find it under 🐺 VykosX-ControlFlowUtils right next to IfConditionSelector. No dependencies, no models - it's one boolean flip on a wire.

Category🐺 VykosX-ControlFlowUtils

Inputs (2)

NameTypeDefaultDescription
input*Data to forward to other nodes after inverting the condition.
modeBOOLEANtrueWhat kind of NOT will be executed, Boolean or Logical.

Outputs (1)

NameTypeDescription
output*Data that will be forwarded to other nodes after inversion