ComfyUI Node

Int Equals

Making your graph branch on a number

By 2daadv·Created 6 months ago·Updated 21 days ago· 1
Int Equals
    • equals
    i
    equals0

    ComfyUI's graph is secretly a small program, and this is one of its if statements. Int Equals takes two integers and returns a BOOLEAN: true when they're equal, false otherwise. That boolean is the thing you feed into a switch, a router, or a gated node to make the workflow take different paths depending on what a number said. Without logic nodes like this one, the only branching ComfyUI has is you, sitting there, bypassing nodes by hand.

    The inputs are exactly what you'd guess from the name:

    • i - the integer being tested. This is the one you'd wire from a counter, a seed, an index, a step count.
    • equals - the value you're comparing against, default 0. Type a literal here, or wire another constant (this pack ships 0, 1, -1, … under Gadget/core/const).

    Output: a single BOOLEAN named equals. Wire it into an A/B switch, a True/False-gated node, or a boolean-driven workflow branch.

    Mechanically it's i == equals - nothing more, nothing hidden, and that's the appeal of a purpose-built node over hand-wiring. It's from 2daadv's ComfyUI-GadgetNodes pack (MIT, one developer, brand new, no community track record yet), part of the Gadget/logic family alongside Int Not Equals, the two Nearly Equals nodes, and ++1/--1. Install: ComfyUI Manager → search "GadgetNodes", or clone into custom_nodes/ and pip install -r requirements.txt, then restart.

    Where it earns its place:

    • Gate on a count. "If batch size equals 1, skip the batch-aware save node" - that's a real workflow shape, and this is the node that makes it a graph instead of a ritual.
    • Watchdog on a counter. You've got an ++1 incrementing a loop counter; when it hits a limit, you want the pipeline to stop or change. i == 10 gives you the trigger.
    • Seed or index parity. "Only branch when this seed equals this seed" is a niche but real debugging trick for reproducing exactly one case.

    The one trap to remember: this is strict equality. If you want "close enough" - a comparison that survives off-by-one drift - grab Int Nearly Equals from the same pack instead, which is true when the difference is within 1. And if you want the opposite branch, Int Not Equals is the sibling that returns true on inequality, so you don't have to add an inverter.

    There's no caching surprise here and no UI magic, so it behaves identically on the legacy canvas and Nodes 2.0. It's a two-input comparator; the power is in what you do with the boolean on the other end.

    CategoryGadget/logic

    Inputs (2)

    NameTypeDefaultDescription
    iINT
    equalsINT0

    Outputs (1)

    NameTypeDescription
    equalsBOOLEAN