Prompt Stack
Stack your prompt blocks into one string — no notepad required
- stacked_prompts
Ever find yourself rebuilding the same prompt by hand - a quality block, a style block, a subject line - and wishing you could just bolt them together? That's exactly the pain this node exists for. Prompt Stack is the companion to the Prompt Database node: instead of emitting one saved prompt, it stacks several prompts from different categories into a single output string. For once the name is accurate - it really is just stacking strings.
This matters more than it sounds. The way people actually write prompts these days is block-structured: a short quality/subject block up front, then a natural-language scene description, with each block doing one job. Modern LLM-based encoders want clean comma-joined text - the old CLIP-era crutches like AND and BREAK are dead weight. Prompt Stack produces exactly that: plain text, comma-separated, in the order you arranged it.
Like its sibling, it's a standalone text node in the text category: no inputs required, one output, stacked_prompts. Wire that into a CLIP Text Encode and you're done.
How it works
It reads the same user/default/user-db/prompts.json as Prompt Database (same pack, same file, same default poses/styles/quality categories). Each entry in the node is a trio of widgets - category, prompt name, and an enabled checkbox - and when you queue a run, it looks up each enabled entry's text and joins them with your separator:
masterpiece, best quality, cinematic lighting, dramatic shadows, person standing in portrait pose
Order follows entry order: first entry first. A JavaScript extension manages the rows, and it pulls a trick called flexible optional inputs (the same pattern rgthree popularized) so it can add and remove widget rows on the fly - that's why the node's input list changes as you hit ➕. Save a new prompt in Prompt Database and it'll show up in these dropdowns after the workflow reloads.
The inputs and outputs that matter
- separator - what joins the prompts, default
", "(comma plus space). Change it to a newline if you're building something for an LLM encoder that likes line breaks. - prompt_N_category / prompt_N_name / prompt_N_enabled - one trio per stacked entry. The enabled checkbox is the sleeper feature: toggle a block off to A/B it without deleting anything.
- preview_text - ignore it. It's a read-only live preview the JS keeps overwriting; typing your prompt there does nothing useful.
The one output, stacked_prompts, is a plain STRING.
Installing it
Identical to Prompt Database - same pack, so if you have one you have both. No dependencies, no models:
- ComfyUI Manager: install the pack by 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.
Gotchas worth knowing
- Same prompt name in two categories is allowed (the UI filters names by the row's category), but it's a trap for your own head - keep names unique so you know what you're stacking.
- The output is only as good as the blocks. Stacking ten fluff keywords doesn't make a better prompt than the model's own taste; it just makes a longer one. Keep the lean-negative lesson in mind and don't cargo-cult a forty-keyword block.
- Dropdowns refresh when the workflow loads, so a brand-new category needs a reload or node recreation before it shows up - same quirk as Prompt Database.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| separator | STRING | , | — |
| preview_text | STRING | Preview of stacked prompts will appear here... | — |
| prompt_1_categoryopt | COMBO | poses | 3 options: poses, styles, quality |
| prompt_1_nameopt | COMBO | casual sitting | 9 options: casual sitting, posing with camera, photorealistic, minimalist, cinematic, high quality, +3 |
| prompt_1_enabledopt | BOOLEAN | true | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| stacked_prompts | STRING | — |