Nodes/ComfyUiNodes/M Int Lt (a<b)
ComfyUI Node

M Int Lt (a<b)

Comparing numbers to drive a branch

By Madlumi·Created 8 months ago·Updated 8 months ago· 0
M Int Lt (a<b)
    • a_lt_b
    a0
    b0

    Strict inequality is the workhorse of real conditionals: "while this is still below the limit, keep going," "if the counter is under N, use the small batch." M Int Lt answers a < b and returns 1 if true, 0 if false - a plain INT, not a special boolean type. Output is named a_lt_b.

    The strength of outputting an integer is that it composes with everything else in the graph. The classic pattern is the frame threshold: frame < first_keyframe gives you 1 for every frame before the keyframe and 0 after, which you can multiply against a branch's strength to fade a prompt in. Or wire it into a switch's selector to flip between two configurations at a boundary. Since 1/0 doubles as a multiplier, "below threshold" becomes arithmetic instead of a control-flow ceremony.

    The standard gotcha with strict < vs <= is the boundary: at exactly the limit, a < b is false and a <= b (the pack's M Int Le) is true. If your loop is supposed to include the final step, you want <=; if it's exclusive, you want this node. Getting that off-by-one wrong is the classic silent bug in frame and loop logic - worth deciding deliberately rather than discovering.

    Inputs a and b are signed 32-bit INT, defaults 0. Exact integer comparison, no float weirdness. And like the rest of the pack's comparisons, there's no "greater than" node - swap the operands of a < b and you have b > a. That's not a missing feature, it's the design: a handful of primitives that compose into everything.

    It ships in ComfyUiNodes (repo Madlumi/ComfyUiNodes, author "Madanie"), a small personal pack of integer math, string helpers, and workflow-glue nodes. Install via ComfyUI Manager - search "ComfyUiNodes" - or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Madlumi/ComfyUiNodes
    

    Restart ComfyUI after that. No pip requirements or model downloads. It's under Add Node → mnodes → int.

    If you're building keyframed or looped workflows, this node is the difference between "the graph knows" and "you remember." Use it, and pick the strict vs non-strict variant on purpose.

    Categorymnodes/int

    Inputs (2)

    NameTypeDefaultDescription
    aINT0-2147483648–2147483647
    bINT0-2147483648–2147483647

    Outputs (1)

    NameTypeDescription
    a_lt_bINT