ComfyUI Node Runs on cloud

Multiply

A × B for driving dimensions off one value

By Derfuu·Created 3 years ago·Updated 2 years ago· 455
Multiply
    • FLOAT
    Value_A1.00
    Value_B1.00

    DF_Multiply multiplies two numbers, A × B, and outputs a float. It's the most-used node in a Derfuu math chain, because "scale this by that" is the single most common thing you do to a dimension: take a base width and multiply by a factor to get the upscaled width, take a strength and multiply by a weight, take a ratio and apply it. Nothing fancy - but it's the node that turns one driver value into many derived ones.

    How it works

    It computes Value_A × Value_B and returns the product as a FLOAT. Both inputs are floats, so results carry decimals - round with Ceil, Floor, or Integer when you need a whole-number pixel size.

    The inputs and outputs that matter

    • Value_A (FLOAT, default 1) - the first factor.
    • Value_B (FLOAT, default 1) - the second. With both at the default 1 the node is a pass-through, so a fresh drop does nothing until you set a factor.
    • Output: FLOAT - the product, wired onward.

    Where it fits

    The canonical pattern: one DF_Float holds your scale factor (say 1.5), and you multiply your base width by it and your base height by it, so both dimensions scale together from a single number. Change the 1.5 and the whole output resizes while keeping aspect ratio. Chain it with Divide to convert between image and latent scales (that factor of 8), and finish on Integer so the sampler gets clean pixel dimensions. This is the beating heart of "automate calculation depending on image sizes," which is exactly what Derfuu built the pack to do.

    How to install it

    ComfyUI Manager: search Derfuu_ComfyUI_ModdedNodes, install, restart. By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Derfuu/Derfuu_ComfyUI_ModdedNodes
    

    then restart. No dependencies, no models - plain Python.

    Common issues & troubleshooting

    The result isn't a whole number. Multiplication outputs a float. For pixel dimensions, follow with Ceil, Floor, or Integer - and keep in mind many models want sizes divisible by 8 or 64, so a clean multiply can still produce an invalid dimension.

    Multiplying by zero. If either factor computes to 0, the output is 0 and everything downstream collapses. Watch computed factors that can hit zero.

    You wanted addition, not multiplication. This pack has separate nodes for sum/subtract; DF_Multiply only multiplies.

    Do you need it? Plenty of packs (and increasingly native tooling) offer basic math now. DF_Multiply sticks around mostly because old workflows depend on it - for a new graph, use whatever math nodes you already trust.

    Missing/red in an inherited workflow. Derfuu has deleted deprecated nodes on updates rather than keeping them, so old graphs can point at gone names - reconnect a current copy. A ModuleNotFoundError about Derfuu_ComfyUI_ModdedNodes_legacy means a duplicated folder; keep one named Derfuu_ComfyUI_ModdedNodes.

    CategoryDerfuu_Nodes/Math

    Inputs (2)

    NameTypeDefaultDescription
    Value_AFLOAT1.00
    Value_BFLOAT1.00

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT