Prompt File Selector
Your saved prompts, in a dropdown — no re-pasting ever again
- prompt
If you keep your best prompts in a notes file and hand-copy them into CLIP Text Encode every time you want to reuse one, this node is your life raft. Prompt File Selector is exactly what it says: a dropdown that lists every prompt you've saved as a .txt file, with a live preview of the full text right in the node body. Pick #3 | Cyberpunk City from the list, the preview updates instantly, and the STRING output feeds straight into your text encoder.
It's a small, honest utility from a small pack (pk_promptselector - two files, no model downloads, no pip dependencies). It won't win awards, but it does one job well: turning a folder of prompts into a selection menu so you stop retyping. It is not a wildcard/randomizer - it won't auto-pick from a set each run. This is a deliberate picker, and if that's what you want, it's refreshingly simple.
How it works
The node reads every .txt file in ComfyUI/user/default/prompts/ (the folder is created automatically when the pack loads - that's folder_paths.base_path/user/default/prompts, hardcoded, so it ignores a custom --user-directory). Each file is split into blocks on ---, and each block becomes one dropdown entry, numbered across all files: #1 | Title, #2 | Title, and so on. If a block has Title|prompt text, the part before the first | is the menu label. No title? The first line becomes the label, truncated to 60 characters.
Two things happen when you select. First, a bundled copy of every prompt's text is sent to the browser, and a small JS widget paints it into a read-only textarea on the node - that's the real-time preview, no queueing needed. Second, on execution the backend re-reads the files, looks up the index from your #N | Title selection, and returns the full text as a STRING. Because IS_CHANGED returns your selection, switching the dropdown marks the node dirty and re-runs the downstream graph - changing prompts never requires manually re-queueing.
The one input, the one output
prompt_option(dropdown) - everything you set. If the folder is empty, you'll see(no prompt found).prompt(STRING) - wire it intoCLIP Text Encode, your positive prompt, or any node that takes a string.
File format
Cyberpunk City|A detailed photo of a cyberpunk city,
neon signs reflecting on wet asphalt, volumetric fog.
---
Portrait Studio|Studio photography of a portrait, 85mm lens.
---
This line becomes the title. Everything else is the prompt.
Blocks are split on ---, so keep that delimiter out of your prompt text. Only the first | is the title separator; any later | stays in the prompt.
Install
Via ComfyUI Manager: search "pk_promptselector" and install. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/magnetowasnotright/pk_promptselector
Restart ComfyUI. That's it - no requirements.txt, no models, nothing heavy. One small trap: the README's folder diagram says the install lands in promptselect/, but a plain clone creates pk_promptselector/. Both work; just don't go hunting for the wrong folder name.
Gotchas
- The dropdown is baked at node load. Add a new
.txtor edit titles while ComfyUI is running and the menu won't refresh - re-add the node or restart the server. (The text is re-read at execution, so edits to an existing block's content do take effect without a restart.) - Preview widget missing? The preview is a custom DOM widget, and the Nodes 2.0 frontend rewrite has a documented history of breaking third-party node rendering (see the rgthree saga). If the textarea doesn't appear, flip back to the legacy canvas.
- Empty file, malformed block, no files? You'll get
(no prompt found)in the dropdown and""out ofprompt.
Good prompt hygiene is half the battle in ComfyUI. This node just makes it painless.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt_option | COMBO | 1 options: (no prompt found) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| prompt | STRING | — |