ComfyUI Node

Abs

Strip the sign off a number, integer or float

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

Abs is Python's abs() in node form: feed it a number, get back the magnitude with the sign gone. -7 and 7 both come out as 7. Simple, and if you've never needed it, you probably never will - but the one time you do, it's exactly this node you want.

That one time is almost always dimension math. You subtract one size from another to get a difference - a crop offset, a padding gap, a distance between two points on a canvas - and depending on which value happened to be bigger, the result can come out negative. Plenty of downstream nodes (a crop, an offset, a batch index) don't like negative numbers and will either error or do something you didn't intend. Abs is the cheap fix: it guarantees whatever comes out is a distance, not a direction.

How it works

It computes abs(input1) and passes the result straight through. There's no widget, no toggle, no options - it's the smallest possible node in the pack, one input in, one value out.

The inputs and outputs that matter

  • input1 - typed *, so it takes any wired value: an INT, a FLOAT, whatever an upstream math node handed it.
  • Output - also typed *, which is the detail worth noticing: unlike Ceil and Floor (which always force the result to INT), Abs preserves whatever type came in. Feed it a float, get a float back; feed it an int, get an int back. No unwanted rounding along the way.

How to install it

Same pack, same one-time install for every node in it. Via ComfyUI Manager, search ComfyUI-LogicUtils, install, restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/aria1th/ComfyUI-LogicUtils

then restart ComfyUI. No models, no non-trivial dependencies - this is pure Python and the restart is the entire install.

Some background, since the pack itself won't tell you: it's written by aria1th, publicly known as AngelBottomless, the trainer behind Illustrious XL - the SDXL anime finetune that became the open-source default after Pony Diffusion v6. LogicUtils is a side project of his: small building-block nodes for control flow, math and light image work, shipped with the frank admission in the README that "Proper documentation is being prepared, however there are too many nodes." The repo's been quiet since early 2026, right around when his public work shifted off image generation entirely - so don't expect a doc site to appear. What you get is the class name, the schema, and whatever an article like this one works out from them.

Common issues & troubleshooting

Node doesn't show up after installing. Check the folder name under custom_nodes is exactly ComfyUI-LogicUtils (a manual zip download sometimes tacks on -main), then restart fully rather than just refreshing the browser tab.

Output type doesn't match what the next node expects. Because the output stays */passthrough, if you were expecting a fixed INT out the other side, you won't get one automatically - pipe it through Ceil or Floor afterward if the downstream node insists on an integer.

You wanted "make this negative," not "make this positive." Abs only strips the sign, it doesn't flip it. For forcing a value negative, you'd want this pack's Negate Value node instead.

CategoryMath

Inputs (1)

NameTypeDefaultDescription
input1*

Outputs (1)

NameTypeDescription
**