FERandomPrompt
A random prompt straight from your autocomplete file
- output
Prompt variety is the cheap way to explore a seed's potential - and the laziest way to get it is to let the computer pick from a list you already have. FERandomPrompt does exactly that: it reads a text file, samples count lines from it, joins them with commas, and hands you a ready-to-encode prompt string. Seeded, so you can reproduce the exact random prompt that produced a great image.
The clever bit is the default file. It points at ComfyUI-Custom-Scripts/user/autocomplete.txt - the autocomplete dictionary maintained by pythongosssss's ComfyUI-Custom-Scripts pack, which thousands of people already curate. If you have that pack installed, this node starts out useful with zero setup, because it's mining the same tag list you already autocomplete from.
Inputs and output
read_from- the text file path, relative to yourcustom_nodesfolder. DefaultComfyUI-Custom-Scripts/user/autocomplete.txt; point it at any line-based text file you like.count- how many lines to sample,0–75, default1.seed- reproducibility.
Output: output, a STRING - the sampled lines joined with ", ", ready for a CLIP Text Encode or a prompt node.
How it works, and the format quirk
The node reads the file, and for each line keeps everything before the last comma (rsplit(',', 1)[0]). That's designed for the autocomplete file's line format, where entries can carry a trailing weight or category after a comma. For a plain list of tags, every line just passes through whole.
It caches the file contents and only reloads when the file's modification time changes - so edits to your autocomplete.txt show up on the next run without a restart. And like the pack's other random nodes, it's an always-change node: it re-rolls every queue execution, which is the entire point.
Two things to know:
- If
countexceeds the number of lines in the file, it asserts and dies. Keepcountmodest. - The sample is without replacement, so you won't get duplicate lines in one output.
Where to use it
This is a wildcard-style node in the spirit of the bracket trick and classic wildcard workflows the KB documents - but instead of parsing {a|b|c} syntax inline, you're drawing from a flat file. For tag-based models (Illustrious, Pony, the Danbooru-style stack), a comma-joined random tag list is exactly the input they want. Roll a few "random style + subject" prompts, batch them, and you've got a cheap variety engine.
Install
From fexli-util-node-comfyui:
cd ComfyUI/custom_nodes
git clone https://github.com/fexli/fexli-util-node-comfyui
cd fexli-util-node-comfyui
pip install -r requirements.txt
Or Manager → search fexli-util-node-comfyui → install → restart. Light dependencies, no config.yaml. (And if you don't have ComfyUI-Custom-Scripts installed, either install it or point read_from at your own text file - it's just a list of tags per line.)
It's the "I can't be bothered to think of a prompt" node, and it's honest about it. Sometimes that's exactly the workflow you need.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| read_from | STRING | ComfyUI-Custom-Scripts/user/autocomplete.txt | — |
| count | INT | 10–75 | — |
| seed | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | STRING | — |