Random List Picker
Randomize your prompts without touching the LLM (it's the best node in the pack)
- selected_item
- prompt
- item_count
- selected_index
Here's the thing nobody tells you about this pack: the Random List Picker is the node you'll use most, and it has nothing to do with LM Studio. It's a pure prompt-utility - paste a newline-separated list of anything, and every run it picks a random one (or several) and assembles a ready-to-use prompt string. It doesn't need a server, a model, an API key, or even LM Studio installed. You could clip it out of this pack and never notice it was supposed to ship with an LLM suite.
Randomness in prompts is a classic ComfyUI move - the community's been wrapping alternatives in {this|that|the other} wildcards and batching for years to generate variety without writing more prompts. This node is that idea with a bigger toolbox: weighted picks, templates, exclusions, and a seed you can pin for reproducibility. If you're generating variations, character-reference libraries, or just don't want to hand-write fifty prompts, this is the honest path.
The inputs that matter
items(required) - one item per line. The weighted syntax is the fun part: append::weightand it gets proportionally more likely, sojazz::3is three times as likely as a plainpop. Default weight is 1. Empty lines are ignored.template- a prompt with{item}as the placeholder, e.g.Create a {item} song with heavy bass.When set, this overridesprefix/suffix. Whencountis more than 1, the picked items are joined with the separator first, then substituted in.prefix/suffix- used whentemplateis empty. Prepends and appends text around the picked item(s).exclude/fallback- exclude a newline-separated list of items you never want (case-insensitive), and if the list ends up empty after exclusions,fallbackis what comes out.count- how many unique items to pick. Capped at list size automatically.separator- how multiple picks are joined. Default", ".case-original|uppercase|lowercase|title|sentence. Instant case transformation per item.mode-pickgrabs random item(s);shufflereturns the entire list in a random order.seed- -1 for a new random result every run; pin any other value to reproduce a specific draw.
Outputs
Four pins. selected_item is the chosen item(s) joined with the separator; prompt is the fully assembled result (template or prefix+item+suffix) - wire that straight into CLIP Text Encode or a Text Gen node. item_count tells you how many usable items survived exclusions, and selected_index gives the zero-based position of the first pick (-1 in shuffle mode), which is handy if you want other nodes to react to which item got chosen.
A concrete example: three random genres, weighted toward jazz:
items:
rock
pop
jazz::3
classical
hip-hop
count: 3
template: Generate artwork combining {item}.
Each run you get something like Generate artwork combining watercolour, impressionist, cyberpunk. - same template, different material every time. One light aside: the ::weight syntax is a per-line thing, so if your items legitimately contain :: (a namespace, a file path), you'll want to check how they parse - it's an edge case, but it exists.
Install and gotchas
Install exactly like the rest of the pack - ComfyUI Manager (search "LM Studio"), or git clone https://github.com/mattjohnpowell/comfyui-lmstudio-image-to-text-node into custom_nodes - but you don't need to bother with pip install lmstudio or a running server for this one. It's plain Python; it just works. The only real gotchas are the ones you create: forgetting a template/prefix/suffix so the output is a bare item, or a seed pinned when you actually wanted variety. Set it to -1 and let it roll.
The reason it lives in an LLM pack is probably the author's own workflows - a random genre feeds the Text Gen node, which writes the prompt. And honestly, using them together is a great loop: let the picker inject the subject, let the local LLM handle the prose. But standing alone, it's a genuinely useful little utility that deserves more than its zero Google impressions.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| items | STRING | rock pop jazz::2 classical hip-hop | One item per line. Empty lines are ignored. Weighted syntax: item::weight (e.g. jazz::3 is 3× more likely). Default weight is 1. |
| templateopt | STRING | Prompt template with {item} as a placeholder. Example: 'Create a {item} song with heavy bass.' When count > 1, items are joined with the separator before substitution. Overrides prefix/suffix when non-empty. | |
| prefixopt | STRING | Text prepended before the chosen item(s). Used when template is empty. | |
| suffixopt | STRING | Text appended after the chosen item(s). Used when template is empty. | |
| excludeopt | STRING | Items to never pick, one per line. Matching is case-insensitive. | |
| fallbackopt | STRING | Value returned when no items remain after exclusions. | |
| countopt | INT | 11–100 | Number of unique items to pick. Automatically capped at list size. |
| separatoropt | STRING | , | String used to join multiple picked items (e.g. ', ' ' | ' '\n'). |
| caseopt | COMBO | original | Case transformation applied to each picked item. |
| modeopt | COMBO | pick | pick – choose random item(s) from the list. shuffle – return the entire list in a random order. |
| seedopt | INT | -1-1–2147483647 | Random seed. Use -1 for a new random result each run. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| selected_item | STRING | — |
| prompt | STRING | — |
| item_count | INT | — |
| selected_index | INT | — |