ComfyUI Node

Prompt Library

Prompt Library

By hexxacubic·Created about a year ago·Updated 2 months ago· 7
Prompt Library
    • double_prompt
    • positive_prompt
    • negative_prompt
    project
    index1
    randomize_indexfalse
    random_seed-1

    Prompt_Library is the flagship of this pack and the answer to a very specific kind of mess: you have a hundred hand-tuned prompts in scattered .txt files, and you're copy-pasting them into ComfyUI one at a time. This node turns a folder of plain text files into a dropdown-driven prompt database, with positive/negative separation built in.

    It is not a fancy visual library with colors and search and tags. It's deliberately plain - text files, a dropdown, an index - which is both its strength (your prompts stay editable in any editor, and version-controllable) and its limit (you organize by folder, or not at all). If that sounds like exactly what you wanted, this is your node.

    How it works

    Everything lives in ComfyUI/models/prompts/. Inside it you make category folders, and inside those you drop *.txt files. Each .txt file is a little prompt library with this syntax:

    • An empty line separates one prompt from the next.
    • A line starting with ### is a title or note - ignored in output.
    • --- (three or more hyphens) splits positive from negative, anywhere in the text.

    So a file looks like this (this is literally the shipped demo):

    ### Forest Meadow
    high quality, forest, meadow, forest clearing, sunlight and shadows --- bad quality, rainy, bad lighting
    
    ### Flower Meadow
    flowers, meadow, beautiful, sunlight and shadows, high contrast --- bad lighting, rainy, cold
    

    The project dropdown lists every file as Category/Name. The index input picks which prompt inside that file you want (1-based). Turn on randomize_index and it draws one at random instead. The node even ships two UI buttons - 📁 Prompts Folder opens the folder in your file manager, 🔄 Refresh List rebuilds the dropdown after you add files.

    The inputs that matter

    • project - the dropdown of Category/Name entries. The whole node is built around this.
    • index - which prompt in the file (1–999). Wraps around if you go past the end.
    • randomize_index - off: always show that index. on: pick randomly.
    • random_seed - -1 (default) means time-based random, so every run picks differently; set a concrete number to make the random pick reproducible.

    Outputs

    • double_prompt - the full positive\n---\nnegative string.
    • positive_prompt / negative_prompt - the two halves on their own, so you can route them separately.

    Feed double_prompt into Double_Prompt_Encode and you've got conditioning.

    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. No Python dependencies, no model downloads. But - the README explicitly says to copy the models folder from the repository into your ComfyUI install to get the demo project files. On the cloned repo that's models/prompts/City/Environments.txt and models/prompts/Fantasy/Forest.txt; copy them so they land at ComfyUI/models/prompts/.... Without that step, the dropdown just says No projects found.

    Where people get burned

    That "No projects found" dropdown is the #1 complaint, and it's almost always the missing folder or an empty one - click the folder button and look. Second: the files are read as UTF-8, so save your .txt with UTF-8 encoding or accented characters garble. Third: the dropdown list is only built when the node initializes or you hit Refresh List - new files don't appear until you do.

    One naming warning before you search for this thing: "prompt library" is one of the most overloaded names in the ecosystem, and ComfyUI Manager surfaces several different packs with similar titles - including a much bigger visual-library node pack that shares the display name "Prompt Library". Make sure the one you install is hexxacubic/ComfyUI-Prompt_Library. Different pack, different node, different folder layout.

    Categoryhexxacubic

    Inputs (4)

    NameTypeDefaultDescription
    projectCOMBO1 options: No projects found
    indexINT11–999
    randomize_indexBOOLEANfalse
    random_seedINT-1-1–18446744073709550000

    Outputs (3)

    NameTypeDescription
    double_promptSTRING
    positive_promptSTRING
    negative_promptSTRING