ComfyUI Node

Prompt Warehouse

Keep your prompts in a file, not in a widget

By D33MO·Created 2 months ago·Updated 7 days ago· 0
Prompt Warehouse
  • clip
  • prompt
  • width
  • height
  • conditioning
◄prompt►
◄width►
◄height►
◄random_groupAll►
◄random_enabledfalse►
◄prompt_in—►

The problem it solves

Prompt text in ComfyUI normally lives in a widget. That's fine until you have thirty prompts you actually reuse - a style block, six character descriptions, a handful of lighting setups - and they're scattered across thirty saved workflows, each one a file you have to remember the name of. The genre solution is a prompt library: entries with a title, a group and optional dimensions, stored on disk, browsable from inside the graph.

Prompt Warehouse is one of those. Worth saying plainly: it's a small independent pack with essentially no community track record behind it, unlike the packs that turn up in every "what do you install" thread. You're trusting the author's code and README here, not a crowd. What you get: a library in data/prompts.json inside the plugin folder, grouped entries, a random draw, and an optional encode step so the node can stand in for CLIP Text Encode.

How it works

The node's UI (a small web extension shipped with the pack) talks to HTTP routes the plugin registers on ComfyUI's own server - GET/PUT /prompt-warehouse/prompts - and the data lands in data/prompts.json. That file is .gitignored, which is the point: git pull can't ever overwrite your library on an upgrade.

Every save is mirrored to ComfyUI-Prompt-Warehouse/prompts.json in your Documents folder, with up to 20 timestamped snapshots alongside it, and a missing, empty or corrupt main file gets restored from that backup. One wrinkle: deleting every entry and saving does write the empty payload to the backup, deliberately - deleted content must not resurrect itself. Rolling back to a snapshot means copying one over data/prompts.json by hand; snapshots are never read automatically.

The random draw has a mechanism you can feel in the graph. With random_enabled on, the node's IS_CHANGED returns float("NaN") - the standard ComfyUI idiom for "never cache this, run me every queue." That's what makes a fresh draw each run work at all, and it's also the known cost of the trick: an always-dirty node defeats the cache for everything downstream of it, so a workflow that suddenly feels slower than it should is sometimes one random node poisoning the graph.

The inputs and outputs that matter

  • prompt - the big text box. Entries get loaded into it from the warehouse UI; editing the box doesn't change the stored entry until you save it back.
  • width / height - strings, not numbers. Empty or unparseable gives 0 on the matching output, the "let downstream decide" signal. Wire them into Empty Latent Image and the matched set feature lands: the draw picks prompt and dimensions together, so an SDXL preset entry comes back as prompt plus a resolution that suits it.
  • random_group - dropdown built from the groups in your saved entries, plus All. Since that list is computed when ComfyUI builds the node definition, a group you just created may need a page reload before it appears.
  • random_enabled - the on/off switch for drawing instead of using the box.
  • prompt_in (optional) - upstream text, joined ahead of the drawn or typed prompt.
  • clip (optional) - feed it a model loader's CLIP and the node encodes for you, emitting conditioning.

Outputs: prompt (STRING), width (INT), height (INT), conditioning (CONDITIONING). Leave clip unconnected and nothing is encoded - you still get the first three normally.

One detail from the code: with a non-empty prompt, the node appends a bare , so chained fragments stay tidy. Harmless on any model - just know it's there when you're tuning a long prompt.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/D33MO/ComfyUI-Prompt-Warehouse.git

Or search Prompt Warehouse in ComfyUI Manager. No third-party Python dependencies - no requirements.txt, no models to download. Restart ComfyUI and reload the browser. The interface is English by default; setting ComfyUI's Comfy → Locale to 简体中文 switches the node UI too, and it does not follow your browser language.

Common issues

The warehouse UI won't load or save over LAN. The pack's endpoints only answer requests from loopback and return 403 to everything else - deliberate hygiene, but it means driving the UI from another machine on the network won't work. Behind a reverse proxy the request looks local, so the restriction doesn't apply and you must lock down /prompt-warehouse/ in the proxy yourself.

You deleted or reinstalled the plugin folder. Your prompts went with it. Back up data/prompts.json separately before removing the directory.

A group is missing from the dropdown. Reload the page or drop a fresh node.

Random draw gives you the same thing twice. Expected - a draw is a draw, and a one-entry group always returns that entry. There's no "don't repeat the last one" logic; put the variety in the group.

Nothing gets encoded. Check clip is wired. Without it conditioning is empty.

CategoryPrompt Warehouse

Inputs (7)

NameTypeDefaultDescription
promptSTRING—
widthSTRING—
heightSTRING—
random_groupCOMBOAll1 options: All
random_enabledBOOLEANfalse—
prompt_inoptSTRING—
clipoptCLIP—

Outputs (4)

NameTypeDescription
promptSTRING—
widthINT—
heightINT—
conditioningCONDITIONING—