Nodes/ComfyUI Batch BBox Detector/Multiline String Repeater
ComfyUI Node

Multiline String Repeater

When your prompt list needs to be as long as your frame count

By rslosh·Created 11 months ago·Updated 5 months ago· 1
Multiline String Repeater
    • multiline_text
    multiline_text
    repeat_each_line1
    repeat_typeLine by Line

    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_line times before the next line starts: hello, world × 2 becomes hello, 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 becomes hello, 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.

    Categorynodesweet-hellorob

    Inputs (3)

    NameTypeDefaultDescription
    multiline_textSTRINGThe input text where each line will be repeated
    repeat_each_lineINT11–100Number of times to repeat
    repeat_typeCOMBOLine by LineLine by Line: repeat each line individually (hello\nhello\nworld\nworld). Block: repeat all lines as a group (hello\nworld\nhello\nworld)

    Outputs (1)

    NameTypeDescription
    multiline_textSTRING