CivArchive
    ← All articles
    Published November 13, 2026by ForestGreenAI

    Sequential Prompts and Wildcards from a Spreadsheet

    70 views0 reactions0 comments on CivitAI1 collected
    tool guidewildcardcomfysequentialbatchcsvcomfyuinodeprompts

    Do you have a list of prompts you want to run one after another, such as a set of characters, products, or test scenes? Sequential CSV Wildcard is a small ComfyUI custom node that reads your prompts from a CSV file and expands every {option1|option2|option3} wildcard into all of its combinations. Each queue gives you the next prompt in order, rather than a random pick, so every run is predictable and reproducible.

    It's great for:

    • Running a whole prompt list overnight without copy-pasting

    • Keeping prompts organized in Excel, Google Sheets, or any spreadsheet

    • Systematic variations, where you want every option covered rather than random picks

    Walkthrough

    1. Install

    ComfyUI-Manager: open Manager, then Custom Nodes Manager, search "Sequential CSV Wildcard", click Install, and restart ComfyUI.

    Command line: comfy node install comfyui-sequentialcsvwildcard

    Manual: in ComfyUI/custom_nodes, run git clone https://github.com/Rightey/ComfyUI-SequentialCSVWildcard, then restart ComfyUI.

    The node appears under Add Node > prompt > csv > CSV Sequential Wildcard Prompt.

    2. Make your CSV

    Create a spreadsheet with your prompts in a column and save it as CSV (UTF-8). Here is the small test file used for the example in this guide, prompts.csv:

    prompt
    a {red|blue|green} car on a beach
    an elf girl wearing a {straw| baseball} hat sitting on a park bench

    Tips: Wrap a prompt in quotes if it contains commas. Extra columns (like a notes column) are fine; you choose which one the node reads. A header row is optional. Spaces around each option are trimmed, so {straw| baseball} gives straw and baseball.

    3. Wire it up

    1. Add the CSV Sequential Wildcard Prompt node.

    2. Connect the node's prompt output to the CLIP Text Encode text input.

    3. Optional: connect used_index, total_rows and total_prompts to a display node so you can see where you are in the list.

    4. Set the inputs

    • csv_path: the full path to your file, e.g. C:\ComfyUI\prompts\prompts.csv or /home/me/prompts.csv.

    • seed: your position in the expanded prompt list (every combination of row 1, then every combination of row 2, and so on). Set "control after generate" to increment so each queue moves to the next prompt. Start at 0 for the first one.

    • column: which column holds the prompt, counting from 0. In the example above, prompt is column 0.

    • has_header: on if your first row is a header (like prompt), so it is skipped.

    • wrap: on to loop back to the first prompt after the last; off to stop with an error once you run past the end.

    • prefix / suffix (optional): text added to every prompt, such as quality tags ("masterpiece, best quality, ") or a style ending (", cinematic lighting, 35mm").

    5. Run through your list

    Here's the test CSV from step 2 with these settings:

    • seed: 0, control after generate: increment

    • column: 0

    • has_header: true

    • wrap: true

    • prefix: "high contrast, masterpiece, best quality, amazing quality, very aesthetic, score_7, score_8, score_9,"

    • suffix: empty

    The node set up for the example, with its prompt output connected to a Preview as Text node.

    Row 1 has three options and row 2 has two, so the CSV expands to 3 + 2 = 5 prompts (total_prompts = 5).

    1. Set seed to 0 and control after generate to increment.

    2. Set the Batch count next to the Queue button to total_prompts (5 here) to get each prompt exactly once.

    3. Click Queue. Each image uses the next prompt.

    Tip: connect the prompt output to a Preview as Text node as well. It shows exactly which prompt each run produced, which is handy for checking the order.

    This is what each run gets (shown without the prefix):

    • Run 1 (seed 0): a red car on a beach

    • Run 2 (seed 1): a blue car on a beach

    • Run 3 (seed 2): a green car on a beach

    • Run 4 (seed 3): an elf girl wearing a straw hat sitting on a park bench

    • Run 5 (seed 4): an elf girl wearing a baseball hat sitting on a park bench

    • Run 6 (seed 5): Loops back to a red car on a beach (wrap is on)

    And here are the five results, in run order:

    1. a red car on a beach

    2. a blue car on a beach

    3. a green car on a beach

    4. an elf girl wearing a straw hat sitting on a park bench

    5. an elf girl wearing a baseball hat sitting on a park bench

    6. How the wildcards work

    Each row is expanded into every combination of its {a|b|c} groups. The seed walks through all the combinations of row 1, then all of row 2, and so on. With wrap on, it starts over from the top after the last one.

    Several wildcards in one row: the first wildcard changes fastest. For example, a {red|blue} car on a {street|beach} gives 2 × 2 = 4 prompts, in this order:

    1. a red car on a street

    2. a blue car on a street

    3. a red car on a beach

    4. a blue car on a beach

    Because the prompt is picked by the seed, rerunning the same seed on the same CSV always gives the same prompt, which makes it easy to recreate a result.

    7. Outputs

    • prompt: the final text, with prefix, wildcards expanded, and suffix.

    • used_index: the position in the expanded prompt list that was used.

    • total_rows: how many data rows the CSV has (header not counted).

    • total_prompts: how many prompts the CSV expands to, counting every wildcard combination. Set Batch count to this to get each prompt exactly once.

    Troubleshooting

    • "CSV file not found": check the full path, and don't wrap it in quotes.

    • "column N does not exist": a row has fewer columns than you asked for; remember counting starts at 0.

    • "out of range": the seed is past the last prompt; turn on wrap or reset the seed to 0.

    • Weird characters: save your CSV as UTF-8.

    Links

    Questions or ideas? Leave a comment; I'd love to see what you batch with it!

    Attachments

    Archived from CivitAI · Updated November 19, 2026View source