Unblend Line Counter
A line counter that remembers where it was
- line_number
- info
The Unblend pack is mostly attention surgery, but this node is just a counter - and it's the piece that turns "I have a text file of prompts" into "I left it running and came back to a hundred images." UnblendLineCounter hands a line number to a Text Load Line From File node and advances itself, which sounds trivial until you remember that ComfyUI primitive inputs don't do that on their own.
How it works
The counter lives in the ComfyUI process's memory and ticks on every execution (it reports itself as always-changed, so it never gets skipped as a "nothing changed" no-op). Four modes cover the usual cases:
repeat- stays on one line for N runs, then moves on. The sweet spot: four variations of the same prompt, then the next one.increment- +1 on every run, like a seed counter. Pairs with the Scene Book to walk a whole prompt collection in order.random- a random line instart_line..max_lineeach run.fixed- alwaysstart_line. Useful when you want the counter present in the graph without it doing anything.
max_line makes the counter wrap, so it won't run off the end of your file and start feeding a nonexistent line.
The inputs that matter
Really just three: mode, start_line, and repeats (for repeat mode). max_line matters when your file has a definite length and you want wrapping; reset is there for when you want to jump back to the start mid-run.
Outputs: line_number (the INT that goes into the index of your Text Load Line From File node) and info - a text log like line 12 | mode repeat | repeat 3/4 | run 7, which is genuinely useful when you're babysitting a batch.
Install
Part of the pack, so the standard two options:
cd ComfyUI/custom_nodes
git clone https://github.com/LatentDesireAI/ComfyUI-Unblend
pip install -r ComfyUI-Unblend/requirements.txt
Or skip all that - ComfyUI Manager, search "Unblend", Install, restart.
When things go wrong
The state is in memory, not on disk. Restart ComfyUI and the counter resets to start_line - if your batch died at line 47 and you restart, you're back at the top unless you set start_line accordingly. Also, changing start_line, repeats, or mode resets the internal count by design (it re-anchors on the new settings), so don't touch those mid-run and expect it to keep its place. And remember the output is the index into the file loader - if your file loader is 1-based and the counter starts at 0, the first line will be skipped until you align the two.
It's a boring node. That's the compliment - the interesting ones in this pack are the ones doing the masking and refining; this one just keeps the queue honest.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| start_line | INT | 00–100000000 | — |
| mode | COMBO | 4 options: repeat, increment, random, fixed | |
| repeats | INT | 41–100000 | — |
| max_line | INT | 00–100000000 | — |
| reset | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| line_number | INT | — |
| info | STRING | — |