Nodes/Vantage-NodesV2/VantageLoopIteration
ComfyUI Node

VantageLoopIteration

The hidden node your loop turns into

By vantagewithai·Created 15 days ago·Updated 11 days ago· 3
VantageLoopIteration
  • initial_value
  • flow
  • index
  • value
◄kind▾►
◄index—►
◄total—►

The README is blunt about this one: "VantageLoopIteration is an internal execution helper. It is not intended for manual placement." If you found this page by seeing the name in an error message or a console log, that's the correct amount of alarm - none.

What it is

When you run a For or While loop from this pack, the loop doesn't execute in place. The End node walks the dependency path between Start and itself, copies those nodes into a fresh graph, and hands the engine that new graph to run. In the copy, your Start node is replaced by a VantageLoopIteration node carrying the iteration state.

That's the node. Same three outputs as Start - flow, index, value - so everything wired downstream keeps working, but with index set to the current pass and value set to the carried value from the previous one.

Its inputs are the bookkeeping: kind is an enum of for or while, index and total are exactly what they sound like, and initial_value is the value to carry into this pass. All of it is filled in by the expansion machinery, not by you. It lives in the Vantage/Loops/Internal category - which is the author's way of saying "visible because ComfyUI lists every registered class, not because you should drag it."

Why you'd ever care

Two real reasons, both diagnostic.

You saw it in a traceback or log. That's normal. Every iteration of a loop is a graph expansion, and the expanded graph legitimately contains this node. Seeing it in the execution list means the loop is doing what it said on the tin, not that your workflow has sprouted something.

You want to know what the expansion costs. Each pass is a full copy of the body's dependency path, submitted as its own graph. That's why the pack's docs keep repeating the rule about side effects: nodes outside the Start→End path aren't in the copy, so they don't run again. And it's why a loop over an expensive body behaves like queuing that body N times, because that's roughly what it is.

What happens if you place one manually

It runs once and passes values through. flow carries your kind/index/total, initial_value becomes value, index is whatever you typed. There's no loop, because the loop is the expansion - a single copy of one iteration isn't an iteration.

Worse, it doesn't participate in the closure check the End node does, so it quietly gives you a graph that looks like a loop and behaves like a stub. If you're wiring loops, put Start and End on the canvas and let the pack do the copying.

  • For Loop Start - fixed pass count, total decides. Simpler, and where I'd start.
  • While Loop End / While Loop Start - data-dependent exit; more powerful, easier to get wrong.
  • Both pairs share this mechanism, so both share the caveats: only the dependency path repeats, the two halves must be matched by kind, and body caching can bite if inputs don't change between passes.

Install

You don't install this node separately - it arrives with the pack. If it's missing, the pack isn't loading:

cd ComfyUI/custom_nodes
git clone https://github.com/vantagewithai/Vantage-NodesV2.git

Restart ComfyUI and hard-refresh the browser. ComfyUI Manager should also carry the pack as Vantage-NodesV2. There's no requirements file and no declared dependency, but the pack does need a recent ComfyUI with graph expansion support - without it, loops.py can't build the copies and you'll get expansion errors at execution, not import errors at startup.

Troubleshooting

If a loop complains that its End isn't connected to a matching Start, the closure the expansion computed didn't include the right pair - check that flow goes Start → End and nothing else, and that the two halves are the same loop type.

If the loop body seems to run without effect, revisit what End's value depends on. Anything outside that path is a one-time node, not a repeated one.

And if you upgraded the pack and the loop nodes behave oddly, create fresh Start/End instances rather than reusing saved ones - ComfyUI keeps the input schema a node was created with.

CategoryVantage/Loops/Internal

Inputs (4)

NameTypeDefaultDescription
kindCOMBO2 options: for, while
indexINT—
totalINT—
initial_valueopt*—

Outputs (3)

NameTypeDescription
flowVANTAGE_LOOP—
indexINT—
value*—