_Loop Add (internal)
_Loop Add (internal)
- INT
The underscore in the class name and the "(internal)" tag right there in the display name are the author telling you something: this isn't a node you're meant to go hunting for in the node browser for general use. What it does by itself is about as simple as a node can get - take two integers, a and b, add them, return the sum.
Why a node this trivial exists as its own thing. ComfyUI's graph has no native for-loop or while-loop primitive - there's no built-in "repeat this subgraph N times" construct in the base app. It's a well-known gap, and the workaround the community has converged on, independently and repeatedly, is to hand-build a loop out of ordinary nodes: an accumulator that increments each pass and feeds its own output back into itself, paired with a comparison node that decides when to stop. _LoopAdd is the increment half of exactly that pattern. Wire a running counter into a, a step size into b, and its output becomes next pass's counter - usually fed back around by a loop-control node from elsewhere in your graph, since this pack doesn't ship one itself.
Inputs and outputs. a and b, both integers, defaulting to 0 and 1 respectively. One output, typed INT, unlabeled beyond that. There's genuinely nothing more to the node than addition.
Its natural partner in this pack is _LoopLessThan, which is the "should we keep going" half of the same setup - check that node too if you're trying to piece together what pipeline this came from. Between the two of them you can see the whole shape of a homemade for-loop: a counter that grows by b every pass through _LoopAdd, and a check against a limit through _LoopLessThan, with the boolean result driving whatever gate node actually stops or continues the graph. Neither node knows anything about looping on its own - the loop only exists once something else wires them together in a cycle, which is why both are marked internal rather than being sold as a "loop" feature in their own right.
Installing it. Same pack, same install path as everything else here. Search comfyui-huyl2-nodes in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/huyl3-cpu/comfyui-sortlist
Restart ComfyUI.
Troubleshooting. If you found this node loose - outside whatever template workflow it was originally built into - the thing to understand is that it won't do anything useful on its own. It needs a loop-control node wired around it (something in the shape of Impact Pack's Loop nodes, or a hand-built "For Loop" implementation) to actually make the graph repeat; none of that machinery ships in this pack alongside it. Without that scaffolding, this node is just an adder, and there's no reason to reach for it over any generic Add node if that's all you need.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| a | INT | 0 | — |
| b | INT | 1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| INT | INT | — |