Nodes/ComfyUI_MieNodes/Mie Loop Param Get String ๐Ÿ‘
ComfyUI Node

Mie Loop Param Get String ๐Ÿ‘

Read the current loop value as a STRING

By MieMieeeeeยทCreated 2 years agoยทUpdated 28 days agoยท 225
Mie Loop Param Get String ๐Ÿ‘
  • loop_ctx
  • STRING
โ—„keyvalueโ–บ
โ—„default_valueโ–บ

The string version of the loop getter. Inside a MieNodes loop, this node pulls the current iteration's value out of the loop_ctx as a STRING - which is the one you'll probably use most, because the most common thing people loop over is a list of prompts.

Part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's utility pack, under the ๐Ÿ‘ Loop submenu.

Why you'd reach for it

Picture the classic case: you've got ten prompts and you want one image for each. In MieLoopStart you set param_type to string, drop your ten prompts into string_list (one per line), and then MieLoopParamGetString hands you the current prompt each pass, ready to wire into your CLIP text encode. No copy-pasting ten sampler chains, no editing the prompt field and re-queuing over and over. Same idea works for a list of filenames, styles, character names, or any batch of text you want to fan out over.

How it works

The loop context holds each pass's value under a key (default value). MieLoopParamGetString looks it up and returns it as text. Keep the key at value for the primary iterated string; point it at a custom key to read any string you seeded through initial_state_json or wrote back via MieLoopEnd's state_json.

The inputs and outputs that matter

  • loop_ctx (MIE_LOOP_CTX) - the loop context.
  • key (STRING, default value) - which entry to read. value is the current iterated string; a custom name reads something else out of the state bag.
  • default_value (STRING, default empty) - returned when the key is missing, so an unset key gives you an empty string instead of an error.
  • Output STRING - this pass's text.

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

My prompts split in weird places. In MieLoopStart, the string_list is newline-separated - one prompt per line. If a single prompt wraps across lines it'll be read as two items. Keep each prompt on its own line.

Empty string coming out. Either the key doesn't match (value for the iterated item, exact spelling for custom keys) or your loop's param_type isn't string. The empty output is the default_value fallback doing its job.

I want structured data, not flat text. If you're looping over objects rather than plain strings, run MieLoopStart in json mode and read the item as a string here, then parse it - or collect results with MieLoopCollectJSON. This node returns raw text; it doesn't parse it for you.

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

Inputs (3)

NameTypeDefaultDescription
loop_ctxMIE_LOOP_CTXโ€”
keySTRINGvalueโ€”
default_valueSTRINGโ€”

Outputs (1)

NameTypeDescription
STRINGSTRINGโ€”