Bitwise Not
The bit-flip, not a boolean toggle
- INT
Of every node in this pack, this is the one most likely to surprise you the first time you use it - because "not" sounds like it should flip True to False, and that is not what this node does.
What it does
One required input, input1 (INT, default 0), and one INT output. It's Python's ~ operator - the bitwise complement - which flips every bit in the number's two's-complement representation. Concretely: ~0 isn't 1, it's -1. ~5 isn't some boolean flip, it's -6. The general rule for any integer n is ~n == -n - 1. If you came in expecting a boolean NOT (true becomes false, false becomes true), this is the wrong node - it operates on the actual bits of the integer, and the result is a full-blown two's-complement flip, not a toggle between two states.
Once that clicks, the use case is the same as the rest of the bitwise family: manipulating an integer as a bit pattern rather than as a plain number, most often when you're combining it with And, Or, or a mask to isolate or clear specific bits (a common pattern is value & ~mask to clear the bits a mask covers). It's genuinely a specialist's tool, and the pack is honest about being a grab-bag - author aria1th built LogicUtils to expose real Python operators as nodes, low-level bit ops included, not just the operations a typical image workflow needs.
The inputs and outputs that matter
input1(required INT, default 0) - the value to complement.- Output:
INT-~input1, the full bitwise complement (equivalent to-input1 - 1).
Installing it
ComfyUI Manager: search ComfyUI-LogicUtils, install, restart. By hand: cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart. Nothing to download beyond the repo - no models, no real dependency chain, which is exactly why this pack got recommended on Reddit as the lightweight pick over heavier node suites for basic logic needs. There's an opt-in install hook (COMFYUI_LOGICUTILS_AUTO_INSTALL=1) with a corresponding kill switch (COMFYUI_LOGICUTILS_SKIP_INSTALL=1); given there's nothing heavy to install here, you're unlikely to need either.
Where people get burned
The whole article above is really about the one real trap: expecting a boolean toggle and getting a two's-complement bit-flip instead. If your goal is "invert this true/false value," this node will hand you -1 instead of 1 when you feed it 0, and if you then treat that as truthy downstream, you'll actually get the opposite of what you wanted in some contexts and the same result in others, depending on how the next node interprets a nonzero integer - which is a genuinely confusing bug to chase down. For an actual boolean invert, look at this pack's Invert Basic node or the boolean-output Or/Compare gates instead; save Bitwise Not for when you specifically mean bit manipulation, like clearing bits with a mask.
Type-wise, input1 is strictly INT - no wildcard leniency here, so floats and strings get rejected at the connection rather than silently converted.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| input1 | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |