Nodes/ComfyUI-TinyBee/Get List From File
ComfyUI Node

Get List From File

Load a Text File as a Real List

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Get List From File
    • string_list
    file_path./

    There's a version of every ComfyUI user's workflow that starts with a plain text file full of prompts, names, or paths - and a moment where you realize the file's contents aren't the same as a list. Get List From File closes that gap: point it at a path, and it reads the file line by line into a proper list of strings you can iterate, shuffle, or index. It's the front door for a huge fraction of batch workflows, and it's about as simple as a node gets.

    How it works

    One input, one output:

    • file_path - a full or relative path to a text file. Default is ./. This is a manual string input, so you type the path (or wire it from a node that produces one); there's no file browser built in.
    • string_list (output) - the file's lines as a list, one string per line.

    The behavior details matter more than the implementation: each line has whitespace stripped, and empty lines are dropped entirely. So a file with blank lines between prompts comes out clean - no empty-string entries gumming up your list downstream. That's a genuinely nice default, and it's also the thing to know if you ever want an empty string in the list; you can't have one.

    The node re-runs on every workflow execution (its change detection is forced), so if you edit the file and re-queue, you get fresh contents. It's one of the more eager nodes in the pack that way - no caching surprises.

    Where you'd actually use it

    • Prompt batches: a prompts.txt with one prompt per line, loaded and piped into TinyBee's Decorate List (to add quality prefixes) and then into a per-line generation loop.
    • Filename lists: feed it a list of paths, filter it with Filter Existing Files, and generate only what's missing - a classic "resume the batch" setup.
    • Seed or LoRA lists: any one-entry-per-line data. Pair with Indexed Entry to walk the list one item at a time.

    Installing it

    This is part of ComfyUI-TinyBee (look for the 🐝TinyBee/Lists category once it's installed):

    1. ComfyUI Manager → Install Custom Nodes → search "ComfyUI-TinyBee" → Install.
    2. Restart ComfyUI.

    Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/TinyBeeman/ComfyUI-TinyBee
    

    Restart and you're done. No models to fetch, and the dependencies are effectively nil for this node - the pack's requirements.txt lists pillow and jsonata, but Get List From File is pure standard-library file I/O and touches neither.

    Gotchas

    Path resolution is the thing that'll bite you. ./ resolves relative to where ComfyUI is running (its working directory), not to your output folder, so a relative path like ./prompts.txt can silently point somewhere you didn't expect. When in doubt, use an absolute path, or wire the path from another node that already resolved it. Also remember the empty-line-stripping: if your file uses blank lines as intentional separators, they won't survive. And since the file is re-read every run, a half-written file (say, still being saved by another process) can produce a partial list - give it a beat before queuing.

    Category🐝TinyBee/Lists

    Inputs (1)

    NameTypeDefaultDescription
    file_pathSTRING./

    Outputs (1)

    NameTypeDescription
    string_listSTRING