Prompt Iterator (Advanced)
The Prompt Iterator with the seed output your batch job actually needs
- prompt
- filename
- current_index
- total_count
- status
- seed
- debug_info
The basic Prompt Iterator cycles a list of prompts, and that's genuinely all it does. This one is what you get when "cycle a list" isn't enough: templated filenames, prepend/append text, ping-pong looping, shuffled order - and the headline feature, an INT seed output with four modes so every prompt in your batch gets a consistent, trackable seed instead of fresh dice each run. If you've ever generated a batch of "the same character, four angles" and then wondered whether the differences came from the prompt or the noise, this is the fix.
What it adds over the basic node
Same state machine under the hood (state lives in a module-level dict keyed by workflow_id, and sequential/random modes return NaN from IS_CHANGED() so the node re-runs and advances on every queue press). The additions are what make it "Advanced":
- mode gains
randomfor shuffled order. - filename_mode:
list(exact filenames),suffix_list,template, orindex. - loop_mode:
once,loop, orping_pong. - prepend_text / append_text wrapped around each prompt.
- generation_seed + seed_mode feeding a
seedoutput.
Seed modes - the part people actually care about
- fixed - the same seed for every prompt. This is the "compare prompts against identical noise" mode, which is exactly right for face-angle tests.
- increment_batch - the seed bumps by one each time the iterator wraps back to the first prompt. One list, three complete variation sets: that's the use case.
- increment_prompt - seed +1 per prompt, so every render gets its own sequential seed.
- random - a fresh seed every execution, maximum chaos.
generation_seed defaults to -1, which means "pick a random seed now and hold it" - so fixed still works even if you never type a number. Wire seed → KSampler's seed input and you're done.
Filename modes
The default filename_mode is suffix_list, and the default suffixes (_front, _left, _right, _back) pair one-to-one with your prompts - that's the whole "character_front.png → character_back.png" workflow from the README. Or use template mode with {base}, {index:03d}, and {suffix} placeholders; the default "{base}_{index:03d}_{suffix}" turns base character and suffix _front into character_000_front. index mode is the basic node's base_{index:03d}, and list mode is the exact-filenames box.
The inputs that matter
- prompts - one per line, as before.
- mode, filename_mode, loop_mode - the behavior toggles above.
- suffixes, filename_template - the naming system.
- prepend_text / append_text - handy for slapping a style tag or quality block on every line at once.
- generation_seed, seed_mode - the seed bookkeeping.
Outputs, and the debug_info caveat
prompt → CLIPTextEncode, filename → SaveImage, seed → KSampler, plus current_index, total_count, and status. And debug_info, which deserves a warning: it's declared in the node's output list, but the shipped v2.1.0 code never actually returns it - the function returns six values against seven declared outputs. Leave it unwired and nothing happens; wire something to it and ComfyUI will complain that the source output doesn't exist. Don't build anything on it; that's what status is for. (Credit where due: this is exactly the kind of thing to verify in the source rather than the README.)
Install
ComfyUI Manager, search "ComfyUI Prompt Iterator Extension" - or git clone https://github.com/BizaNator/ComfyUI_PromptIterator into ComfyUI/custom_nodes/, then restart. No dependencies, no model files; it lands under utils/prompt with its two siblings.
Gotchas
- ping_pong bounces 0 → last → 0, and the iteration counter only ticks when it comes back to prompt 0.
- once mode stops advancing at the last prompt - it does not wrap.
- Empty prompts box hits the same output-count bug as the empty path elsewhere in this pack: keep at least one non-blank line.
- State is in-memory, so a ComfyUI restart puts the cursor back at prompt 1.
Between the three iterator nodes, this is the one I'd actually reach for. Basic is fine for a throwaway list, Dynamic is great when prompts come from other nodes - but if you care about reproducible seeds and filenames you can sort, Advanced is the whole package.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| prompts | STRING | face only headshot, facing camera directly Left profile View - rotate face 90 degrees left Right profile View - rotate face 90 degrees right Back View - direct back of the head | — |
| mode | COMBO | sequential | 4 options: sequential, manual, random, single |
| filename_mode | COMBO | suffix_list | 4 options: list, suffix_list, template, index |
| base_filename | STRING | character | — |
| filenamesopt | STRING | — | |
| suffixesopt | STRING | _front _left _right _back | — |
| filename_templateopt | STRING | {base}_{index:03d}_{suffix} | — |
| prepend_textopt | STRING | — | |
| append_textopt | STRING | — | |
| manual_indexopt | INT | 00–9999 | — |
| loop_modeopt | COMBO | loop | 3 options: once, loop, ping_pong |
| resetopt | BOOLEAN | false | — |
| generation_seedopt | INT | -1-1–2147483647 | — |
| seed_modeopt | COMBO | increment_batch | 4 options: fixed, increment_batch, increment_prompt, random |
| workflow_idopt | STRING | default | — |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |
| filename | STRING | — |
| current_index | INT | — |
| total_count | INT | — |
| status | STRING | — |
| seed | INT | — |
| debug_info | STRING | — |