DD Float Math
The two-output arithmetic node that saves you a converter
- float_result
- int_result
Float arithmetic is where a lot of ComfyUI tuning actually happens - CFG tweaks, denoise strengths, animation timing, interpolation weights - and core ComfyUI gives you no clean way to just do "a + b" on floats. DD Float Math is that missing node, with one design choice I've come to appreciate: it outputs the result as both a float and an integer, so whichever type the next node wants, you've already got it.
How it works
You give it two floats, a and b (both default 0.0, stepped at 0.01 so you can scrub them in the widget), and pick an operation:
- add, subtract, multiply - the basics.
- divide - float division, so 5 / 2 is 2.5 here (unlike the integer version of this node).
- power -
a ** b. - min / max - the smaller or larger of the two.
The outputs are float_result (FLOAT) and int_result (INT). The int result is just the float truncated toward zero - 2.7 becomes 2, -2.7 becomes -2. It's a convenience, not a rounding choice; if you need proper rounding control, that's what DD Float to Int is for.
The gotcha worth remembering
Divide by zero returns 0.0 instead of raising an error. That guard is great for graphs that run unattended, but it means a bad b value produces a plausible-looking zero rather than a crash you'd notice. If a value in your chain suddenly zeros out, check the divisor before you start debugging downstream nodes. Otherwise the behavior is exactly what the names say - no rounding surprises on the float side, and the only "surprise" is knowing you have an int output there to grab when a node stubbornly wants INT.
Where you'll reach for it
Anytime you're building schedules or conditional logic. "CFG 7 plus a touch" becomes a wire. "Interpolate between 0.6 and 1.0 at t" becomes a small math chain. Combined with DD Int to Float, it'll happily eat integers too - just remember that feeding it ints gets you floats on the way out, which is usually what you wanted anyway. If you already run WAS Node Suite or similar, you have equivalent math elsewhere; this is the no-frills option for people keeping their node count lean.
Installing it
Part of the ComfyUI_DD_Nodes pack by Digital Divas. ComfyUI Manager → search "DD Nodes", or:
cd ComfyUI/custom_nodes
git clone https://github.com/digital-divas-admin/ComfyUI_DD_Nodes.git
Restart ComfyUI. Empty requirements.txt means no extra Python packages and no model downloads. When Manager's search returns, make sure the repo is digital-divas-admin/ComfyUI_DD_Nodes and not the unrelated "ComfyUI-DD-Nodes" project that shares a name.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a | FLOAT | 0.00 | — |
| b | FLOAT | 0.00 | — |
| operation | COMBO | add | 7 options: add, subtract, multiply, divide, power, min, +1 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| float_result | FLOAT | — |
| int_result | INT | — |