Integer Absolute Value
Strip the sign off an integer
- INT
Absolute value, as a node. Feed it an integer and it gives you back the magnitude with the sign dropped: -7 becomes 7, 7 stays 7, 0 stays 0. If you remember abs() from a math class or any programming language, this is that.
It's a niche one, and it's honest about it. Where it earns a spot is any time you've computed a difference and only care how far apart two things are, not which direction. Subtract one frame index from another and you might get a negative; wrap it in this and you've got a clean distance. It's a building block for graph logic, not something you'll drop into a basic text-to-image workflow.
A concrete case: say you're comparing two frame indices, or two seeds, and you want the gap between them to drive something else - a step count, a blend amount, a range. Subtract one from the other and the result flips sign depending on which was bigger, which makes downstream math awkward and can hand a negative number to an input that only accepts positives. Feed that difference through this node and you always get a clean, non-negative magnitude, regardless of order. That "I don't care about direction, only distance" situation is the entire reason it exists.
How it works
Returns the absolute value of the input. Negative becomes positive, positive and zero pass through unchanged. One operation, nothing else.
Inputs and outputs
- value - the integer to take the absolute value of. Default 0, full integer range.
Output is a single INT, the magnitude.
Installing it
It's in the pack's comfyui_primitive_ops file. Install via ComfyUI Manager (search Various ComfyUI Nodes by Type / comfyui-various) or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/jamesWalker55/comfyui-various
Restart ComfyUI. No models, no extra dependencies.
Common issues
Honestly, there's nothing to troubleshoot in the node itself - it can't really misbehave. The only thing worth saying is that this is a leaf in a bigger toolbox. On its own it's almost pointless; its value shows up when it's the last step in a small chain, most commonly right after a subtract, to turn a signed difference into an unsigned distance. If you're not doing that kind of graph arithmetic, you'll probably never need it, and that's fine.
Keep the input an integer - that's what it expects. There's a JWFloatAbsolute in the same pack for the decimal version, so use the one that matches your type rather than converting back and forth.
If it ever loads red as a missing node in someone else's workflow, that just means the pack isn't installed. Grab it through ComfyUI Manager's "Install Missing Custom Nodes" or clone the repo above and restart.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | INT | 0-18446744073709550000–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |