📝 String Selector (OreX)
Pick a prompt from a list, one line at a time
- STRING
String Selector is the smallest useful node in the OreX pack: it takes a big multiline block of text, splits it into lines, and hands you the line you ask for. That's the whole job, and for prompt-testing workflows it's surprisingly handy - the kind of node you keep around for ten minutes and then wonder how you lived without it.
What it's for
You know the drill: you have six candidate prompts for a character and you want to A/B test them without dragging six copies of a KSampler across the canvas. Paste all six prompts into strings, one per line, set select to 2, and out comes exactly line 2 as a clean STRING. Feed that into your text encoder or a CLIP Text Encode node and you're testing prompt #2 against the exact same graph. Change select and re-run. It's the poor man's batch scheduler, and honestly most of the time that's all you need.
How it works
Nothing clever under the hood - the node splits the string on newlines and returns the line at index select - 1. Counting starts at 1 (so select: 1 is the first line, which matches how humans think and not how arrays work). Two details worth knowing:
- It wraps around. If your
selectvalue is bigger than the number of lines, it uses modulo arithmetic instead of erroring.select: 7on a 3-line list returns line 1. That's by design, not a bug - but if you're controllingselectfrom another node, remember out-of-range doesn't fail, it just loops. - Empty input returns an empty string, which is a safer default than crashing mid-queue.
Inputs and outputs
Only two inputs exist and both are in required:
strings- the multiline text block. One candidate per line.select- which line to return (1-based, integer).
Output: a single STRING with the chosen line. That's it. No lists, no batch modes, no fancy widgets.
Install
Same pack, same story: ComfyUI Manager (search "comfyui-OreX") or
cd ComfyUI/custom_nodes
git clone https://github.com/orex2121/comfyui-OreX
then restart. No extra dependencies beyond what the pack already installs (Pillow, soundfile). No models, no config files, no API keys - it's pure Python string handling.
The honest caveat
It's a single-output node with no list support, so you can't fan out one strings input to multiple consumers at once. If your real need is running a whole batch of prompts in one queue, you'd reach for a proper batch-prompt node instead. But for quickly flipping through prompt variants by hand - changing one integer and re-running - this is exactly the right tool, and it never gets in your way.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| strings | STRING | — | |
| select | INT | 11–9223372036854776000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |