Prompt Database
A prompt library that lives in ComfyUI, not a notepad
- prompt_text
If your prompt-writing routine is "keep a notes file, copy, paste, forget where the good one went," this is the node that fixes it. Prompt Database is a text node that reads and writes a tiny prompt library stored on disk, so your favorite quality blocks, style tags, and negative prompts stop living in a document you lose track of and start living inside ComfyUI itself. No API, no key, no cloud - the name overpromises a little; it's a JSON file with a nice dropdown front end, and that's exactly what makes it useful.
It sits in the text category and is fully standalone: it takes no inputs and outputs one string, prompt_text. You wire that straight into a CLIP Text Encode node (positive or negative) and the text in the editor is what gets encoded. Nothing else to it.
How it works
Under the hood it's simpler than the fancy dropdowns suggest. Everything lives in user/default/user-db/prompts.json inside your ComfyUI directory, structured as category → prompt name → text:
{
"poses": {
"standing portrait": "person standing in portrait pose, direct eye contact"
},
"quality": {
"high quality": "masterpiece, best quality, ultra detailed"
}
}
The node ships with three sample categories - poses, styles, quality - each with a few prompts, so you can see the pattern before you overwrite them. On the front end, a small JavaScript extension talks to the ComfyUI server (/prompt_db_prompts, /prompt_db_text, /prompt_db_save) to fill the dropdowns, load text, and write changes back. The actual Python function just returns the widget's text. So treat the node as a smart text editor with persistence bolted on - because that's literally what it is.
The three inputs that matter
You only really touch these:
- category - dropdown of every category in your database (default
poses). - prompt_name - dropdown of prompts; on the UI it filters to the selected category when you switch.
- prompt_text - the multiline editor holding the actual prompt. This is the string that comes out the other side.
The one output, prompt_text, is a plain STRING - wire it anywhere text goes.
Editing is the point. Type a new category or prompt name in the fields, click 💾 Save, and it's written to the JSON instantly. Hand-editing the file works too, and the README is right that most LLMs are excellent at appending whole clean sections of that JSON for you - arguably a better use of the chatbot than asking it to write the prompt itself.
Installing it
No dependencies, no model downloads, no requirements.txt at all - it's pure Python plus the front-end JS, so install is trivial either way:
- ComfyUI Manager: search for "Prompt Database" (or install from the Git URL
https://github.com/benstaniford/comfy-prompt-db.git). - Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/benstaniford/comfy-prompt-db.git, then restart ComfyUI.
Where people get burned
- Dropdowns freeze at node creation. The category list is captured when the node loads, so a category you just saved won't appear in an already-open node until you recreate it or reload the workflow. Annoying, but a one-second fix.
- It's tied to the
defaultuser profile. If you launch with a custom--user-directory, your prompts file moves with it - copyuser-dbif you're migrating setups. - The JSON is your database. Break the syntax with a bad hand-edit and every dropdown goes empty (the node logs the error to the console). Keep a backup copy before you have the LLM "improve" the file.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| category | COMBO | poses | 3 options: poses, styles, quality |
| prompt_name | COMBO | posing with camera | 9 options: posing with camera, artistic, artistic quality, casual sitting, cinematic, high quality, +3 |
| prompt_text | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt_text | STRING | — |