Math Operation ♾️Mixlab
Math Operation (MultiplicationNode) — More Than the Name Suggests
- numberA
- FLOAT
- INT
Here's a small, useful gotcha before you even open this node: its class name is MultiplicationNode, but its display name in the actual node menu is "Math Operation." The display name is the honest one. This does multiplication and addition in a single pass - it's a full linear transform, not just a multiply.
The math is exactly this: take numberA, multiply it by multiply_by, then add add_by. numberA is the wildcard type *, so it'll take whatever numeric value is flowing into it from upstream - an INT, a FLOAT, the output of another math or random node. multiply_by is a FLOAT defaulting to 1 (so by default it's a no-op multiplier), with a range that goes down to -2 and up to a very large positive number - negative multipliers are explicitly supported, which is handy if you want to invert a value's sign as part of the same operation. add_by is a FLOAT defaulting to 0, ranging from -2000 upward, letting you shift the result by a flat offset after the multiply.
Both outputs come back at once: FLOAT and INT. You don't have to choose - the node computes the result once and hands you both a float and an integer version of it, so you can wire the float output into anything that wants precision (a weight, a strength value) and the int output into anything that needs a whole number (steps, a batch size), without adding a separate type-conversion node in between. Worth knowing: the int version is presumably truncated or rounded from the float result, so if you're chaining several of these together and expecting exact values, keep an eye on whether you're reading the FLOAT or INT socket downstream - small rounding differences can compound.
This is a genuinely handy little utility once you know it exists - the kind of node you reach for constantly in workflows that need to scale a seed, offset a frame index, or convert a 0-1 slider value into a usable pixel dimension, all without building a separate math subgraph by hand.
Install follows the pack's standard route. Through ComfyUI Manager: search "comfyui-mixlab-nodes," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/shadowcz007/comfyui-mixlab-nodes.git
cd comfyui-mixlab-nodes
install.bat
or pip3 install -r requirements.txt in a venv, or the embedded-python pip call for a portable build. Restart ComfyUI once it's done. There's no model download and no external dependency for this one - it's arithmetic, nothing more - so the only real troubleshooting is confirming the pack loaded at all. If Math Operation (or MultiplicationNode, if you're searching by class name) doesn't show up after install, check the ComfyUI startup console for an import error from the pack rather than assuming this specific node is broken; a node this simple essentially can't fail on its own once it's actually loaded.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| numberA | * | — | |
| multiply_by | FLOAT | 1.00-2–18446744073709550000 | — |
| add_by | FLOAT | 0.00-2000–18446744073709550000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |
| INT | INT | — |