Mie Loop Collect Text ๐
Gather a string per loop pass into a list
- loop_ctx
- loop_ctx
The text-collecting member of the loop family. MieLoopCollectText appends one string per iteration into the loop context, building a list you pull out at the end with MieLoopFinalizeTextList.
Part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's utility pack, under the ๐ Loop submenu.
Why you'd reach for it
Loops that produce text are more common than you'd think. You might be running a prompt through an LLM node once per input and wanting to keep every response; captioning a batch of images and gathering the captions; generating filename variants; or logging what each pass decided so you can inspect the run afterward. MieLoopCollectText is the "add this pass's string to the pile" step for all of those.
How it works
Each iteration you hand it a string, and it appends that string to the accumulator inside the loop_ctx. The context flows onward and the list grows pass by pass. When MieLoopEnd reports done, MieLoopFinalizeTextList reads that accumulator and emits the collected strings (as a JSON array of text). Collect appends; Finalize hands over the whole list.
The inputs and outputs that matter
loop_ctx(MIE_LOOP_CTX) - the loop context.text(STRING, default empty) - this iteration's string to collect. Wire in whatever text the pass produced - an LLM response, a caption, a generated line.- Output
loop_ctx- the context with this string added, passed onward.
Simple and light - no disk-offload options here, because text is cheap to hold in memory even over long loops.
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
Empty list at the end. The strings live in the loop_ctx. If the context chain breaks between Collect and MieLoopFinalizeTextList, you finalize an empty list. Keep loop_ctx threaded through.
Blank entries in the list. The default text is an empty string. If a pass doesn't wire anything into text, it collects an empty entry. Make sure each iteration actually feeds this node the string you meant to keep.
I need structured objects, not flat strings. If each pass produces key/value data rather than a plain line, use MieLoopCollectJSON instead - it keeps the structure so you can work with it after the loop.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| loop_ctx | MIE_LOOP_CTX | โ | |
| text | STRING | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| loop_ctx | MIE_LOOP_CTX | โ |