Nodes/ComfyUI Inspire Pack/Load Prompts From Dir (Inspire)
ComfyUI Node Runs on cloud

Load Prompts From Dir (Inspire)

Batch-run a whole folder of prompts in sequence

By ltdrdata·Created 3 years ago·Updated 9 months ago· 805
Load Prompts From Dir (Inspire)
    • zipped_prompt
    • count
    • remaining_count
    prompt_dir
    reloadfalse
    load_cap0
    start_index0

    Say you've got a couple dozen prompts you want to render, each as its own image, without babysitting the queue. Load Prompts From Dir is how you feed them all in at once. Point it at a directory of prompt files and it reads them out as a list of ZIPPED_PROMPT objects, which ComfyUI then iterates - running your whole workflow once per prompt. It's the batch-prompting engine of the Inspire Pack.

    This is the node people underuse. If you're still copy-pasting prompts one at a time into a text box and hitting queue, this replaces that entirely: write your prompts to files, drop them in a folder, and let the graph churn through them.

    How it works

    It reads prompt files from a directory located under ComfyUI-Inspire-Pack/prompts/ (you can also register an inspire_prompts path in extra_model_paths.yaml). One file can hold multiple prompts separated by a --- line, and each becomes its own entry. The output is a list of zipped prompts - positive, negative, and the file name as the prompt's name - which you unpack with Unzip Prompt (Inspire) and feed to CLIP Text Encode. Because it's a list, ComfyUI naturally loops the downstream graph over every prompt.

    The inputs and outputs that matter

    • prompt_dir - the directory to read, chosen from folders under the pack's prompts/ directory. This is the main thing you set.
    • load_cap (optional, default 0) - max prompts to load; 0 means no limit. Set it to test on the first few before committing to the whole set.
    • start_index (optional, default 0) - which prompt to start from. Useful for resuming a big run where it left off.
    • reload (optional) - force a re-read of the files if you edited them since the last run.

    Three outputs: zipped_prompt (the list - send to Unzip Prompt), count (how many were loaded), and remaining_count (how many are left after start_index/load_cap). The counts are handy for wiring up progress or naming.

    Installing it

    Part of the Inspire Pack by Dr.Lt.Data, author of ComfyUI Manager and the Impact Pack - mainstream, well-maintained tooling. Via ComfyUI Manager: search ComfyUI Inspire Pack, install, restart. Manually:

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

    then restart. No downloads, but you do need to create prompt files under ComfyUI-Inspire-Pack/prompts/ for it to read - the pack ships an example folder to copy.

    Common issues

    My folder doesn't appear in the dropdown. The node only lists directories under ComfyUI-Inspire-Pack/prompts/ (or an inspire_prompts path you registered in extra_model_paths.yaml). Put your folder there and restart or hit reload - an arbitrary path elsewhere on disk won't show up.

    Only one prompt runs. The output is a list, and something downstream may be collapsing it. Make sure the zipped-prompt list flows through Unzip Prompt and into your encoders, and that your Save node is inside that iterated path so it fires once per prompt.

    Edited the files but it's using the old prompts. Toggle reload to force a re-read.

    Want just a slice. Use start_index and load_cap together to run, say, prompts 10-20 of a big set - good for resuming or splitting a long batch.

    Nodes won't load after install. Check the terminal log - usually a version mismatch. Update Inspire Pack and Impact Pack together and restart.

    CategoryInspirePack/Prompt

    Inputs (4)

    NameTypeDefaultDescription
    prompt_dirCOMBO1 options: example
    reloadoptBOOLEANfalse
    load_capoptINT0The amount of prompts to load at once: 0: Load all 1 or higher: Load a specified number
    start_indexoptINT0-1–18446744073709550000Starting index for loading prompts: -1: The last prompt 0 or higher: Load from the specified index

    Outputs (3)

    NameTypeDescription
    zipped_promptZIPPED_PROMPT
    countINT
    remaining_countINT