ComfyUI Node

Text Line Combine

The node that turns three prompt files into one

By ReinerBforartists·Created about a year ago·Updated about a year ago· 1
Text Line Combine
    • STRING
    text_a
    text_b
    use_text_cfalse
    text_c
    text_a_path
    text_b_path
    text_c_path
    separator

    If you've ever hand-rolled "line 1 of prompt A + line 1 of prompt B" combos in a spreadsheet, Text Line Combine is that spreadsheet, as a node. It takes up to three chunks of text, pairs them up line by line, and joins each matching row with a separator you pick. That's the entire job - no model downloads, no API keys, no pip dependencies beyond Python's stdlib. It comes from Reiner Prokein (the same Reiner behind the Bforartists Blender fork, hence the repo name), it's GPL-licensed, and it's small enough that the whole pack is one file.

    Why you'd reach for it

    ComfyUI is great at generating variations and genuinely bad at organizing them. If you want every combination of three subjects, three lighting setups, and three moods, your options are usually an Impact Pack wildcard node (which loads random lines from files) or a chunky scripted approach. Text Line Combine is the middle path: you write each column yourself, line by line, and it emits every row as its own line of output. You can then save that as a text file or feed it straight into a prompt encoder.

    The name is not misleading about anything - it doesn't call an API, needs no key, and works offline.

    How it works

    The mechanism is simpler than most nodes you already run. Each input is split into lines, the lists are padded to the longest one, and then line i of text A is joined to line i of text B (and C) using the separator. The results are re-joined with newlines and handed out as a single STRING. A few details are worth knowing before they bite:

    • A file path overrides the raw text. If text_a_path is filled in, whatever's in that file wins over what you typed in text_a. This is the number-one surprise here: leave a stale path sitting in the field and your nicely-typed prompt is silently ignored.
    • Empty lines vanish. The node skips any line that's empty when building each row. That's actually the padding mechanism - shorter columns just contribute nothing past their last line - but it also means you can't deliberately keep a blank line in your output.
    • If a file can't be read, you get the literal string "An error occured" (typo and all, straight from the source). It flows right into your prompt, so a wrong path shows up as garbage text rather than an error dialog. Fun.

    Inputs and outputs

    All inputs are required in the schema, but only a few matter for most uses:

    • text_a and text_b - your two columns of lines, typed directly into the multiline boxes.
    • use_text_c - the checkbox that decides whether column C exists at all. Leave it off and text C is ignored even if you type in it.
    • text_c - the third column, only included when the checkbox is on.
    • text_a_path / text_b_path / text_c_path - absolute paths to files. Fill one in and it replaces that column's typed text.
    • separator - the glue between columns on each row. Default is a single space, which is usually right for prompts. Use , if you want tag-list output.

    The single output is a STRING. Wire it into any text input - a CLIP text encoder, or a pysssss ShowText/SaveText if you just want to look at or store the result. And because it's a plain string, you can chain nodes: feed one CombineTextLines' output into another's text_a to merge more than three sources. The example workflow in the repo shows exactly that shape.

    Installing

    Two ways, both easy:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ReinerBforartists/comfyui_text_line_combine
    

    Then restart ComfyUI and look in the Text category for "Text Line Combine". Or skip the terminal entirely - ComfyUI Manager finds it if you search the pack title, which installs and updates it for you. There are no extra dependencies to fetch and no model files; this is one of those packs where the README and the shipped code agree that you're done in thirty seconds.

    Common gotchas

    The stale-path override is the classic. If output looks wrong, check all three *_path fields first - a leftover path silently beats whatever you typed. The second is the empty-line behavior: if your combination output has fewer lines than you expected, count blank lines in your columns; they're being dropped, not preserved. And remember paths need to be absolute and point at files ComfyUI's process can actually read, since a miss just produces that charming typo string in your output.

    It's a tiny, boring, reliable utility - exactly what you want when the alternative is doing this by hand.

    CategoryText

    Inputs (8)

    NameTypeDefaultDescription
    text_aSTRING
    text_bSTRING
    use_text_cBOOLEANfalse
    text_cSTRING
    text_a_pathSTRING
    text_b_pathSTRING
    text_c_pathSTRING
    separatorSTRING

    Outputs (1)

    NameTypeDescription
    STRINGSTRING