add
Two floats in, one sum out — arithmetic without the mental gymnastics
- FLOAT
This is a one-line Python function wearing a node costume: two floats in, their sum out. add (Basic data handling: FloatAdd) takes float1 and float2 (both defaulting to 0) and returns their sum as a single FLOAT. No rounding, no clamping, no surprises - just float1 + float2.
If you've used ComfyUI for more than an hour you've met the problem this solves: numbers appear everywhere (CFG, denoise, strength, weights), and sometimes you need to combine them. "Take the base denoise and add a small offset." "Sum these two weights." This node is the non-annoying way to do that in a graph.
When it's actually the right choice
For a single addition, FloatAdd is perfect and obvious. Chain two or three of them and it starts to get silly - ten nodes to compute one expression. That's when you should switch to this pack's MathFormula node, which evaluates a safe expression like a + b * 2 from a single text field. Rule of thumb: one or two operations, use the dedicated nodes; anything longer, use the formula node and thank yourself later.
Both inputs are plain FLOAT with defaults of 0, so you can wire one side from another node and leave the other as a constant widget. Handy for the "add an offset to a computed value" pattern, where the offset stays a widget you can tweak.
Installing it
Part of the Basic data handling pack by StableLlama. ComfyUI Manager → search "Basic data handling" → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
then restart. The pack is dependency-free (empty dependencies list), no requirements.txt, no models.
Troubleshooting
Not much to go wrong with addition, but two notes. First, if you're summing values that are INTs, remember the output here is a FLOAT - 2 + 2 gives 4.0. Cast if you need an integer back. Second, floating-point precision: adding 0.1 + 0.2 gives 0.30000000000000004, not 0.3. If you're comparing the result against an exact value later, compare with tolerance rather than ==, or you'll be debugging an invisible precision error at 2am.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| float1 | FLOAT | 0.00 | — |
| float2 | FLOAT | 0.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |