Wildcards Text File Loader
One text file in, one line out
- selected_line
This is the no-frills version of a wildcard node. No bracket syntax to learn, no template language - you point it at a plain .txt file, one entry per line, and it hands you back a line. Either a specific one, or a random one. That's the entire node.
Why you'd reach for it
The classic wildcard-file pattern - keep a list of forty character names, or poses, or backgrounds in a text file instead of jamming them all into one unreadable {a|b|c|d|...} block inline - is old, well-worn practice in this ecosystem, and Impact Pack's own wildcard system runs on exactly that idea. This node gives you the simplest possible version of it, bundled with the Animagine pack: no dependency on a bigger pack, no syntax beyond "one line = one option." It's genuinely handy for things you edit and grow over time - a running list of character names, outfits, settings - kept as a plain file you can open in any text editor, separate from the workflow itself.
How it works
file_path points at your .txt file. Each line in that file is one candidate. line_index picks which one: a specific 0-based index, or -1 (the default) for random. When it's random, seed controls the pick - per the node's own tooltip, it's the seed for random selection, with -1 meaning a time-based seed each run. Nothing ships pre-made; you write and maintain the list files yourself.
Inputs and outputs
Just the three inputs above, and one output: selected_line, a plain string. Wire it wherever that piece of the prompt belongs - into a CLIPTextEncode directly, into another text node for further assembly, or into Animagine Prompt's positive_prompt if you're building up a scene from parts.
Installing it
Comes bundled with the pack - no separate install. ComfyUI Manager: search ComfyUI-Animagine-Prompt. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/gmorks/ComfyUI-Animagine-Prompt
then restart. This node is pure file I/O - no model downloads, no extra Python dependency beyond what the rest of the pack already needs.
Where people get burned
Use an absolute path for file_path. Relative paths get resolved against wherever the ComfyUI process was started, not against your workflow file or your wildcards folder, and a bad relative path is the single most common reason this node throws a file-not-found instead of a line. Second, the same caching trap that hits every random-pick node in ComfyUI applies here: if you leave line_index at -1 and the "random" pick isn't actually changing between runs, right-click the seed widget and set "control after generate" to randomize - otherwise ComfyUI sees unchanged inputs and just reuses the cached result. Last: this node is deliberately minimal - it doesn't merge multiple files, doesn't recurse into folders, doesn't dedupe. It was added to the pack specifically because someone wanted basic wildcard-file support and the original release didn't have it, so treat "it only reads one file's lines" as the intended scope, not a missing feature. If you need several files combined, that's what Multi-Wildcard Loader is for.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| file_path | STRING | — | |
| line_index | INT | -1 | Index of line to select (-1 for random) |
| seed | INT | -1-1–4294967295 | Seed for random selection (-1 for time-based seed) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| selected_line | STRING | — |