Loop End 🪽
Collect every pass of a loop into one output
- flow
- result1
- result2
- results1
- results2
Loop End 🪽 is where a ComfyAngel loop stops being a series of repeated passes and becomes a pile of results. It sits at the bottom of your loop, takes the flow wire from Loop Start, and accumulates whatever you tell it to collect from each iteration into a single output. If Loop Start is the front door, this is the check-out counter.
The inputs that matter
Only one input is required: flow, which must come from a Loop Start (the node checks and throws "flow must be connected from Loop Start node" if you wire it to anything else). Then there are two optional collectors:
result1- the main thing you want gathered each pass. Images, masks, strings, whatever.result2- a second stream, handy when you want both images and their captions out of the same loop.
Each has a matching output, results1 and results2. So the shape of a loop is: Start → (stuff with item) → feed the per-iteration output into result1 → End hands you all of them back as one value.
How accumulation behaves
The rule (from the pack's Accumulate helper, which Loop End drives): tensors get concatenated into a batch, everything else becomes a Python list. Four images come out as one (4, H, W, C) tensor; four strings come out as a list of four strings. Two caveats ride along with that. First, if your per-iteration images are different sizes, concat can't happen and you get a list of tensors instead of a batch - so keep resolutions consistent inside the loop. Second, the loop accumulates in memory the whole time; long loops over big images eat RAM.
One genuinely nice touch from v0.6.0: Loop End now executes even when nothing is connected to its result outputs (it's an output node). Previously you had to hang a node off results1 or the loop wouldn't run at all - a classic "why is my loop dead" moment. That's fixed; a loop with a Save Image inside runs to completion with nothing attached to Loop End.
How it works
Loop End is the clever one. On each pass it uses ComfyUI's dynamic graph machinery to rebuild the middle of your loop, bump the index, and re-enter - effectively a while-loop that recurses until the index reaches the batch's length. The flow input carries the packed state (current index, accumulated values) that makes that recursion possible. It needs a modern ComfyUI with the comfy_execution module; on older builds it raises a RuntimeError rather than failing quietly.
Installing it
Same pack, same steps:
cd ComfyUI/custom_nodes
git clone https://github.com/ThepExcel/ComfyAngel.git
Restart ComfyUI, or install "ComfyAngel" via ComfyUI Manager. Pillow is the only dependency - no models, no extra downloads.
The trap to remember
"Everything accumulates in memory" is the honest price of a true loop. For 5–50 items it's the nicest batch tool in the pack; for thousands, the README's own advice is to drop to Split Image Batch with Auto Queue so each pass is its own run. Pick your tool by batch size and you'll never be surprised.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| flow | FLOW_CONTROL | — | |
| result1opt | * | — | |
| result2opt | * | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| results1 | * | — |
| results2 | * | — |