Mie Loop Finalize JSON List ๐
Pull the collected records out of the loop
- loop_ctx
- json_list
The delivery end of a structured-data loop. After MieLoopCollectJSON has appended a record on each pass, MieLoopFinalizeJSONList reads the accumulated array out of the loop context and emits it as one JSON list.
Part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's utility pack, under the ๐ Loop submenu.
How it works
Finalize is Collect's counterpart. Each pass, a JSON object is appended to the accumulator inside the loop_ctx. Finalize waits for the loop to be over - signalled by MieLoopEnd's done output - and only then hands over the full array of records. That done gate is what stops it emitting an incomplete list mid-loop.
This is the node that turns a loop into a manifest: a run over N inputs becomes one array of N records, each carrying whatever fields you collected (prompt, seed, score, filename, settings). Save it, diff it, feed it into another workflow - you've got structured output instead of a wall of images with no metadata.
The inputs and outputs that matter
loop_ctx(MIE_LOOP_CTX) - the loop context carrying the collected records.done(BOOLEAN) - the completion signal from MieLoopEnd. The trigger; without it, Finalize doesn't know the loop finished.- Output
json_list(STRING) - the collected records as a JSON array string (e.g.[{"index": 0, ...}, {"index": 1, ...}]).
Like the text finalizer, the output is a single STRING containing the JSON array, not a native list of objects. That's ideal for saving to a file (pair it with the pack's SaveAnythingAsFile node) or handing to anything JSON-aware; if you need to iterate the records in-graph, parse the string first.
Installing it
ComfyUI Manager โ search ComfyUI-MieNodes โ install โ restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
then restart. No model downloads or heavy dependencies. Under ๐ MieNodes โ ๐ Loop.
Common issues
Nothing comes out. Check the done wire first - Finalize fires on MieLoopEnd's done and not before. Then check the loop_ctx chain runs unbroken from MieLoopCollectJSON to here.
The array has malformed entries. Garbage in, garbage out - if a pass collected invalid JSON in item_json, it shows up here. Validate the object at the collect step, not this one.
I wanted objects, not a string. The output is one STRING holding the array. Parse it downstream if you need to walk the records individually.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| loop_ctx | MIE_LOOP_CTX | โ | |
| done | BOOLEAN | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| json_list | STRING | โ |