Nodes/ComfyUI-Prompt_Library/Simple Prompt Library
ComfyUI Node

Simple Prompt Library

Your Whole Prompt Library, Inside One Text Box

By hexxacubic·Created about a year ago·Updated 2 months ago· 7
Simple Prompt Library
    • prompt
    • used_seed
    prompt_text### Masterpiece masterpiece, best quality --- low quality, blurry
    random_seed-1

    Simple_Prompt_Library is the no-files version of the pack's flagship. Where Prompt_Library reads your prompts from .txt files on disk, this node keeps the whole library in a single multiline text box inside the workflow itself. Pick a prompt by index or let it randomize, and out comes the prompt plus the seed that produced the pick.

    Why would you choose the text-box version over the file version? One word: portability. A file-based library only works on machines that have the file. A text-box library travels inside the workflow JSON itself - share the workflow, share the prompts, done. If you're building something you'll hand to other people (or run on a different machine), that's a genuine advantage. If your library is big enough to be a real database, you want the file version instead.

    How it works

    The prompt_text field uses the same syntax as the file version, so it should feel familiar:

    • An empty line separates one prompt from the next.
    • Lines starting with ### are titles - kept as structural placeholders, stripped from the output.
    • --- or ---- splits positive from negative, mid-line allowed.

    The default content demonstrates it:

    ### Masterpiece
    masterpiece, best quality --- low quality, blurry
    

    The random_seed input is where this node gets weird, and it's worth reading carefully because it does double duty as both an index and a seed:

    • -1 → random pick every run (time-based), and the used_seed output stays -1.
    • 0 or 1 → always the first prompt.
    • 2999 → treated as a 1-based index if it's within range; if it's past the end of your list, it falls back to acting as a random seed.
    • 1000 and up → always treated as a random seed (reproducible for a given value).

    Inputs and outputs

    • prompt_text - your library. The only required text.
    • random_seed - the index-or-seed hybrid above.

    Outputs:

    • prompt - the selected prompt as a string, --- separator intact.
    • used_seed - an INT reporting which seed path the node took. Handy for logging or feeding into a seed node if you want to reconstruct a draw.

    How to install it

    Install the pack via ComfyUI Manager (search ComfyUI-Prompt_Library) or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/hexxacubic/ComfyUI-Prompt_Library
    

    Restart ComfyUI. Pure standard library, no pip step, no models to download. Category: hexxacubic.

    Where people get burned

    The seed semantics are the trap - nobody reads them on the first pass. If you set random_seed to 5 expecting "the fifth prompt" and your list only has three entries, the node doesn't clamp to 3; it treats 5 as a seed and picks something that looks arbitrary. Keep the value inside 1..list_length for deterministic indexing, or go ≥1000 for reproducible randomness.

    Also, used_seed is not the actual seed used for the random draw - it's mostly an echo of your input (stays -1 on time-based picks). If you want to reproduce a good roll, the practical move is to write down the seed you fed it, not to trust the output to hand you a magic number. Same debugging rule that applies across this whole pack: fix the seed while you're tuning, randomize when you're hunting for surprises.

    Categoryhexxacubic

    Inputs (2)

    NameTypeDefaultDescription
    prompt_textSTRING### Masterpiece masterpiece, best quality --- low quality, blurry
    random_seedINT-1-1–18446744073709550000

    Outputs (2)

    NameTypeDescription
    promptSTRING
    used_seedINT