ComfyUI Node

Ard Math

Four operations, two outputs, and a note about the one called 'integer'

By ArdeniusAI·Created 2 years ago·Updated 2 years ago· 5
Ard Math
    • result_integer
    • result_float
    Ix1.0000
    Iy1.0000
    operationdivide

    Ard Math is this pack's arithmetic node: two float inputs, one of four operations, and two outputs - the result as an integer and as a float. It's the "simple math operations" box the pack's docs promise, and it's the node you'd use to compute a scale factor, split a dimension, or offset a value inside the author's workflows.

    The inputs: Ix and Iy (both FLOAT, 0.1 to 9,999,999), and operation, a dropdown with multiply, divide, subtract, and add (default divide, which is a slightly odd default - change it before you expect multiply). The tooltip makes the type convention explicit: "input float if you want to input integer use ARD integer to float node." So the intended flow is integer → Ard Integer To Float → Ard Math, keeping everything in float land.

    The two outputs are where you need to be careful:

    • result_float - the exact float result. This is the accurate one.
    • result_integer - the same result passed through int(), which truncates toward zero rather than rounding. 7.9 becomes 7, -2.3 becomes -2. If you need rounding, do it yourself.

    Everything is computed in float, then the integer output is derived from the float result, so the two outputs always agree except for the truncation.

    Gotchas grounded in the actual behavior:

    • Division by zero doesn't crash - the whole operation is wrapped in a try/except that prints ARD math: check inputs ERROR and returns (0, 0.0). You'll get zeros and a console message, not a crash. Good to know if you're feeding computed denominators.
    • The widgets bottom out at 0.1. You can't type 0 into either input widget - the min is 0.1. That's a real limitation if you wanted to compute with zero, and it's why the author's math workflows usually feed values in from other nodes rather than typing them.
    • If you wire in a non-numeric value, the node prints "inputs need to be either integer or float" and returns zeros.

    Honest verdict: ComfyUI's core "Math Expression" node is strictly more capable (arbitrary expressions, more operators). Ard Math wins on nothing except simplicity and the convenient dual int/float outputs - and having both means you rarely need a separate type conversion after arithmetic. It's a fine, boring utility node; if you're building in this pack's named-boxes style it fits right in, and if you need real math, use the built-in.

    Install is the standard pack route - ComfyUI Manager → search ComfyUI-Ardenius, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ArdeniusAI/ComfyUI-Ardenius
    

    then restart ComfyUI. Pack-wide notes: civitai and moviepy install with the pack (nothing to do with arithmetic), and a single import error at startup is the Save Image node wanting comfyui_controlnet_aux - the rest of the pack loads.

    CategoryArdenius

    Inputs (3)

    NameTypeDefaultDescription
    IxFLOAT1.00000.1–9999999input float if you want to input integer use ARD integer to float node
    IyFLOAT1.00000.1–9999999input float if you want to input integer use ARD integer to float node
    operationCOMBOdividepick math operation

    Outputs (2)

    NameTypeDescription
    result_integerINT
    result_floatFLOAT