Nodes/ComfyUI-Addoor/🌻 Text List To String
ComfyUI Node

🌻 Text List To String

Load a folder of text files and merge them

By Eagle-CN·Created 2 years ago·Updated about a year ago· 75
🌻 Text List To String
    • File_Names
    • File_Contents
    • File_Paths
    • File_Names_Suffix
    • Count
    • Merged_Content
    Directory
    Load_Cap100
    Skip_Frame0
    seed0

    The text sibling of the batch image loader. Point it at a folder of .txt or .csv files and it reads them all in - giving you each file's contents separately as a list, and everything merged into one big string. If you work with datasets, caption files, or a pile of prompt snippets, this saves you from wiring up a dozen Load-Text nodes by hand.

    What you'd use it for

    The obvious case is caption files. Train a LoRA and you end up with a folder of image_01.txt, image_02.txt, each holding a caption. When you want to review, transform, or feed those back through a workflow, this pulls the whole set in one node, keeping filenames paired with contents so nothing gets scrambled.

    The other case is prompt libraries. Keep a folder of prompt fragments - one file per theme, style, or scene - and load them all to browse, combine, or step through. The merged output is handy when you genuinely want everything concatenated into a single blob.

    The inputs

    Same shape as the batch image loader, which is nice for muscle memory:

    • Directory - the folder to read (a path on the machine running ComfyUI).
    • Load_Cap - max files to load (default 100).
    • Skip_Frame - skip the first N, for paging through a large set.
    • seed - for selection order.

    The outputs

    Six, and the split between list and single is the important part:

    • File_Names, File_Names_Suffix - the names, with and without extension (lists).
    • File_Contents - each file's text as a separate list entry. This is what you use when you want to keep files distinct and iterate over them.
    • File_Paths - full paths (list).
    • Count - how many it loaded.
    • Merged_Content - every file's text joined into one string. This is the "to string" in the name - when you want the whole folder as a single lump of text, grab this.

    The File_Contents list versus the Merged_Content single string is the decision you make each time. Iterating per-file? Use the list. Want it all as one? Use the merge.

    Watch for

    Like its image cousin, Directory is server-side, so a wrong path gives you an empty load - check Count. And it's txt/csv only; it won't magically read PDFs or docx. Keep your text as plain text files and it just works.

    Installing ComfyUI-Addoor

    ComfyUI Manager: Install Custom Nodes → search "ComfyUI-Addoor" → install → restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Eagle-CN/ComfyUI-Addoor.git
    cd ComfyUI-Addoor
    pip install -r requirements.txt
    

    Restart and look under 🌻 Addoor / Batch, right next to the image batch loader it mirrors.

    Category🌻 Addoor/Batch

    Inputs (4)

    NameTypeDefaultDescription
    DirectorySTRING
    Load_CapINT1001–1000
    Skip_FrameINT00–100
    seedINT00–18446744073709550000

    Outputs (6)

    NameTypeDescription
    File_NamesSTRING
    File_ContentsSTRING
    File_PathsSTRING
    File_Names_SuffixSTRING
    CountINT
    Merged_ContentSTRING