Absolute
The Math Node You Didn't Know You Needed
- value
- MATCHTYPE
UC_MathAbs takes a number and returns its distance from zero, dropping any negative sign. -5 becomes 5, 3.7 stays 3.7. It's one of those nodes that looks pointless until the moment it isn't - you're building a workflow, some upstream calculation goes negative, and suddenly every downstream widget is silently wrong. Absolute value is the fix.
Why you'd reach for it
The classic use is comparing magnitudes when you don't care about direction. Say you're diffing two seeds or two noise levels and you want to know how far apart they are, not which is bigger - abs(a - b) is the canonical "difference" idiom and ComfyUI core has no node that does it. It's also the safety rail in a lot of parametric setups: if a computed offset can land negative but a strength, a step count, or a multiplier must be positive, abs guarantees it without you having to reason about every branch.
How it works
The implementation is a straight abs(value) call. The interesting part is the type handling: the input accepts either an integer or a float (the pack's "MatchType" template), and the single output mirrors whatever type you fed in. Integer in, integer out; float in, float out. No surprises, and it means you can wire it straight into an INT socket or a FLOAT socket without a conversion node in between.
The input that matters
Just one: value. Everything else is automatic.
Installing it
It's part of ComfyUI-UtilsCollection by silveroxides. Grab it via ComfyUI Manager (search "ComfyUI-UtilsCollection"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI-UtilsCollection
Restart ComfyUI. No models, no heavy deps beyond opencv-python and typing-extensions. If you previously had ComfyUI-LogicMath installed, ComfyUI will offer to replace its nodes with this pack's equivalents - accept it, then remove the old pack, because having both is how you get duplicate nodes.
A note on this whole math family
This is one of a whole shelf of sibling nodes in the same pack - Add, Multiply, Floor, Clamp, Compare, and friends. They're all built the same way, they all accept int or float through the same MatchType template, and they all replace the old standalone ComfyUI-LogicMath nodes. So if you learn Abs, you've basically learned the family: one value in, one typed result out, zero ceremony. For a one-off "just make this number positive" task, it's the node you'd reach for over a hand-rolled formula every time.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| value | COMFY_MATCHTYPE_V3 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MATCHTYPE | COMFY_MATCHTYPE_V3 | — |