Float Operation
The no-drama arithmetic node
- result
ComfyUI is swimming in floats. Denoise strength, CFG scale, LoRA weights, upscale factors - half the values you tweak live on some fractional scale, and sooner or later you need to combine two of them. That's what Float Operation is: a node that takes two floats, applies one arithmetic operator from a dropdown, and hands you the result as a float.
The honest framing: this is a genuinely tiny node from a genuinely tiny pack. ComfyUI's core MathExpression node can already do (a + b) * 2 in one line - but it takes a string expression, and string math is fiddly to read and easy to typo. Float Operation trades all that power for clarity: one operation, one visible dropdown, no parsing, no surprises. It's the node you reach for when you want the graph itself to say plainly what it's doing.
How it works is about as simple as custom nodes get. The node is a Python match statement: pick + and it returns operand_a + operand_b, pick * and it multiplies. Division is true float division, so 5 / 2 gives you 2.5, not 2 - no integer truncation sneaking in. What you wire in is what you get out.
The inputs that matter:
operand_a,operand_b- the two FLOAT values. Type them in, or wire them from any other node's FLOAT output.operator- the dropdown:+,-,*,/.
Output is a single result (FLOAT). Wire it into any FLOAT input you like - a denoise strength, a LoRA weight, an upscale scale, a sampler value. The typical use is scaling: multiply a base denoise by a per-run factor, or offset a CFG value without touching the node that set it.
Installing it
Install via ComfyUI Manager (search "Mewins Node Pack"), then restart ComfyUI. Or, manually:
cd ComfyUI/custom_nodes
git clone https://github.com/efuentesamin/mewins_node_pack
Then restart. That's the whole install: the pack lists zero runtime dependencies in its pyproject.toml and downloads no model files, so there's nothing to fight. The one requirement to watch is that it declares Python >= 3.12 - if your ComfyUI environment runs 3.10 or 3.11 (older portable builds), the install can fail at the version check.
Gotchas
- Division by zero kills the run. There's no guard in the code - pick
/with a0inoperand_band the node raisesZeroDivisionErrormid-graph. If a workflow dies at this node, check the zero. - One operation per node.
(a + b) * cneeds two of these wired in series - that's exactly the case where MathExpression's string form is less work.
Last, a little context: this pack is single-commit, cookiecutter-scaffolded code whose README still says "A list of features." Treat it as a small learning-grade utility, not an ecosystem staple - for heavy math people end up in core MathExpression or rgthree's Power Puter. But for one clean, visible float operation, this is the simplest wiring the pack has.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| operand_a | FLOAT | — | |
| operand_b | FLOAT | — | |
| operator | COMBO | 4 options: +, -, *, / |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| result | FLOAT | — |