Mie Loop State Set String ๐
Writing accumulated text into a ComfyUI loop
- loop_ctx
- loop_ctx
Set String is the write half of the text pair in MieNodes' Loop State family, matched with Get String. Anywhere a for-loop needs a piece of text to survive from one pass to the next - an evolving prompt, an LLM's running critique, a log of what each iteration did - this is the node that actually commits the string somewhere it'll still be there next lap.
How it works. Loop state travels as a custom object, MIE_LOOP_CTX, that flows through the loop and gets rewritten pass by pass. Set String takes the current context, a key, and a value string, stores it under that key, and returns the updated context to carry forward - the rest of this pass, and the loop's next iteration, both read from that updated object.
Default key feedback_string matches the naming across the family and hints at the intended pattern: a loop where each pass generates some kind of feedback in text form - an LLM judge's reasoning, a running caption, an accumulated note - that shapes the next pass.
What's on the node.
loop_ctx(required) - must come from another Loop-category node in this pack.key(defaultfeedback_string) - has to match what the corresponding Get String node reads.value(default empty string) - the text you're writing. This node overwrites whatever was previously stored, it doesn't append.
Output: the updated loop_ctx.
Installing. Manager: search ComfyUI_MieNodes, install. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/MieMieeeee/ComfyUI-MieNodes, then restart ComfyUI. No models, no extra dependencies - plain text bookkeeping.
The usual caveat for this family applies: the README has no coverage of the Loop category at all. This description is built from the node's schema and from how a text-carrying loop has to be wired, not from confirmed pack documentation.
Troubleshooting.
- Text isn't accumulating - every pass just replaces the last one. That's the actual, expected behavior of this node: it overwrites. If you want text to build up across iterations (a running log, an appended history), read the existing value with Get String first, concatenate your new text onto it with a string-join node, and feed the combined result into
valuehere. - Downstream Get String still returns
default_value. Check thekeystrings match exactly between this node and whatever's reading it - free-text fields, case-sensitive, no error on mismatch. - String output looks cut short after a few loop passes. If the text is coming from an LLM call each iteration, check that connector node's max-token setting isn't clipping the response before it ever reaches this node - that's happening upstream, not here.
loop_ctxtype error. Something other than another Loop-category node's context output from this same pack is wired into that socket.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| loop_ctx | MIE_LOOP_CTX | โ | |
| key | STRING | feedback_string | โ |
| value | STRING | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| loop_ctx | MIE_LOOP_CTX | โ |