โป๐ Loop Sequential (input Lines)
Loop Sequential (input Lines) (Bjornulf_custom_nodes) โ ComfyUI Node Guide
- current_line
- remaining_cycles
- current_line_number
Don't confuse this with the pack's regular Loop (All Lines from input) node - they sound similar and do genuinely different things. That other node runs through an entire text block in one queue click, using ComfyUI's list-execution trick to fire off every line as a separate full run automatically. This node advances exactly one line per actual click of "Run" - it's built for manual, controlled, one-at-a-time stepping through a list, not for firing off a whole batch unattended.
The README's own use case nails why this exists: text-to-speech quality control. Feed a list of sentences in, generate audio for line one, listen to it. Don't like it? Click a -1 button to step back one line, tick overwrite on your TTS node, and regenerate just that line until it sounds right - then move forward. You get manual control over each line without rebuilding your whole prompt list every time you want a redo.
How it works
This is genuinely not the list-execution trick - it's stateful, persisted to disk. Under the hood it keeps a file called counter_lines.txt in ComfyUI/Bjornulf/, tracking which line you're currently on. Each time you actually queue the workflow, it reads that file, outputs the current line, and advances the counter by jump for next time. Run the workflow again and you get the next line, not the same one repeated and not the whole list at once.
Two behaviors worth knowing up front. First: when the counter reaches the last line, the node stops the workflow - it halts execution, preventing anything downstream from running that pass. That's deliberate, not a bug, but it will look like your workflow silently did nothing if you don't know to expect it. Second, and more important if you're building anything non-trivial: don't use more than one of these nodes in the same workflow. They all read and write the same counter_lines.txt file, so two of them in one graph will step on each other's state in ways the README flatly calls "unexpected behaviour."
Inputs and outputs
text (STRING) is the full list you're stepping through, one line at a time. jump (INT, 1โ100, default 1) controls how many lines to advance per run - set it above 1 to skip ahead, or use the node's -1/+1 buttons in the UI to manually nudge the counter without waiting for a normal run. Three outputs: current_line (the text for this step), remaining_cycles (how many lines are left - useful for a Show node while you're working through a long list), and current_line_number (your current position).
Installing it
Bundled with Bjornulf_custom_nodes. ComfyUI Manager โ search the pack title โ install โ restart, or cd ComfyUI/custom_nodes && git clone https://github.com/justUmen/Bjornulf_custom_nodes and restart. No extra dependency for this node.
Common issues & troubleshooting
If your workflow seems to "just stop" with no error, check whether the counter hit the end of your line list - that's expected behavior, not a crash, and the fix is either resetting the counter (the reset button also shows you the next line number) or feeding it a longer list.
If two sequential-line nodes in the same graph are behaving strangely - outputs jumping around, counters not matching what you expect - that's almost certainly the shared-counter-file problem the README warns about directly. The fix is structural: restructure your workflow so only one Loop Sequential (input Lines) node exists per graph, not two feeding different branches.
And because state lives in a file rather than in the node itself, closing and reopening ComfyUI, or loading a different workflow, doesn't reset your position - the counter persists across sessions until you explicitly reset it. That's usually what you want (resume where you left off), but it can be confusing the first time you load an unrelated workflow and this node picks up mid-list from a completely different project.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | โ | |
| jump | INT | 11โ100 | โ |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| current_line | STRING | โ |
| remaining_cycles | INT | โ |
| current_line_number | INT | โ |