Prompt History Input
A CLIP Text Encode that actually remembers your prompts
- clip
- CONDITIONING
ComfyUI has no built-in prompt history. If you came from Automatic1111, that's the kind of thing you don't realize you're missing until you're hunting through notes, comment blocks, and screenshot folders for the exact wording that gave you that one good image. Prompt History Input is a drop-in replacement for the stock CLIP Text Encode node that quietly logs every prompt you run - and then shows you what each one made.
The trick is that it isn't a separate "save this" step. It is your text encoder. Same two inputs, same CONDITIONING output, so it swaps into any existing workflow without rewiring anything. But while it encodes, it also writes the prompt to a SQLite database, and a companion web extension gives you a searchable history dialog, popup previews when a generation lands, and a gallery of past gens. It's a tiny piece of your own personal prompt museum.
How it works
Mechanically it does exactly what CLIP Text Encode does: tokenizes your prompt with the supplied CLIP model and calls encode_from_tokens_scheduled to produce conditioning. That call is what actually feeds the sampler - so your workflow behavior is identical to before, which is the whole point.
What's different lives around that call. First, the node's IS_CHANGED returns the current time, which is a deliberate poke: it tells ComfyUI this node is never cacheable, so it executes on every graph run. That's how an unchanged negative prompt still gets captured run after run. Each execution then does a cheap insert-or-touch against the history database, defaulting to prompt_history_gallery/data/prompt_history.db inside the pack folder.
Second, a background watcher thread polls ComfyUI's prompt queue and links the images that a run actually produced back to the prompts that produced them, then pushes a websocket update so the UI refreshes live. Nice detail: if a run saves real output images, it deliberately ignores the temp/preview images - so intermediate ControlNet previews don't litter your history when a proper save node is present.
The inputs that matter
- clip - the CLIP model from your checkpoint loader or a dedicated CLIP loader, same as any text encode.
- prompt - your prompt, multiline, defaults to empty. This is the text that gets logged.
That's it. The single output is CONDITIONING, and it wires to the positive or negative input of your sampler exactly where your old text encoder did. Wire up one for the positive and one for the negative, and both sides of every run get remembered.
Using the history
Each node gets a History button in the UI. Click it and you get a dialog of recent prompts, grouped by text and sorted by recent use, with the latest thumbnail, image count, and tags when available. You can search by prompt text or tags, then send a prompt straight back to a node (falls back to copy if none is active), copy it, delete it, or jump into the full gallery. It's global across all your workflows, which is the genuinely useful part - prompts live in one place, not scattered through a dozen graphs. Settings let you tune the history limit, frequent-prompt highlighting, and popup preview size, duration, and position.
Installing it
Either search "Prompt History Gallery" in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/x0x0b/ComfyUI-PromptHistoryGallery
Then restart ComfyUI. There are no Python dependencies and no model downloads - pyproject.toml lists none, and the whole thing runs on the ComfyUI runtime plus the standard library. That's a small blessing in a pack ecosystem where half the install pain is dependency conflicts.
Watch out for
The obvious trap: your history lives inside the pack's own folder, and ComfyUI doesn't back it up. If you delete the custom node directory, you delete your prompt database too. Copy prompt_history_gallery/data/prompt_history.db somewhere safe before uninstalling, or set the COMFYUI_PROMPT_HISTORY_DIR environment variable to keep it somewhere you control. And be honest about expectations - this is a young, small pack with barely any footprint yet, so you're the early adopter, not the crowd. For a zero-effort memory upgrade to your prompt workflow, that trade is easy to live with.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| prompt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CONDITIONING | CONDITIONING | — |