Nodes/SeargeSDXL/Float Math
ComfyUI Node Runs on cloud

Float Math

A tiny float calculator node (deprecated)

By SeargeDP·Created 3 years ago·Updated 2 years ago· 874
Float Math
    • result
    opa * b + c
    a0.00
    b1.00
    c0.00

    This is a little calculator node. It takes up to three float inputs - a, b, c - and applies one of a handful of arithmetic operations, then outputs the result as a FLOAT. That's the whole thing. It's useful when you want one value in your workflow to be derived from another rather than typed in independently: compute a hires resolution as a multiple of the base, scale a strength off a shared factor, that kind of glue.

    Set expectations first, though: it lives in the pack's _deprecated_ category. It's there so older Searge workflows keep working, and in current ComfyUI you'd use a maintained math node from a general utility pack instead.

    How it works

    You pick an operation from the op dropdown and it plugs your inputs into that formula. The default is a * b + c - a multiply-and-add, which is genuinely handy (scale a by b, then offset by c). The other options are simpler: a + c, a - c, a * b, and a / b. So b acts as a multiplier/divisor and c as an additive offset, depending on which op you choose. The result comes straight out; there's no state, it just recomputes each run.

    The inputs and outputs that matter

    • op - the operation: a * b + c (default), a + c, a - c, a * b, or a / b.
    • a (default 0), b (default 1), c (default 0) - the three float operands. Which ones matter depends on the op you chose; in a + c, for instance, b is ignored.
    • Output result (FLOAT) - the computed value, ready to feed anywhere a float is wanted.

    How to install it

    Manager: search SeargeSDXL, install, restart. Manual, opencv dependency first:

    python -m pip install opencv-python
    cd ComfyUI/custom_nodes
    git clone https://github.com/SeargeDP/SeargeSDXL.git
    

    Restart ComfyUI. No model files.

    Common issues & troubleshooting

    Divide by zero. If you pick a / b and b is 0 (or comes in as 0 from an upstream node), you're asking for trouble. When you use the division op, make sure b can't be zero - remember its default is 1, which is safe, but a wired input could be anything.

    "My offset/multiplier did nothing." Check which op is selected. Each formula only uses some of the operands - a * b ignores c, a + c ignores b. If you set a value on an operand the current op doesn't reference, nothing happens. Match the operand to the formula.

    Reach for a current utility pack. This is a deprecated one-trick node. For arithmetic in a modern workflow, a maintained math/logic node (rgthree, ComfyUI's own primitives, or any of the math utility packs) does the same thing and keeps getting updates. Only use this if you're maintaining an existing Searge workflow that already relies on it.

    CategorySearge/_deprecated_/Floats

    Inputs (4)

    NameTypeDefaultDescription
    opCOMBOa * b + c5 options: a * b + c, a + c, a - c, a * b, a / b
    aFLOAT0.00
    bFLOAT1.00
    cFLOAT0.00

    Outputs (1)

    NameTypeDescription
    resultFLOAT