ComfyUI Node

Prompt Cache (Soze)

Keep a prompt around without retyping it

By SozeInc·Created 2 years ago·Updated 3 months ago· 10
Prompt Cache (Soze)
  • use_new_prompt
  • output_prompt
  • is_new_prompt
  • status
new_prompt

The workflow this solves: you're iterating on a prompt, you land on one you like, and now you want several generations locked to that exact text - different seeds, different samplers - without leaving the new-prompt field populated and risking a typo or an accidental edit resetting your run. Prompt Cache is a single toggle that switches between "use what I just typed" and "reuse whatever I cached last time I flipped that toggle on."

How it works

use_new_prompt is the switch. Set it true, type into new_prompt, and the node stores that text as the cache and passes it straight through as output_prompt, with is_new_prompt reporting true. Flip use_new_prompt to false and the node ignores whatever's in new_prompt, returning the previously cached value instead - is_new_prompt comes back false. It's effectively a one-slot memory with a manual write flag.

Worth checking rather than assuming: the schema doesn't say whether the cache is written to disk or just held in the running ComfyUI process's memory. Given this pack's other nodes are explicit about reading and writing files (Load/Save/Append Text), and this one has no file path input at all, it reads like an in-memory cache - meaning it likely resets on a full ComfyUI restart, unlike the file-backed nodes elsewhere in the pack. Confirm that yourself if you're relying on it surviving between sessions.

The inputs and outputs that matter

  • use_new_prompt (required, BOOL, default true) - the write/reuse switch.
  • new_prompt (required, STRING) - the text to cache when the switch is on.

Outputs: output_prompt (the string to actually use downstream), is_new_prompt (BOOL - useful for gating: wire this into a switch so something only fires, like a "log this as a new version" branch, on the runs where the prompt actually changed rather than every single queue execution), and status.

How to install it

ComfyUI Manager → search "ComfyUI_Soze" → install → restart. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt

then restart. Plain string logic, no external dependency.

Common issues & troubleshooting

If your output prompt isn't updating when you expect it to, the first thing to check is use_new_prompt - it's a common trap to keep editing new_prompt while the switch is still off from a previous run, and wonder why nothing changes.

Since there's a real chance this cache doesn't persist across a ComfyUI restart, don't build a workflow that depends on it surviving one - if you need a prompt to genuinely persist between sessions, pair this with Save Text File To Output and Load Text From File to back it with an actual file instead of trusting in-memory state.

Categorystrings

Inputs (2)

NameTypeDefaultDescription
use_new_promptBOOLtrue
new_promptSTRING

Outputs (3)

NameTypeDescription
output_promptSTRING
is_new_promptBOOL
statusSTRING