Nodes/ComfyUI_MieNodes/Mie Loop Collect Text ๐Ÿ‘
ComfyUI Node

Mie Loop Collect Text ๐Ÿ‘

Gather a string per loop pass into a list

By MieMieeeeeยทCreated 2 years agoยทUpdated 28 days agoยท 225
Mie Loop Collect Text ๐Ÿ‘
  • loop_ctx
  • loop_ctx
โ—„textโ–บ

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.

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

Inputs (2)

NameTypeDefaultDescription
loop_ctxMIE_LOOP_CTXโ€”
textSTRINGโ€”

Outputs (1)

NameTypeDescription
loop_ctxMIE_LOOP_CTXโ€”