easy mathFloat
Do arithmetic on two numbers inside your graph
- FLOAT
Sometimes you need a number that's derived from another number, not typed in by hand. Half of whatever the width is. The denoise plus 0.1. A strength scaled by some factor. easy mathFloat is the tiny calculator that lets your graph do that arithmetic instead of you hard-coding a value you'll forget to update.
It's one of the Logic/Math utilities in ComfyUI-Easy-Use - unglamorous plumbing, but the kind you're grateful for the moment you're building anything that adapts. On its own it does nothing exciting. Wired between two nodes that need to stay in sync, it's the difference between a graph that recalculates itself and one you have to babysit.
Why you'd reach for it
The honest answer is "whenever a value should be computed, not fixed." You're feeding a resolution into two places and want the second to always be a fraction of the first. You're driving a loop and need to step a strength up each iteration. You've got a float coming out of one node and need it offset before it goes into the next. Rather than a Python math node or a mental note to change both numbers together, you drop this and let it compute.
How it works
Two float inputs, a and b, and an operation you pick from a dropdown - add, subtract, multiply, divide and the usual friends. It applies the operation and hands back one float. That's the entire mechanism. Because the inputs are float sockets, either one can be a typed constant or a value flowing in from elsewhere, which is what makes it useful: connect a to something dynamic and b stays your multiplier.
The inputs and output
aandb- the two operands. Both default to 0 and accept a wide numeric range. Connect one or both to upstream values, or just type them.operation- the dropdown that picks what to do (add, subtract, multiply, divide, and so on). This is the knob that matters.
Output is a single FLOAT. Feed it into any numeric input - a strength, a denoise, a dimension (you may need an int-conversion node if the target wants an integer). Easy-Use has sibling nodes (easy mathInt, easy float, easy int, the newer easy simpleMath) for when your types differ; this one keeps things in float.
Installing it
Through ComfyUI Manager: search ComfyUI Easy Use, install, restart. Or manually: cd ComfyUI/custom_nodes && git clone https://github.com/yolain/ComfyUI-Easy-Use, install the requirements (install.bat on Windows, or pip install -r requirements.txt), restart. No models, no dependencies - it's arithmetic.
Where people trip
Two small ones. First, divide-by-zero: if b can ever be 0 at runtime, expect an error or an inf/nan sliding downstream - guard it if the value is dynamic. Second, float-vs-int mismatch: this node outputs a float, and some inputs (batch size, dimensions, step counts) strictly want an integer, so you'll occasionally need a conversion node in between or you'll get a type-mismatch on the wire. Neither is a bug in the node; both are just the reality of piping numbers around a graph. If you want integer math end to end, reach for the int-typed sibling instead of converting twice.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a | FLOAT | 0.00-999999999999–999999999999 | — |
| b | FLOAT | 0.00-999999999999–999999999999 | — |
| operation | COMBO | 6 options: add, subtract, multiply, divide, modulo, power |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |