Nodes/ComfyUI Logic Support/Number Condition Checker
ComfyUI Node

Number Condition Checker

The Number Condition Checker gate

By narusas·Created about a year ago·Updated about a year ago· 0
Number Condition Checker
    • B
    lower_value0
    lower_op<=
    number5
    upper_op<
    upper_value10

    You've got a number - a seed, a batch index, a detected value - and you want the graph to do one thing if it's inside a range and something else if it isn't. That's the whole job of Number Condition Checker. It takes one number, checks it against a lower and an upper bound, and answers with a single BOOLEAN (true/false). It's the simplest node in the ComfyUI Logic Support pack, and honestly it's the one you'll reach for first, because gates are how you stop hard-coding decisions into your workflow.

    Everything about it is a bounds test. You feed in number, and the node asks two questions: is it past the lower bound, and is it under the upper bound? Each side has an operator that can be NONE, <, or <=. Set an operator to NONE and that side of the check is skipped entirely - which is how you turn a two-sided range check into a single "is this at least X" or "is this at most Y" test. It only returns true if all the active conditions pass, and the defaults are set up as a live example: 0 <= 5 < 10, which evaluates to true the moment you drop the node in.

    The inputs that matter:

    • number - the value being tested. Note it's an INT, so a float from some computed node won't plug straight in; round or int-convert it first.
    • lower_value / lower_op - the bottom of the window. lower_op of NONE ignores the lower side.
    • upper_value / upper_op - the top of the window. NONE ignores it.

    Out the other side comes one BOOLEAN output. Wire it into anything that consumes a boolean - a switch node, a conditional router, a gate that only runs a sampler branch when the condition holds.

    Where people get burned: forgetting that both sides default to an active check. Set lower_op to NONE and upper_op to NONE at the same time and every number passes - there's literally nothing left to test. And if you're checking a value produced by arithmetic, remember the INT thing; a fractional result silently needs converting before it'll connect.

    Install is one command, same as every node in this pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/narusas/Comfyui-Logic-Support
    

    Then restart ComfyUI (or refresh the browser tab). Easier still, ComfyUI Manager has it - search for "ComfyUI Logic Support." The whole pack is pure Python with zero dependencies and no model downloads, so this install can't start a dependency war the way so many node packs do. It's MIT-licensed, maintained by a single author (narusas), and has essentially no community footprint yet - a small utility pack you'll probably never see praised on Reddit, which is fine; gates don't need fame.

    CategoryLogic-Support

    Inputs (5)

    NameTypeDefaultDescription
    lower_valueINT0
    lower_opCOMBO<=3 options: NONE, <, <=
    numberINT5
    upper_opCOMBO<3 options: NONE, <, <=
    upper_valueINT10

    Outputs (1)

    NameTypeDescription
    BBOOLEAN