Nodes/Comfyui_TextBatch_aidec/IF Match Condition
ComfyUI Node

IF Match Condition

Compare two numbers, get a true/false out

By aidec·Created 2 years ago·Updated 9 months ago· 19
IF Match Condition
    • result
    • status
    value_a0.00
    operator==
    value_b0.00
    int_a0
    int_b0
    use_intfalse

    IF Match Condition is a comparison node, plain and simple: give it two numbers and an operator, get back a boolean. Is A equal to B? Greater than? Less than or equal? It's the "did this condition hold" building block you'd use to make a batch branch - do one thing on the last iteration, skip an item when the index hits a certain value, gate a step on a count.

    In aidec's pack, where loops are queue counters marching an index upward, a comparison node is the natural companion: wire the counter into A, your threshold into B, and the boolean out tells the rest of the graph when something special should happen. It's one of the pack's experimental extras (the README documents the queue and loader nodes and calls the rest test pieces), but comparison is about as unambiguous as a node gets, so there's not much to trip over.

    How it works

    It compares value_a against value_b using the chosen operator and emits result as a boolean. By default it works in floating point, which is fine for most comparisons; if you're comparing integers and want to avoid any floating-point fuzziness, there's an integer path you switch on explicitly.

    The inputs that matter

    • value_a / value_b - the two numbers to compare (floats by default).
    • operator - one of ==, !=, >, >=, <, <=. This is the comparison itself.
    • int_a / int_b (optional) - integer versions of the two values.
    • use_int (optional) - flip this on to compare int_a/int_b as integers instead of the float inputs. Worth using when you're comparing counters or indices, where exact integer equality matters and 1.0000001 == 1 surprises are unwelcome.

    Outputs: result (the boolean) and status. Route result into whatever consumes a true/false - a switch, a bypass toggle, another node's boolean input.

    Installing it

    cd ComfyUI/custom_nodes && git clone https://github.com/aidec/Comfyui_TextBatch_aidec, then restart ComfyUI (or ComfyUI Manager → Install via Git URL). No models, no heavy dependencies. Category: TextBatch.

    Where people get burned

    • Float equality is a classic trap. Comparing two floats with == can fail even when they "look" equal, because of tiny rounding differences. If you're checking whether an index equals a count, turn on use_int and compare integers - that's exactly what it's there for.
    • A boolean is only half a branch. This node produces the true/false; it doesn't act on it. You still need something downstream that consumes a boolean to actually change behavior - a switch or bypass node. On its own, IF Match Condition just reports.
    • Experimental tier. Light on docs and error handling like the rest of the extras - though comparison is simple enough that there's little to get wrong beyond the float gotcha above.

    Modest, but it's the piece that lets a batch make a yes/no decision. Pair it with the queue counter and something that acts on booleans, and you've got conditional logic in a workflow that otherwise just runs straight through.

    CategoryTextBatch

    Inputs (6)

    NameTypeDefaultDescription
    value_aFLOAT0.00-999999–999999
    operatorCOMBO==6 options: ==, !=, >, >=, <, <=
    value_bFLOAT0.00-999999–999999
    int_aoptINT0-999999–999999
    int_boptINT0-999999–999999
    use_intoptBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    resultBOOLEAN
    statusSTRING