ComfyUI Node

Invert Basic

Flip whatever comes in

By aria1th·Created 3 years ago·Updated 7 months ago· 116
Invert Basic
  • input1
  • *

Where the pack's boolean gates (Or, Compare) lock their outputs to BOOLEAN no matter what you feed them, Invert Basic keeps things wildcard on both ends - one input, *, one output, *. That flexibility is also exactly why it's worth reading the fine print before you rely on it.

What it does

One required input, input1, typed * with a default of 0. One output, also *. The node inverts whatever comes in - the name says "basic" for a reason, this is the simplest possible flip, not a full boolean-logic node like Bitwise Not (which does a two's-complement bit-flip on integers specifically) or the Compare/Or gates (which always resolve to true/false). Because both ports stay wildcard rather than being locked to BOOLEAN, the exact meaning of "inverted" here depends on what type actually reaches the node - from the pack author's general design (aria1th builds these nodes as thin wrappers around real Python operators rather than reimplementing them with extra type-coercion logic), the safest assumption is that this behaves close to Python's own not operator, which for most values returns a genuine boolean regardless of what type went in - but because the output port is wildcard rather than locked to BOOLEAN like the rest of this pack's boolean gates, don't assume the result is always a clean true/false without checking what actually comes out for your specific input type.

Where you'd reach for it: flipping a condition before it feeds into a switch - turning "is empty" into "is not empty," or negating the result of a Compare node when you actually wanted the opposite branch and don't want to rewire the comparison itself.

The inputs and outputs that matter

  • input1 (required, any type, default 0) - the value to invert.
  • Output: * (wildcard) - the inverted result. Sanity-check the actual type you get back for your specific input, since the port isn't locked to BOOLEAN.

Installing it

ComfyUI Manager: search ComfyUI-LogicUtils, install, restart. Manually: cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart ComfyUI. No models, no meaningful dependency chain - this pack's whole reputation, per a Reddit thread recommending it over heavier alternatives, rests on having none. There's an opt-in install hook (COMFYUI_LOGICUTILS_AUTO_INSTALL=1) with a matching off switch (COMFYUI_LOGICUTILS_SKIP_INSTALL=1); with nothing heavy to install, you probably won't need either.

Where people get burned

The wildcard-in, wildcard-out design is flexible but it means ComfyUI's own type checking can't catch a mismatch for you downstream - if you wire the output somewhere expecting specifically a BOOLEAN and what actually comes back is some other type your input produced, you won't find out until the graph runs and something errors or behaves unexpectedly. If you specifically need a locked BOOLEAN output and predictable behavior, the Compare or Or gates elsewhere in this pack are the safer choice, since both of those are typed BOOLEAN on the way out regardless of what goes in.

The other thing worth being clear-eyed about: this pack's README says outright that documentation hasn't caught up with the number of nodes it ships, and this is one of the nodes where that shows - the exact per-type inversion behavior isn't spelled out anywhere beyond the source. If precise behavior matters for your workflow, drop the node down with a known input, check the output, and don't assume based on the name alone.

CategoryLogic Gates

Inputs (1)

NameTypeDefaultDescription
input1*0

Outputs (1)

NameTypeDescription
**