Multiline String Repeater
When your prompt list needs to be as long as your frame count
- multiline_text
Multiline String Repeater is a tiny text-shaping utility from NodeSweet that does exactly one thing: takes a multiline string and repeats its lines. It exists because a recurring ComfyUI annoyance is alignment - you've got a batch of 30 frames and a prompt list that's 2 lines long, or a single prompt that needs to stretch across a video, and somewhere a node is quietly mis-matching them.
The mechanism couldn't be simpler: split the text on newlines, repeat per your chosen mode, join back up with newlines. Two modes, and the difference matters:
- Line by Line - each line is repeated
repeat_each_linetimes before the next line starts:hello, world× 2 becomeshello, hello, world, world. Use this when you want each individual item to occupy N consecutive slots, e.g. one prompt per frame with N frames per shot. - Block - the entire text block is repeated as a group:
hello, world× 2 becomeshello, world, hello, world. Use this when you want a full prompt cycle repeated, like a looping video where the whole sequence plays N times.
The inputs are the three you see on the node: multiline_text (the multiline input box), repeat_each_line (an int, 1–100, default 1 - so it's also a pass-through at the default), and repeat_type (the two-mode dropdown). There's one multiline_text output. If you feed it an empty string, it returns an empty string rather than choking, which is the kind of defensive touch you learn to appreciate in a pack this size.
Why would a beginner reach for it? Pair it with a batch-count requirement: generate a prompt per frame for an AnimateDiff-style pass, repeat a negative prompt so it lines up with a batched loader, or inflate a short list so a following node that iterates per-line gets the count it expects. It's a utility node - nothing glamorous, no models, no performance implications - and it slots in wherever you're matching text lists to batches.
Installation is shared with the rest of the pack: ComfyUI Manager → search "Batch BBox Detector" → Install, or
cd ComfyUI/custom_nodes && git clone https://github.com/rslosch/comfyui-nodesweet
then restart ComfyUI. No dependencies beyond ComfyUI core, no model files.
Honest caveats: it's text-only - there's no fancy interpolation or templating here, and no trim of stray blank lines, so a trailing newline in your input will show up as an empty line in the output. And if you're repeating to align with a batch, count your lines carefully: Line by Line with repeat_each_line = 4 on 10 lines gives you 40 entries, and if your batch is 30 frames you've just created a new mismatch. It's a small node, but it's the kind of thing that turns a "why is my video wrong" hour into thirty seconds.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| multiline_text | STRING | The input text where each line will be repeated | |
| repeat_each_line | INT | 11–100 | Number of times to repeat |
| repeat_type | COMBO | Line by Line | Line by Line: repeat each line individually (hello\nhello\nworld\nworld). Block: repeat all lines as a group (hello\nworld\nhello\nworld) |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| multiline_text | STRING | — |