InnerIntCompare
InnerIntCompare – ComfyUI Node
- boolean
What it is
InnerIntCompare is exactly what the "Inner" prefix in this pack's logic nodes signals: a small building block meant to live inside a loop, not a general-purpose comparison tool you'd sprinkle everywhere. Feed it two integers and pick an operator, and it gives you back a boolean - the classic ingredient for a loop's "should I keep going" condition. Has this counter reached the batch size yet? Is this index still less than the list length? That's the shape of question this node exists to answer.
ComfyUI's graph model wasn't originally built with loops and conditionals as first-class citizens - a fair complaint that comes up regularly in the community, describing them as still fundamentally a workaround years into the project. Small comparison and math nodes like this one are exactly the kind of scaffolding that patches that gap: instead of a native for or while construct, you get a loop-open node, a condition check like this one, and a loop-close node that carries state around, all wired together by hand.
How it works
Straightforward integer comparison. Pick comparison from the six standard operators, evaluate a against b, and get a boolean back. No surprises in the mechanism - the value is in having it as a droppable node rather than needing a scripting node for something this simple.
Inputs and outputs
a(INT, default 0) - left-hand value.b(INT, default 0) - right-hand value.comparison(enum, defaulta == b; choices:a == b,a != b,a < b,a > b,a <= b,a >= b) - the operator to apply.
One output: boolean (BOOLEAN) - the result of a <comparison> b.
Installing it
Bundled in comfyui-easyapi-nodes. ComfyUI Manager: search "comfyui-easyapi-nodes", install, restart ComfyUI. Manual install:
cd ComfyUI/custom_nodes
git clone https://github.com/lldacing/comfyui-easyapi-nodes.git
cd comfyui-easyapi-nodes
pip install -r requirements.txt
Pure Python comparison, no special dependency - but run the requirements install anyway so the rest of the pack (some of which has real dependencies) doesn't half-fail to load. git pull in the folder to upgrade.
Common issues
"My loop runs one too many or one too few times." Classic off-by-one, and it's almost always in which comparison operator you picked, not a bug in the node. < versus <= against a length or a max index is the exact place this bites people - if you're comparing a zero-based index against a count from GetImageBatchSize, you generally want <, not <=, or you'll try to read one element past the end.
"The condition never flips, so my loop never stops." Check that whatever's supposed to be changing a or b between iterations (usually a counter fed through InnerIntMathOperation, incrementing each pass) is actually wired into the loop's carried state correctly via InnerLoopClose. A very common mistake in hand-built loops like this is wiring the initial value of a counter into the comparison on every iteration instead of the updated one, which makes the condition permanently true or permanently false.
"Why not just use a generic 'Compare' node from another pack?" You can, if one's already installed and does the same job - this node's whole reason to exist is being bundled with the rest of this pack's loop-construction nodes (ForEachOpen, InnerLoopClose, InnerIntMathOperation) so you're not pulling in a separate logic pack just to build a for-each loop.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| a | INT | 0 | — |
| b | INT | 0 | — |
| comparison | COMBO | a == b | 6 options: a == b, a != b, a < b, a > b, a <= b, a >= b |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| boolean | BOOLEAN | — |