Pt Bitwise Not
The simplest node in the pack, and when it's useful
- tens_a
- TENSOR
Pt Bitwise Not is the only bitwise node here that takes a single tensor, and it does exactly one thing: flips every bit. Ones become zeros, zeros become ones. In PyTorch terms it's torch.bitwise_not(tens_a), and this node is a thin wrapper around that single call.
If your mental model of this family is "flags and bitfields," NOT is the complement operator - handy for inverting a mask before you AND it with something else. One subtlety worth knowing: on boolean tensors, torch.bitwise_not flips True/False, so this node doubles as a "logical not on a bool tensor" without needing the separate PtLogicalNot node. It just depends on whether your tensor is bool or int.
The one input
tens_a- theTENSORto invert. Integer or boolean dtype.
Output is a same-shape TENSOR. That's the entire surface area. This is a genuinely minimal utility node - the kind where the whole value is "you don't have to write a Python snippet to do it."
Where it fits
In the pack's broader story - no-code PyTorch in the graph - NOT is a tool for inverting masks and toggling flag bits during feature engineering. If you've got a bitfield where you want "everything except this flag," it's NOT + AND. It's also the kind of node you might use in a data-augmentation step to occasionally flip labels.
The honest review: you'll use this rarely, and when you do, it'll work with zero drama. The only error you're likely to hit is feeding it a float tensor - bitwise ops are integer/bool-only in PyTorch, so cast with PtToInt32 (or keep it bool) first. There's no shape mismatch risk since it's unary, which makes it the friendliest of the bitwise six.
Installing it
Ships in ComfyUI-Pt-Wrapper by Hide Inada (HowToSD). Grab it via ComfyUI Manager (search "ComfyUI-Pt-Wrapper") or:
cd ComfyUI/custom_nodes
git clone https://github.com/HowToSD/ComfyUI-Pt-Wrapper
Restart ComfyUI after installing. Fair warning before you do: this pack drags in a heavy requirements.txt - pandas, scipy, scikit-learn, transformers, datasets, gensim, and more. If the automatic install fails, install the requirements manually and retry. No models to download for the tensor nodes themselves.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| tens_a | TENSOR | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TENSOR | TENSOR | — |