ComfyUI Node

Integer Multiply

Multiply two integers in your ComfyUI graph

By jamesWalker55·Created 3 years ago·Updated about a year ago· 215
Integer Multiply
    • INT
    a0
    b0

    JWIntegerMul multiplies two integers and gives you back an integer. a * b, whole numbers in, whole number out. It's the integer twin of JWFloatMul, and the integer type is exactly why you'd pick it over the float version.

    A lot of ComfyUI inputs demand a true integer, not a float that happens to look round - frame counts, batch sizes, pixel dimensions, step counts, tile counts. Feed one of those a 12.0 and some nodes complain. JWIntegerMul keeps the math in integer-land the whole way through, so the number that comes out is the right type for those slots, no conversion node needed.

    The classic use is dimensions and frames. Multiply a base tile size by a count. Work out total frames as clips × frames-per-clip. Scale a batch count. Compute a resolution as a base times a multiplier and hand it straight to an empty-latent or resize node. Because it's wired rather than typed by hand, changing the base ripples through automatically.

    What it actually does

    a times b, both INT, one INT out. Both default to 0. The range here is genuinely enormous - roughly ±1.8e19, which is the span of a 64-bit integer - so you will never bump the limit with anything sane. Multiplication is exact; there's no floating-point fuzz because everything stays a whole number.

    The inputs and outputs that matter

    Two required inputs, one output:

    • a - first factor (INT).
    • b - second factor (INT).

    Output: a single INT equal to a * b. Wire it into anything that wants an integer - an empty latent's width/height, a batch size, a frame count.

    How to install it

    Pack is jamesWalker55/comfyui-various. Via ComfyUI Manager, search Various ComfyUI Nodes by Type, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jamesWalker55/comfyui-various
    

    then restart. No dependencies. If you only want the math nodes, the author's suggested approach is to drop the single comfyui_primitive_ops.py file into custom_nodes/ - it contains all the Integer and Float nodes and nothing else, keeping your node menu tidy.

    Common issues & troubleshooting

    Float vs. int matters more than you'd think. If a downstream node is throwing a type error about expecting an integer, make sure you're using this node and not JWFloatMul upstream. And if you multiplied two integers but need a float afterward (say for a denoise value), you'll want the pack's integer-to-float conversion node in between - JWIntegerMul will only ever hand you a whole number.

    Zero default. Both inputs start at 0, so an untouched node outputs 0. If your result is stuck at zero, one input isn't set.

    CategoryjamesWalker55

    Inputs (2)

    NameTypeDefaultDescription
    aINT0-18446744073709550000–18446744073709550000
    bINT0-18446744073709550000–18446744073709550000

    Outputs (1)

    NameTypeDescription
    INTINT