ComfyUI Node

Min Int

The 'never let steps exceed this' node

By danipisca07·Created 6 months ago·Updated 6 months ago· 0
Min Int
    • INT
    a0
    b0

    Min Int takes two integers, a and b, and returns whichever is smaller. Sounds almost too dumb to be a node, but once you've built a workflow where a step count, batch size, or image dimension is computed instead of typed, you'll find yourself wanting exactly this. It's the integer version of the pack's Min Float node, and it's one of those pieces you reach for constantly once it's installed.

    Why you'd reach for it

    The classic use is a safety cap on an integer that's being computed elsewhere. Imagine you have a math chain that produces a step count or a batch size, and you want to guarantee it never goes above what your GPU can stomach. Feed the computed value into one input, your hard limit into the other, and the output is the smaller of the two. min(steps, 20) is a one-node guardrail that would otherwise be a tangle of conditional logic.

    It also shows up in the seed-and-vary workflows people build for testing: pick the smaller of two batch sizes, cap a tile count, keep a width from exceeding a limit while letting the other input do the real work. Equal inputs just pass through, so there's no weird off-by-one behavior to remember.

    How it works

    Straight-up Python min(a, b) - no dependencies, no imports, no model files. The author's description is "Returns the smaller of two integers," and that's the entire spec. It lives in the SimpleLogics/Math category next to its float sibling and the pack's Clamp Int node, which is the version of this idea that also has a floor.

    The inputs that matter

    Both inputs are required, both are INT, and both default to 0:

    • a - first integer
    • b - second integer

    One INT output, which wires straight into anything that takes an integer - KSampler steps, batch_size, latent width and height, an Image Resize, whatever.

    Installing it

    Same story as every node in this pack: it comes from danipisca07/ComfyUI-SimpleLogics, a small pure-Python pack with no requirements.txt and nothing to download. Install via ComfyUI Manager (search "SimpleLogics") or:

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

    Then restart ComfyUI. That's it - no pip deps, no weights.

    Common issues

    Honestly? Not much. This is two inputs and a min() call. The one thing that trips people is confusing it with Min Float: the two are identical except for input type, and if you wire a float into an INT socket ComfyUI will auto-convert in a way that silently truncates. If your numbers keep coming out lower than expected, check that you grabbed the right Min node. And remember the repo also ships an unrelated GeoCalib camera node that the README doesn't document - ignore it unless you're importing photos into Blender. Keep the pack updated with git pull and you're done.

    CategorySimpleLogics/Math

    Inputs (2)

    NameTypeDefaultDescription
    aINT0
    bINT0

    Outputs (1)

    NameTypeDescription
    INTINT