Nodes/cn_02_kemmy_ComfyUI-Sequential-Prompt-List/cn_02_kemmy_Sequential Prompt List + Dynamic Tail
ComfyUI Node

cn_02_kemmy_Sequential Prompt List + Dynamic Tail

Script the scenes you care about, wildcard the rest — one queue click

By kemmy2302·Created 2 months ago·Updated a day ago· 1
cn_02_kemmy_Sequential Prompt List + Dynamic Tail
    • prompt
    ◄records_json{"version": 1, "records": [{"id": "6259b7d4-bf87-46e5-9999-ab4c291787c0", "enabled": true, "title": "List Item 001", "prompt": ""}]}►
    ◄dynamic_prompt_template__pose__, __background__►
    ◄dynamic_count4►
    ◄dynamic_seed0►
    ◄seed_modeincrement►
    ◄avoid_duplicatestrue►
    ◄run_modescenario then dynamic►
    ◄prefix_prompt—►
    ◄suffix_prompt—►

    You're making a character sheet, or a short sequence, or forty variations of one idea. Eight of those images you can describe exactly - "walking through the school gate, morning", "sitting in a classroom, studying". The other thirty you'd rather let the machine roll poses, backgrounds and lighting for, off the same character and style, out of one Queue click.

    Do it in two passes and merge folders after, or use cn_02_kemmy_Sequential Prompt List + Dynamic Tail, which glues the halves into a single ordered STRING list: your enabled records top to bottom, then however many wildcard expansions you asked for.

    It's the third node in a three-node pack, and the only one with a real dependency. Worth knowing up front.

    How it works

    The node keeps a list editor in its UI - each row has an enable checkbox, a title, and a multiline prompt field - and stores the whole thing as a JSON blob in records_json. That's what the widget's default value is: a one-record JSON document you never normally look at, because the pack ships a frontend that replaces it with the editor.

    On queue, it walks the enabled records in order, filters out the empty ones, and builds one string per record:

    prefix_prompt
    the record's prompt
    suffix_prompt
    

    That's a real newline join, not a comma - worth remembering when you're mentally composing 1girl, Alice, long blonde hair as the prefix. Usually harmless for CLIP, since it tokenises whitespace anyway, but keep each block's tags comma-separated and let the line break be the block separator.

    Then comes the tail. For each of dynamic_count slots it hands dynamic_prompt_template to Impact Pack's own wildcard engine - the code literally imports impact.wildcards and calls its process() - and appends whatever comes back, wrapped in the same prefix and suffix. So __pose__,\n__background__ becomes N distinct pose+background combinations, one prompt each, slotted after your scripted scenes. Impact Pack's syntax is the syntax here, unmodified: __wildcard__, nested wildcards, multiple references in one template, and inline {red|blue|black} choices.

    The output is prompt, a STRING list. Wire it into CLIP Text Encode.text and ComfyUI maps over it: one image per prompt, in order. Same as any list-shaped output in the graph.

    The inputs you'll actually touch

    run_mode is the switch you'll flip most. scenario then dynamic does both halves. scenario only turns it into a plain sequential list node. dynamic only ignores the editor entirely and is basically a "give me N wildcard prompts" node - genuinely handy on its own.

    dynamic_count is how many tail items you want (0–999, default 4). dynamic_prompt_template is the template; leave it blank and you get zero dynamic items, silently, no warning.

    dynamic_seed has the usual control_after_generate dropdown next to it, and seed_mode decides whether the slots step through seed, seed + 1, … (increment) or reuse one seed (fixed). avoid_duplicates retries with the next seed when an expansion repeats.

    prefix_prompt and suffix_prompt are optional STRING inputs; if nothing's wired, that part is simply omitted. There are no hidden text boxes on the node itself.

    Install

    ComfyUI Manager is the easy path - search Kemmy Sequential Prompt List (that's the registry display name). By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kemmy2302/cn_02_kemmy_ComfyUI-Sequential-Prompt-List.git
    

    Then, because of the dynamic tail, Impact Pack too:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ltdrdata/ComfyUI-Impact-Pack.git
    

    Restart the backend, not just the browser tab, then hit Ctrl+F5. Both nodes appear under Ordered Prompt Tools. This pack declares zero Python dependencies of its own; Impact Pack is the heavy one and runs its own install script on first startup. Wildcard .txt files go in Impact Pack's own wildcards/ folder, not this pack's.

    Where people get burned

    Missing Impact Pack is a hard error, and a slightly confusing one. The node raises Dynamic Tail requires ComfyUI-Impact-Pack. Install or enable ComfyUI-Impact-Pack, then restart ComfyUI. on queue. If you've already installed it and still see that, Impact Pack itself failed to import - check the startup log, don't reinstall this pack.

    avoid_duplicates can quietly give you fewer prompts than you asked for. There's a retry cap of dynamic_count * 20 attempts, and once it's hit the loop just stops. Ask for 10 items from a __expression__ file holding 3 lines and you get 3 prompts, no complaint. Small wildcard sets and big counts do not mix.

    fixed seed isn't as fixed as it sounds. With avoid_duplicates checked, the code steps the seed on every attempt regardless of seed_mode - so fixed behaves like increment. Turn avoid_duplicates off and fixed gives you N identical expansions, which is rarely what anyone wants. For a reproducible set, leave increment on and pin dynamic_seed.

    Downstream nodes have to understand lists. CLIP Text Encode does; some custom text nodes choke on a list input and only ever see one value. Same wall people hit when they batch a prompt list and then try to auto-name each output image.

    And one freebie from the source: if every record is disabled and the template is empty, you get no error - just one prompt made of prefix_prompt and suffix_prompt glued together. One image, and a confused minute staring at the queue.

    CategoryOrdered Prompt Tools

    Inputs (9)

    NameTypeDefaultDescription
    records_jsonSTRING{"version": 1, "records": [{"id": "6259b7d4-bf87-46e5-9999-ab4c291787c0", "enabled": true, "title": "List Item 001", "prompt": ""}]}—
    dynamic_prompt_templateSTRING__pose__, __background__—
    dynamic_countINT40–999—
    dynamic_seedINT00–18446744073709550000—
    seed_modeCOMBOincrement2 options: increment, fixed
    avoid_duplicatesBOOLEANtrue—
    run_modeCOMBOscenario then dynamic3 options: scenario then dynamic, scenario only, dynamic only
    prefix_promptoptSTRING—
    suffix_promptoptSTRING—

    Outputs (1)

    NameTypeDescription
    promptSTRING—