Random Text (Classic)
Pure variety every run
- text
- text_path
- debug
Sometimes you don't want reproducibility. You want a new prompt every single run, full stop. Random Text (Classic) is the stripped-down member of this pack: point it at a folder and every time the graph runs it grabs a random file and hands you the contents as a string. No seed input, no memory, no "avoid repeats" logic - just random.choice() over whatever's in the folder.
It's the simplest node in the pack, and it's the author's answer to a specific gripe: most wildcard implementations have lousy variance, and pure {a|b|c}-style substitution (the old A1111 syntax that still runs through packs like Impact Pack) tends to re-roll the same handful of options. Classic doesn't try to fix that distribution - it just makes "pick a file" as raw as it gets. One run, one file, next run, a different one, no promises about which.
How it works
Two lines do the heavy lifting. The node collects every file in folder matching the comma-separated extensions (default .txt,.prompt,.md), then random.choice() picks one. The part worth understanding is ComfyUI caching: this node's change signature returns a random value on every call, which tells ComfyUI "this output is always new, don't serve me a cached result." That's what forces a fresh pick on every execution. It's deliberate, not a bug - without it, ComfyUI would happily hand you the same file until you nudged a widget.
Inputs and outputs
There's exactly one required input:
folder- absolute path to your prompt library.
Everything else is optional: include_subfolders, extensions (add your own, comma-separated), encoding (utf-8), errors (replace), and debug_info. Outputs are the same trio as the rest of the pack:
text- the file's contents as a STRING; wire it into CLIP Text Encode.text_path- full path of the picked file.debug- empty unlessdebug_infois on.
Install
Manager search "LoadRandomText", install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/thezveroboy/ComfyUI-LoadRandomText
Restart and you're done. No dependencies beyond the Python standard library, no model downloads, nothing heavy.
Common issues
- "Folder ... cannot be found" - relative path or a typo. Use the absolute path.
- "No valid text files found" - your file extensions aren't in the list. Add
.txt,.prompt,.md,.cfgor whatever you actually use. - The real gotcha: you can't go back. Fall in love with a result and there's no seed to recover the file from. If you were smart enough to wire
text_pathinto a display node before you ran it, the answer is saved in the workflow; otherwise it's gone. If you think you might want to reproduce a run, swap this node for the Seed variant - it's the same pack, and it's a two-second change.
Classic is the node to grab when you're exploring or batch-generating for a cherry-pick and you want maximum spread. Just know what you're signing up for: pure surprise, zero receipts.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | STRING | — | |
| include_subfoldersopt | BOOLEAN | false | — |
| extensionsopt | STRING | .txt,.prompt,.md | — |
| encodingopt | STRING | utf-8 | — |
| errorsopt | STRING | replace | — |
| debug_infoopt | BOOLEAN | false | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |
| text_path | STRING | — |
| debug | STRING | — |