Nodes/ComfyUI_MieNodes/Mie Loop Finalize JSON List ๐Ÿ‘
ComfyUI Node

Mie Loop Finalize JSON List ๐Ÿ‘

Pull the collected records out of the loop

By MieMieeeeeยทCreated 2 years agoยทUpdated 28 days agoยท 225
Mie Loop Finalize JSON List ๐Ÿ‘
  • loop_ctx
  • json_list
โ—„doneโ€”โ–บ

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.

Category๐Ÿ‘ MieNodes/๐Ÿ‘ Loop

Inputs (2)

NameTypeDefaultDescription
loop_ctxMIE_LOOP_CTXโ€”
doneBOOLEANโ€”

Outputs (1)

NameTypeDescription
json_listSTRINGโ€”