Nodes/Prompt Gallery/🎨 快速保存Prompt
ComfyUI Node

🎨 快速保存Prompt

Keep the prompts that actually worked, with one click

By Lotus0614·Created 6 months ago·Updated 19 days ago· 31
🎨 快速保存Prompt
      ◄prompt_name►
      ◄category▾►
      ◄prompt_value—►

      This is the "don't lose the good one" node. You generate something you like, you've fiddled with the prompt for an hour, and the temptation is to copy it into a text file you'll never open again. Instead you wire the winning prompt text into this node, give it a name, pick a category, and run once - it's now a saved prompt in your gallery, searchable, cover-bearing, ready to be selected by PromptsSelector in any future workflow. It's the inbound half of the loop that SaveToGallery closes on the image side.

      It's a thin utility and it knows it: no outputs, no processing, just "put this string in the library under that name."

      How it works

      Three inputs, all straightforward:

      • prompt_name - the display name the prompt gets in the gallery. The node refuses to save with an empty name.
      • category - the target category from a dropdown of your existing categories. The dropdown is snapshotted at load, so a brand-new category may need a page refresh to appear.
      • prompt_value - the actual prompt content. This one is forceInput, so it's meant to be wired from a string output (your CLIP Text Encode's text, or a note node) rather than typed - that's what makes it "quick."

      The save runs in a background thread so the workflow isn't blocked. The logic is simple upsert: if a prompt with the same name already exists in that category, its value is updated to the new text; otherwise a new prompt is created. Same name, same category → overwrite. That's the whole contract, and it's exactly right for a node whose job is "keep this current version."

      Errors - like an empty name or empty value - print to the ComfyUI console and don't crash the graph. Check the console if the save silently didn't happen.

      Where you'd use it

      Two patterns worth stealing. One: keep a "current best" prompt per subject - wire your sampler's text into QuickSavePrompt with a fixed name, and every good run quietly refreshes your library's canonical version. Two: use it mid-iteration as a save point - liked a variation? Name it portrait v3, rerun, move on. The gallery stays the source of truth without you ever hand-copying text.

      Install

      Same pack-wide steps as everything in Prompt Gallery. ComfyUI Manager → search "Prompt Gallery", or:

      cd ComfyUI/custom_nodes
      git clone https://github.com/Lotus0614/ComfyUI-Prompt-Gallery
      cd ComfyUI-Prompt-Gallery
      pip install -r requirements.txt
      

      Windows portable: ..\..\python_embeded\python.exe -m pip install -r requirements.txt. Light deps (Pillow, optional pyahocorasick), no model downloads. Restart ComfyUI and hard-refresh the browser afterwards.

      Common issues

      • Saved prompt not in the gallery - it's asynchronous, so give it a beat and refresh. If it never appears, check the ComfyUI console for a "[QuickSavePrompt]" error; empty name/value are the usual culprits.
      • Name collision surprise - same name in the same category updates the value. Use distinct names if you want history preserved.
      • Category dropdown missing a category you just made - reload the page; the list is built when ComfyUI loads its node definitions.

      Keep the prompt, throw away the guilt about not filing it. That's the whole point of this node.

      Category🎨 Prompt Gallery

      Inputs (3)

      NameTypeDefaultDescription
      prompt_nameSTRING—
      categoryCOMBO1 options: 全部
      prompt_valueSTRING—

      Outputs (0)

      No outputs