ComfyUI Node

Max Float

Pick the bigger of two floats, no drama

By danipisca07·Created 6 months ago·Updated 6 months ago· 0
Max Float
    • FLOAT
    a0.00
    b0.00

    Some decisions in a workflow are just "take the larger one." Which of two computed strengths wins? What's the floor for a value that must not drop below the higher of two candidates? SL_MaxFloat is that decision, reduced to a node: two floats in, the larger one out.

    The mechanism is max(a, b) - Python's built-in, one line, no edge cases worth losing sleep over. If the values are equal, you get that value back (it doesn't matter which, they're identical). No rounding, no clamping, no hidden behavior. It compares and returns, full stop.

    This node is a building block more than a destination. On its own it's unexciting; wired into a chain it does real work:

    • Guarding against too-low values: max(value, minimum) is the classic "never let this drop below X" idiom - and since the minimum is a wired input, it can itself be computed, unlike a hardcoded clamp.
    • Picking the stronger of two signals: if two branches each produce a strength or quality score, take the max to decide which one governs.
    • Combined with SL_ClampFloat: clamp a value to a range, then use max to enforce an additional floor on top.

    Inputs and outputs:

    • a (FLOAT) - first candidate, default 0.0
    • b (FLOAT) - second candidate, default 0.0
    • Output: FLOAT - whichever of a and b is larger

    Installing it

    Part of ComfyUI-SimpleLogics. Manager → search "SimpleLogics" → install → restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/danipisca07/ComfyUI-SimpleLogics
    

    Restart, Add Node → search "Max Float" (menu group SimpleLogics/Math). Zero dependencies, no models to fetch.

    Gotchas

    • Defaults of 0.0 on both inputs - an unwired b silently compares against 0. If your values are legitimately negative, that default will quietly dominate. Wire both inputs deliberately.
    • It's a max, not a filter. There's no "top N" logic here; exactly two values in, the larger one out. For more values, chain two nodes.
    • FLOAT inputs accept INT wires, so you can feed this from an integer source without converting first - the result will still be a float.

    There's an integer twin (SL_MaxInt) that works identically on INT types. Between them, this is the one you'll reach for when the values being compared are continuous - strengths, weights, denoise - because those are the ones that actually need a dynamic floor.

    CategorySimpleLogics/Math

    Inputs (2)

    NameTypeDefaultDescription
    aFLOAT0.00
    bFLOAT0.00

    Outputs (1)

    NameTypeDescription
    FLOATFLOAT