π CR Text Cycler
Turn lines of text into a repeating batch list
- STRING
- show_text
CR Text Cycler takes a block of text - one item per line - and turns it into a list you can drive a batch with, with control over how many times each line repeats and how many times the whole set cycles. It's the text version of a loop: write five prompts, tell it to repeat each three times and loop the set twice, and you get a 30-item list that ComfyUI iterates over run by run.
This is the node for structured variety. Say you've got four style phrases and you want three images of each - Text Cycler gives you that exact schedule without manually duplicating anything. Or you're feeding an animation where a caption should hold for N frames before changing; the repeat count handles the dwell time.
How it works
You put your items in the text box, one per line. repeats is how many times each line appears consecutively before moving to the next. loops is how many times the entire sequence runs. So with lines A/B/C, repeats=2, loops=2, you get A A B B C C A A B B C C. The output is a ComfyUI list, which means downstream nodes execute once per item - that's what makes it a batch driver rather than just a string.
The distinction between repeats and loops matters more than it looks: repeats clusters copies of the same line together (good for dwell/hold), while loops re-runs the whole ordered set (good for cycling through variety multiple times). Mix them to get the exact cadence you want.
The inputs and outputs that matter
text- your items, one per line (multiline). This is the source list.repeats- consecutive copies of each line. Think "hold this for N."loops- how many times to run the full sequence.
Outputs:
STRING- the cycled list (wildcard type, flagged as a list so it fans out downstream). Wire it into a CLIP encode or wherever your per-item text goes.show_text- a preview of what got generated, so you can eyeball the schedule.
How to install it
Comfyroll Studio (Suzie1 and RockOfFire), a mature utility pack - no models, no heavy dependencies.
- ComfyUI Manager - search Comfyroll Studio, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/Suzie1/ComfyUI_Comfyroll_CustomNodes.git, then restart.
Also on CivitAI.
Common issues
The two levers, repeats and loops, are easy to conflate - if your batch cadence looks wrong, that's almost always which of the two you set. Check show_text to confirm the actual sequence before blaming anything else. And mind the total: lines Γ repeats Γ loops is your run count, and every item is a full execution, so a long text block with high repeats can balloon into far more generations than you meant. Do the multiplication before you queue.
If the node doesn't appear at all, that's the pack load failure: Comfyroll Studio: Failed to load ... with NameError: name 'CR_HalftoneGrid' is not defined in the log. The NameError is a symptom of a real import error higher up - usually an incompatible Pillow version from another custom node - that can take the whole pack down. Reinstall Pillow (pip install --upgrade --force-reinstall pillow) into ComfyUI's Python and restart.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | β | |
| repeats | INT | 11β99999 | β |
| loops | INT | 11β99999 | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| STRING | * | β |
| show_text | STRING | β |