Adam 591aa08da4 feat: carry captured text forward across queued runs and tabs
- True runs remember captured text per (tab path, node) with a token.
  Off runs whose widget hadn't received it use the remembered text and
  update the embedded metadata. IS_CHANGED includes the carried token, so
  prompts queued ahead pick it up
- Scope pushed prompt updates to the tab the run was queued from, fixing
  captured text overwriting a same-id node in another open workflow
- Nodes fetch missed text when a workflow loads or its tab is re-opened
- In-memory only; tokens are compared by equality, so restarts are safe
- Saver and Passthrough get hidden stash_tab/stash_token inputs (appended
  last, no socket or widget, not saved in widgets_values)
2026-10-18 16:28:52 -07:00
2025-08-23 04:27:54 -07:00
2024-11-12 18:49:43 -08:00
2024-11-03 16:36:03 -08:00
2025-08-23 04:27:54 -07:00

Prompt Stash Node for ComfyUI

Overview 📚

Prompt Stash is a simple plugin for ComfyUI that lets you save your prompts and organize them into multiple lists. It also features pass-through functionality, so you can hook it up to an LLM node (or any text outputting node) and capture its outputs directly—no more tedious copy-pasting! 🙌

I created this because I couldn't find any nodes that would let me cache a prompt or create and save prompts. I wanted an easy way to cache results from the LLM and store them for later use. So, I made this plugin, and I hope others find it useful too. 😊

Workflow Diagram

Features ✨

  • NEW!⭐ Nodes 2.0 Compatible: Works with both the legacy LiteGraph renderer and the new Vue-based Nodes 2.0 renderer.
  • Import / Export: Save and share your prompt file, import will merge and won't overwrite anything.
  • Save Prompts: Easily save prompts with a custom name for quick access.
  • Multiple Lists: Organize your prompts into different lists or categories.
  • Pass-Through Functionality: Connect to LLM nodes and capture their outputs directly into the plugin.
  • Pause & Edit: Pause workflow execution to edit prompts in real-time.
  • Persistent Storage: Your prompts and lists are saved between sessions.
  • Shared Library: All nodes share the same prompt library across your workflow.

How to Use 🛠️

Prompt Stash Saver Node

This node lets you save, load, and manage your prompts.

  1. Add the Node: Place the Prompt Stash Saver node into your graph.

  2. Input Text:

    • Option 1: Type directly into the Prompt Text field.
    • Option 2: Connect another node (like an LLM node) to the input. Toggle Use Input to use the connected input.
  3. Select a List: Use the List dropdown to choose which list you're working with.

  4. Save a Prompt:

    • Enter a name in the Save Name field.
    • Click Save Prompt. 💾
    • If you use an existing name, it'll overwrite the old prompt.
  5. Load a Prompt: Choose a prompt from the Load Saved dropdown to load it.

  6. Delete a Prompt: Select a prompt and click Delete Selected to remove it. 🗑️

  7. Outputs:

    • text: The prompt text.
    • meta: A JSON string describing the prompt, for use with JSON-aware nodes (e.g. to put the prompt name in a filename):
      {
        "prompt_name": "Bob",     // save name, else loaded name, else "llm input" when fed from the input
        "list_name": "characters",
        "source": "saved",        // "saved" | "manual" | "input"
        "save_as_key": "Bob",
        "load_saved": "Bob",
        "use_input_text": false
      }
      

Prompt Stash Passthrough Node

This lightweight node allows you to modify text as it passes through your workflow.

  1. Add the Node: Place the Prompt Stash Passthrough node into your graph.

  2. Input Text:

    • Option 1: Type directly into the Prompt Text field.
    • Option 2: Connect another node to the input. Toggle Use Input to use the connected input.
  3. Pause to Edit (Optional):

    • Enable the Pause to Edit toggle if you want to pause workflow execution.
    • When paused, you can edit the text in real-time.
    • Click Continue when you're done editing to resume the workflow.

Captured Text Carries Forward

When Use Input captures new text (e.g. from an LLM), later runs with Use Prompt use that text even if the node never received it in the browser -- for example runs you queued ahead, or a workflow tab you'd switched away from. Switching back to the tab updates the Prompt Text box to the latest captured text. Updates only go to the tab the run was queued from, so another open workflow's prompt is never overwritten. (Remembered until ComfyUI restarts.)

Every Nth Queue Node

Outputs True once every N runs, False otherwise. Connect it to Use Input on a Saver or Passthrough to refresh the prompt from an LLM every N runs and reuse it in between.

  1. every: how many runs per True.
  2. The status line shows True next run or True in N runs.
  3. Buttons: Next (True on the next run), Delay +1 (push the next True back one run), Reset (start a full N-run countdown).

The countdown is resolved when you queue, so on the False runs the LLM doesn't run and everything after the stash node stays cached. The countdown is saved with the workflow; running a single output node ("run" on a node) doesn't advance it.

Prompt Stash Manager Node

This node helps you manage your prompt lists and workflow state.

  1. Add the Node: Place the Prompt Stash Manager node into your graph.

  2. Add a New List:

    • Enter a name in the New List Name field.
    • Click Add to create the list. ➕
  3. Delete a List:

    • Select a list from the Existing Lists dropdown.
    • Click Delete to remove it. 🗑️
    • Note: You cannot delete the last remaining list.
  4. Sort a List:

    • Select a list from the Existing Lists dropdown.
    • Click Sort A-Z to reorder its prompts alphabetically (case-insensitive).
    • The new order is saved to the file, so it applies to every Saver node's Load Saved dropdown and to exports.
  5. Export:

  • Save the file so you can back it up or share it.
  • The file itself is always stored in your ComfyUI user directory.
  1. Import:
  • You can select any exported file to import.
  • It will merge with any existing lists.
  • Prompts with the same name will have (#) added to them so they don't overwrite.
  • If you want to delete all your prompts, just delete the file in ComfyIU/user/prompt_stash/ and then refresh and it will be recreated.
  1. Clear Paused State:
    • If any workflows were closed while paused or the pause button vanishes, click Clear All Paused to reset all pause states.
    • This helps prevent workflows from getting stuck in a paused state.

Installation 📥

  1. Download the Plugin: Clone or download this repository.

  2. Install in ComfyUI: Place the plugin folder into your custom_nodes directory inside ComfyUI.

  3. Restart ComfyUI: Restart the application to load the new nodes.

License 📝

This project is licensed under the Apache License 2.0.


Thanks for checking out Prompt Stash! If you have any feedback or suggestions, feel free to reach out or contribute. Happy prompting! 🚀


S
Description
No description provided
Readme Apache-2.0
2.4 MiB
Languages
JavaScript 70.5%
Python 29.5%