ComfyUI Node

Float Divide

Divide two floats inside your ComfyUI graph

By jamesWalker55·Created 3 years ago·Updated about a year ago· 215
Float Divide
    • FLOAT
    a0.00
    b0.00

    You've got a number coming out of one node and you need it divided by something before it feeds the next one. That's the whole job. JWFloatDiv takes two floats, a and b, and hands you back a / b. No UI, no fuss, just a tiny calculator that lives in the graph instead of in your head.

    Why bother with a node for something a calculator does in a second? Because in ComfyUI a value that's wired is a value that stays correct. If a is driven by another node's output, the division re-runs every time that upstream number changes. You compute once, wire it, and stop babysitting it. That's the real pitch for the whole family of little math nodes in James Walker's pack - they turn "I'll just hardcode 0.75" into a live wire you can trace.

    What it actually does

    It's a divided by b, both as FLOAT, output as a single FLOAT. The default for both is 0, and the min/max are set absurdly wide (±1e17), so for any realistic value you'll never hit a ceiling. Think of the bounds as "effectively unlimited."

    Where you'd reach for it: turning a pixel dimension into a ratio (divide width by height for an aspect number), splitting a step budget, scaling a denoise strength down by some factor, or converting units before they hit a downstream node that wants a fraction. Anywhere you'd otherwise stop and do mental arithmetic, this keeps the math in the flow.

    The inputs and outputs that matter

    There are only two inputs and both are required:

    • a - the numerator (FLOAT).
    • b - the denominator (FLOAT).

    Output is one FLOAT (a / b). Wire it into whatever wants a float - a sampler's denoise, a resize factor, another math node in a chain.

    How to install it

    The pack is jamesWalker55/comfyui-various. Easiest path is ComfyUI Manager - open it, search the pack title Various ComfyUI Nodes by Type, install, restart. Manual works too:

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

    then restart ComfyUI. There are no extra dependencies for the math nodes - they're pure Python. One nice quirk of this pack: the author actually recommends not cloning the whole thing. Every group of nodes is its own comfyui_*.py file, and you can drop just comfyui_primitive_ops.py (where all the Float/Integer nodes live) into custom_nodes/ to avoid cluttering your node list with 60 nodes you'll never use. In a big ComfyUI install where every custom node adds to the pile, that restraint is genuinely thoughtful.

    Common issues & troubleshooting

    Divide by zero. If b is 0 - and remember 0 is the default - you'll get either an error or an inf/nan that quietly poisons everything downstream. If a run blows up right after this node, check that b is actually set to something.

    You might not need it at all. These one-operation nodes are the old-reliable approach. Newer packs give you a single math-expression node where you type a / b (or a whole formula) in one box instead of chaining four nodes. If you're doing a lot of arithmetic in a graph, a single expression node is tidier. JWFloatDiv wins on being dependency-free and dead obvious - nothing to learn, nothing to break.

    CategoryjamesWalker55

    Inputs (2)

    NameTypeDefaultDescription
    aFLOAT0.00-100000000000000000–100000000000000000
    bFLOAT0.00-100000000000000000–100000000000000000

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT