Nodes/BrainDead Nodes/BD Prompt Iterator (Advanced)
ComfyUI Node

BD Prompt Iterator (Advanced)

Suffixes, seeds, and ping-pong — the prompt iterator that grew up

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Prompt Iterator (Advanced)
    • prompt
    • filename
    • current_index
    • total_count
    • status
    • seed
    • debug_info
    promptsface 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
    modesequential
    filename_modesuffix_list
    base_filenamecharacter
    filenames
    suffixes_front _left _right _back
    filename_template{base}_{index:03d}_{suffix}
    prepend_text
    append_text
    manual_index0
    loop_modeloop
    resetfalse
    generation_seed-1
    seed_modeincrement_batch
    workflow_iddefault

    The basic BD Prompt Iterator gets you cycling prompts, but it leaves two chores on your plate: naming files sanely and varying the seed per pass. BD Prompt Iterator (Advanced) fixes both and throws in a few genuinely useful extras. If you're generating character sheets, turnarounds, or any "same subject, N angles" batch, this is the version you actually want - the defaults are even pre-filled for a four-view character turn.

    It keeps the same core as the basic version - prompts (one per line), mode, and base_filename - then layers on filename and seed control. The four outputs you'll wire are prompt → text encode, filename → save prefix, seed → KSampler seed, and current_index/total_count for status. There's also debug_info if you're chasing a state issue.

    Filename modes - where the time is saved

    filename_mode (default suffix_list) gives you three naming schemes:

    • auto_index - character_000, character_001...
    • suffix_list - your own list like _front, _left, _right, _back; clean, semantic names you don't have to rename later.
    • template - full control via filename_template (default {base}_{index:03d}_{suffix}).

    prepend_text and append_text let you inject a fixed prefix/suffix into the prompt itself, which is the clean way to keep "character consistency" phrasing consistent across every view without typing it into each line.

    Seed handling, the quiet star

    seed_mode (default increment_batch) plus generation_seed (default −1, meaning "use current iteration index") decide the seed. The output seed is meant to be wired into your sampler - that's the fix for the "four identical faces" problem the basic iterator leaves you with. Set generation_seed to something fixed and seed_mode to increment and you get deterministic-but-varying seeds across your batch: reproducible, but every view is genuinely different.

    loop_mode defaults to loop (wrap around). Change it to ping_pong and the iteration goes forward, then backward through the list - 1, 2, 3, 2, 1 - which is perfect for camera turnarounds where you want the same view approached from both sides. manual_index and reset behave like the basic node, and workflow_id again namespaces state so multiple iterators don't collide.

    Install

    Same pack, same drill: ComfyUI Manager search "BrainDead", or clone into custom_nodes and pip install -r requirements.txt. V3 API pack, so keep ComfyUI updated. Nodes appear under 🧠BrainDead/Prompt.

    Where people get burned

    The two things that bite are both state-related. First, iterator state is in-memory, so a ComfyUI restart resets the index - reloading a workflow mid-run starts you back at the top. Second, the template mode interpolates {suffix} even when it's empty, so a missing suffixes list produces filenames like character_002_. If your filenames look wrong, check the mode before the prompt. And remember the seed output only does anything if you actually wire it into the sampler - it's an output, not magic. Once it's wired and you've seen the four views come out with different compositions, you'll wonder how you ever did a character sheet by hand.

    Category🧠BrainDead/Prompt

    Inputs (15)

    NameTypeDefaultDescription
    promptsSTRINGface 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
    modeCOMBOsequential4 options: sequential, manual, random, single
    filename_modeCOMBOsuffix_list4 options: list, suffix_list, template, index
    base_filenameSTRINGcharacter
    filenamesoptSTRING
    suffixesoptSTRING_front _left _right _back
    filename_templateoptSTRING{base}_{index:03d}_{suffix}
    prepend_textoptSTRING
    append_textoptSTRING
    manual_indexoptINT00–9999
    loop_modeoptCOMBOloop3 options: once, loop, ping_pong
    resetoptBOOLEANfalse
    generation_seedoptINT-1-1–2147483647
    seed_modeoptCOMBOincrement_batch4 options: fixed, increment_batch, increment_prompt, random
    workflow_idoptSTRINGdefault

    Outputs (7)

    NameTypeDescription
    promptSTRING
    filenameSTRING
    current_indexINT
    total_countINT
    statusSTRING
    seedINT
    debug_infoSTRING