Nodes/ComfyUI Inspire Pack/Load Single Prompt From File (Inspire)
ComfyUI Node Runs on cloud

Load Single Prompt From File (Inspire)

Pull one prompt out of a multi-prompt file by index

By ltdrdata·Created 3 years ago·Updated 9 months ago· 805
Load Single Prompt From File (Inspire)
    • ZIPPED_PROMPT
    prompt_file
    index0
    text_data_opt

    The single-shot version of Load Prompts From File. Same prompt-file format - multiple prompts in one text file, separated by --- - but instead of feeding the whole list through your workflow, this grabs exactly one by its position. You give it an index and it returns prompt number N. That's it, and that's the point.

    It's the node you want when you keep a library of prompts in a file and just want to pick one for this run, or when something upstream is computing an index and you want to look up the matching prompt. No list iteration, no batch - one prompt, deterministically chosen. A common pairing is with List Counter (Inspire): let the counter drive the index and you can walk through a file one prompt per run without turning the whole graph into a batch job. It's also just a tidy way to keep your go-to prompts version-controlled in a text file instead of pasted into a node every time.

    How it works

    It opens the prompt file, splits it on the --- separators into an ordered set of prompts, and returns the entry at index (zero-based) as a ZIPPED_PROMPT. As with the batch loader, that zipped prompt bundles positive, negative, and name together, so you run it through Unzip Prompt (Inspire) to get the individual pieces for your encoder.

    The inputs and outputs that matter

    • prompt_file - the file to read from (from the pack's prompts/ directory).
    • index - which prompt to pull, counting from 0. This is the whole job of the node.
    • text_data_opt (optional) - supply the prompt text directly instead of reading a file.

    Output: ZIPPED_PROMPT - split it with Unzip Prompt (Inspire) before use.

    Installing it

    ComfyUI Manager: search "Inspire Pack", install, restart. Or manually:

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

    Then restart. It ships in Dr.Lt.Data's Inspire Pack; no model downloads needed.

    Where people get tripped up

    The index is zero-based, so the first prompt is 0, not 1 - off-by-one is the classic mistake here. Point it past the end of the file and you'll get an error or an empty prompt rather than a wrap-around, so keep the index within range. Same file-location rule as the batch loader: prompt_file reads from ComfyUI-Inspire-Pack/prompts/ (or an inspire_prompts path set in extra_model_paths.yaml), so a text file dropped elsewhere won't show up. And don't forget the Unzip Prompt step - the raw ZIPPED_PROMPT output isn't a string you can feed straight into a CLIP encoder.

    CategoryInspirePack/Prompt

    Inputs (3)

    NameTypeDefaultDescription
    prompt_fileCOMBO2 options: example/prompt2.txt, example/prompt1.txt
    indexINT00–18446744073709550000
    text_data_optoptSTRING

    Outputs (1)

    NameTypeDescription
    ZIPPED_PROMPTZIPPED_PROMPT