Repeat (Close)
The bottom half of a counted loop that really iterates
- flow
- value_0
- value_1
- value_2
- value_3
- value_4
- value_5
- value_6
- value_7
- value_8
- value_9
- value_10
- value_11
- value_12
- value_13
- value_14
- value_15
- value_16
- value_17
- value_18
- value_19
- value_0
- value_1
- value_2
- value_3
- value_4
- value_5
- value_6
- value_7
- value_8
- value_9
- value_10
- value_11
- value_12
- value_13
- value_14
- value_15
- value_16
- value_17
- value_18
- value_19
Repeat (Close) is the other half of the pack's counted loop, and on its own it does nothing you'd ever wire up by hand - you're meant to let the 🔗 Add / link Close button on Repeat (Open) create it for you. So think of this page as "what the Close node is doing while your loop runs," because that's where the interesting machinery lives.
What it does
You wire the matching Open's flow into Close's flow input and its index output into Close's index input (the Auto-pair button does both), then feed your per-iteration state into the wildcard value_* inputs. Each pass, Close checks the count:
- If the current iteration is still below
counton the Open node, it expands the graph: it clones the whole loop body - every node feeding Close, plus the Open node itself - into a fresh subgraph, advances the Open's carried state (loop_indexand thevalue_*slots) to the next iteration, and wires the clone's results back into a copy of itself. One queue run executes the whole loop. - Once
indexreachescount, it stops expanding and hands the finalvalue_*state downstream.
That's the entire contract: Close is the loop's "is there another pass?" check plus the graph-expansion engine, all in one node. It's a stateful loop with feedback - iteration N's output becomes iteration N+1's input - which is different from For Each, where each element is independent.
The inputs that matter
There are only two required: flow (the internal link that identifies which Open this Close belongs to) and index (which iteration we're on - wire it from Open's index output). The value_0..value_19 inputs are the carried state, and they're wildcard: images, latents, strings, lists, whatever your loop body needs to thread forward. Outputs mirror the inputs - the final state after count passes.
Two gotchas that bite people
count on the Open node must stay a widget value, not a wired input - it's read when the loop expands, before execution, so a dynamic count won't work. And keep in mind every pass clones the body: the graph you see in the editor is a template, not the executed graph, so a 100-iteration loop is 100 copies of your body stitched together. It works, but it's why the tooltip warns to keep count sane - and why the pack's own docs call a runaway loop "a polite way to burn an afternoon."
Installing it
Same pack, same story: ComfyUI Manager → search "Kinburg-Nodes", or git clone https://github.com/Kinburg/Kinburg-Nodes into ComfyUI/custom_nodes, restart. No dependencies. If the Close node ever seems to do nothing, check the wiring of flow and index - a Close without its Open's flow is a node with no loop to close.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| flow | KINBURG_LOOP_FLOW | — | |
| index | INT | Wire the matching Repeat (Open)'s 'index' output here (the Auto-pair button does this for you). | |
| value_0opt | * | — | |
| value_1opt | * | — | |
| value_2opt | * | — | |
| value_3opt | * | — | |
| value_4opt | * | — | |
| value_5opt | * | — | |
| value_6opt | * | — | |
| value_7opt | * | — | |
| value_8opt | * | — | |
| value_9opt | * | — | |
| value_10opt | * | — | |
| value_11opt | * | — | |
| value_12opt | * | — | |
| value_13opt | * | — | |
| value_14opt | * | — | |
| value_15opt | * | — | |
| value_16opt | * | — | |
| value_17opt | * | — | |
| value_18opt | * | — | |
| value_19opt | * | — |
Outputs (20)
| Name | Type | Description |
|---|---|---|
| value_0 | * | — |
| value_1 | * | — |
| value_2 | * | — |
| value_3 | * | — |
| value_4 | * | — |
| value_5 | * | — |
| value_6 | * | — |
| value_7 | * | — |
| value_8 | * | — |
| value_9 | * | — |
| value_10 | * | — |
| value_11 | * | — |
| value_12 | * | — |
| value_13 | * | — |
| value_14 | * | — |
| value_15 | * | — |
| value_16 | * | — |
| value_17 | * | — |
| value_18 | * | — |
| value_19 | * | — |