Nodes/BrainDead Nodes/BD Prompt Iterator
ComfyUI Node

BD Prompt Iterator

Character sheet on autopilot — BD Prompt Iterator cycles your prompts

By BizaNator·Created 8 months ago·Updated 3 days ago· 15
BD Prompt Iterator
    • prompt
    • filename
    • current_index
    • total_count
    • status
    promptsprompt 1 prompt 2 prompt 3
    modesequential
    base_filenameoutput
    filenames
    manual_index0
    resetfalse
    workflow_iddefault

    If you've ever generated a character-sheet by hand - write "front view", run it, edit the prompt to "left profile", run again, rename the file - this node is the "stop doing that" button. BD Prompt Iterator holds a list of prompts, hands them out one at a time with an auto-generated filename, and cycles. Wire it into a normal text-encode → sample → save chain and every run advances to the next prompt automatically. Batch generation becomes "press Queue once, walk away."

    The core is a prompts multiline box - one prompt per line - plus a mode and base_filename. On each execution it outputs the current prompt, a filename, current_index, total_count, and a status string. You wire prompt into your CLIP text encode and filename into your save node's prefix, and you're done.

    Modes that matter

    • sequential (default) - cycles through prompts, wrapping around, with an iteration counter so you know when you've done a full pass.
    • manual - jump to a specific prompt via manual_index.
    • single - always use the first prompt. Slightly redundant, but handy for one-offs without re-editing the list.

    A few controls worth knowing: filenames lets you override the auto-naming with your own list (one per line); without it you get base_filename_NNN. reset rewinds to the start, and workflow_id is the quiet hero - it namespaces the iterator state, so you can run two iterators in one graph without them stepping on each other. Keep it in mind when a second iterator starts behaving oddly; odds are both are using the default "default" state.

    How it behaves under the hood

    Two details matter for real workflows. First, in sequential mode the node deliberately re-executes every run (it fingerprints itself as always-changed), which is exactly what you want - it must advance whether or not its inputs changed. Second, the state is in-memory global, not saved in your workflow JSON, so restarting ComfyUI resets the index. If you load a workflow mid-run, expect the iterator to start from the beginning again; that's normal, not a bug.

    Install

    Part of ComfyUI-BrainDead: Manager search "BrainDead", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/BizaNator/ComfyUI-BrainDead
    cd ComfyUI-BrainDead
    pip install -r requirements.txt
    

    Restart, and it's under 🧠BrainDead/Prompt. The pack targets the newer V3 API, so keep ComfyUI current.

    The honest take

    This basic iterator is the right tool for a simple list of prompts. If your needs creep - suffixes per prompt, seed management, ping-pong looping - the pack has you covered with the Advanced and Dynamic variants (templates, suffix lists, seed modes, and up to 20 wired inputs respectively). Start here to learn the rhythm, then graduate. One genuine gotcha: the iterator doesn't touch your KSampler seed, so unless you wire its current_index or the Advanced node's seed output into your sampler, every iteration uses the same seed - you'll get the same composition across all four views of a character sheet. That's not a bug, but it will absolutely confuse you the first time you see four identical faces.

    Category🧠BrainDead/Prompt

    Inputs (7)

    NameTypeDefaultDescription
    promptsSTRINGprompt 1 prompt 2 prompt 3
    modeCOMBOsequential3 options: sequential, manual, single
    base_filenameSTRINGoutput
    filenamesoptSTRING
    manual_indexoptINT00–9999
    resetoptBOOLEANfalse
    workflow_idoptSTRINGdefault

    Outputs (5)

    NameTypeDescription
    promptSTRING
    filenameSTRING
    current_indexINT
    total_countINT
    statusSTRING