DP Line Cycler
Step through a list of prompts, one line per run
- TEXT
If you've ever written a batch of prompt variations, one per line, and then manually copy-pasted each one into CLIPTextEncode to queue them separately, this node is the fix. Paste your whole list in once, pick a cycling mode, and it feeds out one line at a time as you re-queue - no copy-pasting, no separate prompt files.
How it works
Text holds your full multi-line block - think of it as a list where each line is one entry. Cycler_Mode decides how the node moves through that list on each run: increment steps forward one line at a time, decrement steps backward, randomize picks a line at random each run, and fixed always returns the same line, controlled by index. This is the same increment/decrement/randomize/fixed pattern the pack uses elsewhere (its image-folder loader uses an identical scheme for stepping through files), so if you've used one DP cycling node you already know how this one behaves.
The practical workflow: write out a batch of prompt variants - different subjects, different styles, different framing - one per line in Text, set Cycler_Mode to increment, and queue the workflow repeatedly. Each queue advances to the next line automatically. Want to lock onto one specific variant you liked? Switch to fixed and set index to that line's position.
Inputs and outputs
Required:
Text- multiline string, the full list of lines to cycle through.Cycler_Mode-increment,decrement,randomize, orfixed.index- INT, default 0, effectively unbounded (the max is a huge 64-bit-scale number, so treat it as "no practical ceiling"). This is the current position infixedmode, and presumably the running counter state in increment/decrement modes.
One output:
TEXT- the selected line as a string. Wire this straight into a CLIPTextEncode's text input, or anywhere else downstream that takes a string.
How to install it
ComfyUI Manager: search ComfyUI-Desert-Pixel-Nodes. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/DesertPixelAi/ComfyUI-Desert-Pixel-Nodes
Restart, find it under DP/text. No models, no extra dependencies - it's pure text handling.
Common issues & troubleshooting
Same line every time even with increment selected. Check the node isn't being cached by ComfyUI as an unchanged branch - if nothing upstream of it changes between queues, ComfyUI can skip re-executing a node it thinks produced the same output last time. If you suspect this, changing something else in the graph (or forcing a re-run) between queues should get the cycling moving again.
Empty output. Blank lines in your Text block get cycled through just like any other line - if you've got trailing blank lines or accidental double line-breaks in your pasted list, expect the cycler to occasionally land on an empty string. Clean up stray blank lines if that's happening.
fixed mode returns the wrong line. Line indexing here is presumably zero-based (index 0 is the first line), which is the ComfyUI norm but easy to be off-by-one on if you're counting lines by eye. If fixed keeps landing one line off from what you expect, try adjusting index by one in either direction to confirm which convention it's using.
Randomize feels non-random / repeats a lot. With a short list, randomize picking the same line twice in a row is just how random sampling with a small pool works - it's not necessarily broken. If you need guaranteed variety across N queues, increment through the full list is more predictable than randomize for that purpose.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| Text | STRING | — | |
| Cycler_Mode | COMBO | 4 options: increment, decrement, randomize, fixed | |
| index | INT | 00–18446744073709550000 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| TEXT | STRING | — |