Nodes/comfyui-huyl2-nodes/Simple For Loop End A100
ComfyUI Node

Simple For Loop End A100

Closing the loop you opened with Start

By huyl3-cpu·Created 9 months ago·Updated 4 months ago· 1
Simple For Loop End A100
  • flow
  • initial_value1
  • initial_value2
  • initial_value3
  • initial_value4
  • value1
  • value2
  • value3
  • value4

This is the closing half of this pack's for-loop pair - see SimpleForLoopStart for the full mechanism. Everything your loop body does eventually wires into this node, and connecting its output back to Start's flow input is what actually tells ComfyUI's executor to repeat the nodes in between rather than run them once and stop.

How it fits together

ComfyUI's graph executor doesn't natively support looping - a matched Start/End pair connected by a special FLOW_CONTROL wire is the workaround this pack (and a few others in the wider ecosystem) uses. SimpleForLoopStart sets the iteration count and kicks things off; this node is where the loop body's output lands each pass, and it passes the current running state (value1value4) back so the next iteration - or whatever reads the final result after the loop finishes - has the latest values.

Inputs and outputs

  • flow (FLOW_CONTROL, required) - must trace back to a SimpleForLoopStart node.
  • initial_value1initial_value4 (optional, wildcard) - this iteration's values, typically wired from whatever your loop body just produced.
  • Outputs: value1value4 (wildcard) - fed back into Start for the next pass, or read downstream once the loop has run its full total iterations.

Installing it

Same install as its partner node - no models or extra dependencies mentioned in the README:

cd ComfyUI/custom_nodes
git clone https://github.com/huyl3-cpu/comfyui-sortlist.git

Restart ComfyUI afterward.

Common issues and troubleshooting

This node is dead weight without a matching SimpleForLoopStart. They only work as a pair - dropping just this one into a graph, disconnected from a Start node, doesn't loop anything.

"A100" in the name is leftover naming, not a requirement. Same as its partner node: this is pure control-flow logic that never touches the GPU. It's almost certainly a holdover from whatever Colab GPU tier the author was using when this was built, not a hint about hardware needs.

Check the actual wire, not just node placement. If your loop body's output doesn't genuinely connect back into this node's flow input, ComfyUI just runs the subgraph once, like any normal chain of nodes - the whole point of using this pair is lost silently, with no error telling you the loop didn't actually loop.

Only four values survive between iterations. If your loop needs to track more state than that, pack extra data into one of the four slots (a list or dict works fine as a single value) rather than expecting a fifth slot to appear.

Categorycomfyui-sortlist/flow

Inputs (5)

NameTypeDefaultDescription
flowFLOW_CONTROL
initial_value1opt*
initial_value2opt*
initial_value3opt*
initial_value4opt*

Outputs (4)

NameTypeDescription
value1*
value2*
value3*
value4*