Get Line
The node that reads one line of a prompt block so you can queue them all
- line
You've got five camera setups you want to try on the same subject, or eight edit instructions you want to run on one image, and you're about to re-type them one at a time. Stop. Get Line turns one multiline block into a queue: it spits out a single line, and then auto-advances to the next line every time you run. Paste your prompts as one prompt per line, hit queue, and ComfyUI walks through all of them for you.
It's a three-function utility from Sean Bradley (sbcode), the same author behind a bunch of ComfyUI tutorial nodes. There is nothing clever hiding in it - and that's the point. It's the smallest piece of glue that makes "generate one image per prompt line" workflows work.
How it works
The whole thing is a few lines of Python. It takes your text, calls splitlines() on it, and returns the line at index. Two details matter:
- It wraps instead of crashing. The actual index is
index % len(lines), so if you tell it line 10 of a 3-line block, you get line 0 again. You can queue 200 jobs on a 4-line prompt and it'll loop through them forever instead of erroring out. - The index auto-increments. The widget is wired with
control_after_generate: increment, so after each run the index moves up by one. That increment is what makes the "one line per run" trick work without you touching anything between generations.
Empty input returns an empty string rather than blowing up. It handles \r\n and \n both, so copy-pasting from Windows notepad won't leave stray carriage returns in your prompts.
The inputs and outputs that matter
Only two inputs, both required, and a beginner only really sets one of them:
- text (STRING, multiline) - your block of prompts, one per line. This is the whole job.
- index (INT, default 0) - which line to grab. You mostly leave it alone because the auto-increment moves it for you. Remember it's zero-based: line 1 is index 0. That trips people up more than you'd think.
The single output, line (STRING), wires straight into your positive prompt, into a text node for an image-editing model like Qwen-Edit, or into anything else that takes a string. That's it - nothing optional, no mode switches.
Installing it
Zero dependencies, zero model downloads, pure Python stdlib. This is the friendliest install in the ecosystem. Either:
ComfyUI Manager - search for get line, get-line, or getline, and hit Install.
Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/Sean-Bradley/ComfyUI-Get-Line
Restart ComfyUI and the node appears under the SBCODE category. Because there's no requirements.txt, you also skip the classic custom-node pain point of a dependency silently breaking something else - this pack installs into the same Python environment without changing anything in it.
Common gotchas
The one real trap is the auto-increment. If you set the index widget by hand, expect it to keep marching forward as you re-run - that's a feature when you're iterating a queue, but it's confusing the first time you wonder why you're suddenly getting line 4 of your prompt block. Switch the widget's control_after_generate to "fixed" if you want a stable line.
The other is the obvious one: you asked for line 1 and got line 2, because indexing starts at zero. Count from zero and you'll be fine.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | A cat A dog A bird | — |
| index | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| line | STRING | — |