๐ฒ Random line from input
Paste a list, get one random line back โ no node chain needed
- STRING
Before this node existed, getting a random choice out of a list of prompt fragments meant chaining a Write Text node for every single option into a Random Text node - workable for three or four choices, miserable for thirty. This node collapses that entirely: paste a block of text where each line is one option, and it picks a random line out of it. No per-option nodes, no rewiring when you add a new line to the list.
How it works
The author built this specifically to solve the "copy/paste a list from outside" problem - you keep your list of camera angles, character names, style tags, or whatever else in a plain text block (in the node itself, or fed in from a file-loading node elsewhere in the pack), one option per line, and this node returns exactly one of them at random. seed controls which line gets picked; the widget next to it gets ComfyUI's usual fixed/increment/decrement/randomize control, so set it to randomize if you want a different line every time you queue, or fixed if you want the same pick to repeat.
It's a small node doing one job, and that's the appeal - it's the fastest way to get "pick a random one of these ten things" into a graph without touching more than a single node.
The inputs and outputs that matter
text- the block of text to pick from, one option per line.seed(default 1) - determines which line is selected; pair with the control widget to decide whether it's reproducible or fresh each run.- Output: a single STRING - the chosen line.
How to install it
Through ComfyUI Manager: search Bjornulf_custom_nodes, install, restart ComfyUI. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/justUmen/Bjornulf_custom_nodes
cd in, pip install -r requirements.txt (a venv keeps this from colliding with other packs), restart. No special dependency for this node beyond what the shared package needs to load.
Common issues
If you're always getting the same line back, check the seed's control widget - it defaults to behavior that's easy to leave on fixed by accident. Set it to randomize for a fresh pick each queue.
Blank lines and trailing whitespace in your pasted list are worth double-checking too - since the node is just splitting on line breaks, an accidental empty line at the end of your list is technically a valid (if uninteresting) option it can select, and stray leading/trailing spaces on a line will ride along into whatever you're using the output for. If a "random" pick keeps coming back oddly empty or malformed, that's the more likely explanation than the node itself misbehaving.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | โ | |
| seed | INT | 1 | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | โ |