Nodes/Prompt History/Select Prompt From History
ComfyUI Node

Select Prompt From History

Select Prompt From History

By dawncreatescode·Created 3 months ago·Updated about a month ago· 2
Select Prompt From History
  • clip
  • text
  • conditioning
modeedit
text
auto_savetrue
history_pathscustom_nodes/comfyui-PromptHistory/history/prompt_history.json
save_to_pathcustom_nodes/comfyui-PromptHistory/history/prompt_history.json
active_paths
max_entries500000

You know the feeling. You run something brilliant at 2am, close ComfyUI, and the prompt is gone because you never saved it. Or worse, you know it exists somewhere in a 200-node workflow you can't find again. Select Prompt From History is the fix: a drop-in replacement for CLIP Text Encode that writes every prompt you use to a plain JSON file, then lets you search, reload, randomize, or batch-queue them later.

It ships in the small dawncreatescode/comfyui-PromptHistory pack - two nodes, one idea. The author built it for their own workflow and says so: coded for convenience, MIT-licensed, and "unlikely to receive much work unless they break" with future ComfyUI updates. Early adopters are fond anyway; one called the batch queue "genuinely useful." This is a utility, not a showcase. No models, no Python dependencies, no VRAM. Think of it as the rgthree-school kind of QoL node - a small thing that makes your real workflow noticeably nicer.

What it actually does

Every run, the node takes the prompt it used and upserts it into a JSON file with a timestamp and a hit counter. Next session, click Select Prompts… on the node, type a couple of words, and click any past prompt to load it straight back into the graph. No digging through old workflows.

The storage is deliberately boring. History is a plain JSON array - key, text, ts, hits - readable, hand-editable, and trivially shared or backed up. Identical prompts are merged rather than duplicated; reusing one bumps its counter, so your favorites float to the top of a hits-sorted search. Nothing here needs a database or a server.

The three modes

  • edit - uses whatever is in the text widget, normal prompting. New prompts still get saved unless you turn auto-save off.
  • random - picks a random prompt from your active history files each run. Great for revisiting old ideas or letting an overnight batch wander.
  • sequential - steps through the collection in order, one prompt per run, to walk a shortlist methodically.

Two details matter here. First, in random and sequential modes whatever you typed into the text widget is ignored - that's the point, but it trips people up the first time. Second, the node tells ComfyUI to always re-execute in those modes, so random actually advances every run instead of getting cached like most nodes would. Small courtesy, big difference in practice.

The inputs that matter

You'll touch maybe three of these; the schema is honest about the rest being panel-managed:

  • mode and text - the only required inputs. Mode picks edit/random/sequential.
  • clip - optional CLIP model. Connect it and the node outputs conditioning directly, using the same CLIPTextEncode code ComfyUI's built-in node runs. Leave it unplugged and you get a plain text string instead.
  • auto_save - defaults on. Off means that run isn't recorded.
  • history_paths, save_to_path, active_paths - the file plumbing. history_paths lists every file the node knows (one per line), save_to_path is where new prompts land, active_paths is which files random/sequential draw from. You'll rarely type these; the panel's Manage Files… button handles it.
  • max_entries - caps each file (500,000 by default).

Outputs: text (STRING) and conditioning (CONDITIONING). Wire text into your existing CLIP Text Encode (right-click it and convert the text widget to an input), or feed conditioning straight to a KSampler.

Installing it

ComfyUI Manager → search Prompt History → install. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/dawncreatescode/comfyui-PromptHistory

Then restart ComfyUI. The pack's pyproject.toml lists zero Python dependencies - nothing to pip install, no models to download.

When it bites you

The real failure modes, all grounded in how the pack actually works:

  • You reinstall the node and your history vanishes. The default file lives at custom_nodes/comfyui-PromptHistory/history/prompt_history.json - inside the node folder. Point save_to_path and history_paths somewhere stable, like ComfyUI/history/prompt_history.json, if you wipe custom_nodes often.
  • You ran something but it's not in history. Check auto_save. It's on by default, but flip it off for a one-off and that run is the one not recorded.
  • You typed a prompt and random mode ignored it. By design - see the modes above.
  • The conditioning output is empty whenever clip isn't connected. It returns None without a CLIP, so wiring conditioning downstream with none connected gets you nothing.

And the honest one the README itself flags: prompts are stored as plain text on disk. Don't commit your history file to a public repo if any of it is private.

It's a small pack from a hobbyist who'll fix breakage but not much else - fair warning. But the core idea is sound and costs you nothing to try. If you've ever mourned a lost prompt, this is the cheapest insurance there is.

CategoryPrompt Tools

Inputs (8)

NameTypeDefaultDescription
modeCOMBOedit3 options: edit, random, sequential
textSTRING
clipoptCLIP
auto_saveoptBOOLEANtrue
history_pathsoptSTRINGcustom_nodes/comfyui-PromptHistory/history/prompt_history.json
save_to_pathoptSTRINGcustom_nodes/comfyui-PromptHistory/history/prompt_history.json
active_pathsoptSTRING
max_entriesoptINT5000001–10000000

Outputs (2)

NameTypeDescription
textSTRING
conditioningCONDITIONING