Absolute value
DF_Absolute_value – ComfyUI Node from Derfuu_ComfyUI_ModdedNodes
- FLOAT
DF_Absolute_value does one small, boring, genuinely useful thing: it strips the sign off a number, and it also lets you flip it back the other way if you actually want a negative. It's part of Derfuu_ComfyUI_ModdedNodes, a math-and-utility pack that's been sitting in the ComfyUI ecosystem since 2023 - one of a handful of small "do arithmetic without leaving the graph" packs people reached for before ComfyUI's own primitive widgets got as flexible as they are now.
You'll want this whenever a value coming out of upstream math could land on either side of zero and you need to guarantee which side it ends up on. Say you're computing an offset by subtracting two sizes and the result could be positive or negative depending on which input happens to be bigger - feed it through DF_Absolute_value and you get a predictable magnitude every time, instead of a workflow that behaves differently depending on which image happened to be larger that run.
Inputs and output
Two inputs, both required:
- Value - the number you're normalizing (a
FLOAT) - negative_out - a toggle: off gives you the positive magnitude (the standard absolute value), on flips the result negative instead
Output is a single FLOAT. With negative_out off, it's textbook |value| - always zero or positive. Flip it on and you get -|value| - always zero or negative, regardless of what sign the input came in with. That second mode is the part that isn't obvious from the name: it's not just "absolute value," it's "absolute value, with a sign you control." That's handy if you need a guaranteed-negative offset (say, always pulling a crop origin toward zero) without adding a separate multiply-by-minus-one step afterward.
Where it fits
This is a plumbing node, not something you'd add for its own sake. It shows up inside longer math chains built from this pack's other nodes - DF_Sum, DF_Subtract, DF_Divide and so on - as the step that locks a sign down before the result feeds into something that assumes one direction, like a size offset or a crop coordinate. If you're only doing one or two arithmetic steps, you probably won't need it; it earns its place once a chain gets long enough that sign drift becomes a real risk.
Installing
The whole pack installs together - there's no way to pull just this node. Easiest route is ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart ComfyUI. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes
then restart. No models, no unusual Python dependencies - it's plain logic nodes, so install is fast and there's little to go wrong.
Troubleshooting
If it doesn't show up in the node search right after installing, restart the ComfyUI server and then hard-refresh your browser tab. That covers the vast majority of "I installed it but it's not there" reports for this kind of pack, and it's a generic ComfyUI frontend-cache quirk rather than anything specific to Derfuu.
Worth knowing regardless: this pack's maintainer has a history of removing deprecated nodes outright on updates instead of keeping a legacy-labeled copy around, and people who've used the pack for a while have specifically complained about it - nodes vanishing between versions with no warning. The core math and converter nodes (this one included) have been stable for a long time and aren't the ones that tend to get pruned, but if you update the pack and a much older workflow suddenly throws a missing-node error somewhere else in the graph, that maintenance pattern is the first thing worth checking before you assume your install is broken.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| Value | FLOAT | 1.00 | — |
| negative_out | COMBO | 2 options: false, true |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |