Multiply
Multiply two numbers inside your ComfyUI graph
- FLOAT
Multiplies two numbers and outputs the result. A × B. That's the node. It sounds trivial, and it is - but the reason you'd want it is that ComfyUI can't do math on a wire by itself. If you've read an image's width and want "60% of that," something has to actually compute it. This is that something.
It's a "Math" node in Derfuu_ComfyUI_ModdedNodes, a utility pack built around doing arithmetic on values as they move through the graph.
How it works
Two inputs, one output, all floats:
Value_A(FLOAT, default 1.0) - first operand.Value_B(FLOAT, default 1.0) - second operand.- Output
FLOAT- the product.
You can type numbers into the widgets, or - this is the useful bit - convert the widgets to inputs and wire other nodes into them. Feed a width from Get image size into Value_A and a ratio into Value_B, and the output is a dynamically computed size.
Where you'd actually reach for it
Size math, almost always. The canonical chain: Get image size → Multiply by 1.5 → Integer to round it back to a whole number → feed into an Empty Latent or a scaler. That builds a workflow that upscales relative to whatever it's given, instead of being hardcoded to one resolution. Multiply is the step in the middle that turns "this size" into "this size times a factor."
Both inputs are floats, so if you're piping in an integer you may need Int to float first to satisfy the type check. And if you want the whole result as an integer at the end, Integer does float→INT.
One honest note: the pack covers the basic operators (sum, subtract, multiply, divide, power, square root) as separate nodes. For anything more involved - a formula with several terms - the modern ecosystem has expression evaluators like rgthree's Power Puter that do it in one node instead of a chain of these. For a single multiply, though, this is perfectly fine and clear to read.
Common issues & troubleshooting
Type mismatch on an input. The ports are floats. Convert an incoming INT with Int to float if a wire won't connect.
Result is a decimal but the target wants a whole number. Downstream size/count inputs need INTs. Cap the chain with an Integer node to convert.
Node red / missing after an update. Derfuu has removed old node classes on pack reorganizations rather than deprecating them, which can break saved graphs. Update via Manager and re-add.
ModuleNotFoundError: No module named 'custom_nodes.Derfuu_ComfyUI_ModdedNodes'. Old workflow, moved module path. Update the pack, reload, replace the node.
Install: ComfyUI Manager → search "Derfuu" → install → restart, or cd ComfyUI/custom_nodes && git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes then restart. No models, no heavy dependencies.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| Value_A | FLOAT | 1.00 | — |
| Value_B | FLOAT | 1.00 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| FLOAT | FLOAT | — |