Select Prompt Pair From History
Select Prompt Pair From History
- clip
- positive
- negative
- positive_conditioning
- negative_conditioning
If you read the sibling node's page, most of this is familiar - same pack, same three modes, same JSON history, same dead-simple install. What makes Select Prompt Pair From History its own node is in the name: it remembers a positive and a negative prompt as a single entry, and keeps them locked together when you randomize or cycle.
That matters if you have a real negative prompt practice. On the SDXL lineage - Illustrious, NoobAI, Pony, the models where negatives still do actual work - people curate pairs: a "masterpiece, best quality" positive and a specific defect-naming negative that took ages to dial in. Store them separately and random mode will happily hand you a great positive with the wrong negative attached. This node pulls both halves from the same history entry, so a pair always stays a pair.
One caveat you should hear before you get too excited: on guidance-distilled models like Flux Dev, or the Turbo/Lightning line, the negative prompt does nothing at CFG 1 - that's a property of the model, and the designers made CFG 1 the recommended setting. The node will happily save and encode negatives for those models; they just won't steer anything. On the SDXL family, where the negative is arguably the single most useful text field you have, this is the node you actually reach for.
How it works
Same machinery as the single-prompt node, one extra field per entry. History is a plain JSON array of positive, negative, ts, and hits; identical pairs merge and bump the hit counter. In random or sequential mode the node draws one entry and uses both of its halves - the source code is explicit that "both prompts are pulled from the same history entry so they always stay together." It also tells ComfyUI to always re-execute in those modes, so random genuinely advances run to run instead of being cached.
The one feature the pair node has that the sibling doesn't is a search scope dropdown next to the search toggles: match against the positive (default), the negative, or both. If you remember a great negative but not what it was attached to, search negative-only and you'll find it. Case-sensitive, whole-word, and regex modes work the same as the sibling.
Inputs and outputs
Required inputs are mode (edit / random / sequential) plus the two text fields, positive and negative. Optional inputs:
clip- connect a CLIP and the node returns both conditionings, so you can replace the entire two-CLIP-text-encode section of an SDXL workflow.auto_save- defaults on; off means that run isn't recorded.history_paths,save_to_path,active_paths- same file plumbing as the sibling, managed via Manage Files… in the panel. Default file isprompt_pair_history.jsoninside the pack'shistory/folder.max_entries- caps each file at 500,000 pairs by default.
Outputs: positive and negative (STRING) for your own encoder, plus positive_conditioning and negative_conditioning (CONDITIONING) when clip is connected - the latter both run through the same CLIPTextEncode code the core node uses. Wire the positives to the KSampler's positive, the negative conditioning to its negative, done. If you leave clip unplugged, the conditioning outputs are None, so don't wire them.
Installing it
ComfyUI Manager → search Prompt History → install. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/dawncreatescode/comfyui-PromptHistory
Restart ComfyUI. The pack ships with zero Python dependencies (pyproject.toml is empty of them), so there's no pip step and no model to download. Find the node under Add Node → Prompt Tools → Select Prompt Pair From History.
When it bites you
- You're searching for a negative and nothing comes back. The scope dropdown defaults to positive-only. Switch it to negative or both.
- The negative does nothing on your model. Not the node's fault - if your checkpoint is guidance-distilled and you're running CFG 1, the negative is inert by design. Test on an SDXL-lineage model if you want proof it works.
- A reinstall wiped your history. The default path is inside the node's own folder; point
save_to_pathandhistory_pathsoutsidecustom_nodes/if you rebuild often. - Privacy, doubled. Pairs are stored as plain text on disk, and negatives are often the most personal thing in a prompt. Keep history files out of public repos.
Same caveat as the sibling: this is a small hobbyist pack, maintained on a "fix it if it breaks" cadence. But the pair-locking mechanic is genuinely hard to find elsewhere, it's free and dependency-free, and for SDXL prompt hoarders it's one of the better quality-of-life installs around.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | edit | 3 options: edit, random, sequential |
| positive | STRING | — | |
| negative | STRING | — | |
| clipopt | CLIP | — | |
| auto_saveopt | BOOLEAN | true | — |
| history_pathsopt | STRING | custom_nodes/comfyui-PromptHistory/history/prompt_pair_history.json | — |
| save_to_pathopt | STRING | custom_nodes/comfyui-PromptHistory/history/prompt_pair_history.json | — |
| active_pathsopt | STRING | — | |
| max_entriesopt | INT | 5000001–10000000 | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| positive | STRING | — |
| negative | STRING | — |
| positive_conditioning | CONDITIONING | — |
| negative_conditioning | CONDITIONING | — |