Nodes/ComfyUI-TinyBee/Get File List
ComfyUI Node

Get File List

Turn a folder into a workflow input

By TinyBeeman·Created about a year ago·Updated about a month ago· 1
Get File List
    • file_list
    path./
    glob_pattern**/*
    sort_methoddefault
    sort_ascendingtrue
    seed0
    allowed_extensions.jpeg,.jpg,.png,.tiff,.gif,.bmp,.webp
    dest_path

    There's a whole class of ComfyUI workflows that are really just "do something to every file in this folder." Batch upscaling, batch img2img, processing a folder of reference images. The thing every one of those needs is a list of filenames, and Get File List is the node that produces it - it globs a directory into a STRING list with filtering and sorting built in.

    It's the front door for batch processing in this pack. Hand it a path and a glob pattern and it walks the directory tree, filters to the file types you care about, sorts the results, and hands you a list you can feed into a batch loop, a picker, or a save/compare chain. Everything downstream that works on lists can now work on your actual files.

    How it works

    Under the hood it's Python's glob with recursive=True: it joins your path with glob_pattern and collects every match, recursively. Then it applies the extension filter, sorts according to your choice, and returns the list. The default pattern **/* grabs everything in the tree; the default extension list is your standard image set.

    The inputs that matter:

    • path (STRING, default ./) - where to look. Relative paths resolve against ComfyUI's working directory, so absolute paths are usually the safer bet.
    • glob_pattern (STRING, default **/*) - **/* for all files recursively, or something like *.png to narrow the glob itself.
    • sort_method - default, date (by file modification time), filename, parent folder, full path, or random (seeded by the seed input).
    • sort_ascending (BOOLEAN, default on) - flip for newest-first or reverse alphabetical.
    • allowed_extensions (STRING, default .jpeg,.jpg,.png,.tiff,.gif,.bmp,.webp) - comma-separated; leave blank to allow everything.
    • dest_path (STRING, optional) - this one's clever: it excludes files whose base name already exists in dest_path, regardless of extension. Built for "skip images I already converted."

    The output is file_list, a list of full paths ready for the next node.

    Installing it

    Get File List is one node in ComfyUI-TinyBee, the small MIT-licensed utility pack from TinyBeeman. No models, no heavy deps. Via Manager:

    1. ComfyUI Manager → Custom Nodes Manager.
    2. Search "ComfyUI-TinyBee" and install.
    3. Restart ComfyUI.

    Or clone:

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

    Restart and it lives under 🐝TinyBee/Lists. Its jsonata dependency is only for the pack's JSON Parser node.

    Gotchas

    Path discipline is the thing that bites. ./ is relative to where ComfyUI launched, which is rarely where you think it is - when in doubt, use an absolute path. The date sort reads file mtime, so it reflects disk time, not the name. And dest_path matching is by base name with extension stripped, so photo.png in the source is skipped if any photo.* exists in dest. Pair the output with Filter List or Randomize List for the full batch-processing pipeline.

    Category🐝TinyBee/Lists

    Inputs (7)

    NameTypeDefaultDescription
    pathSTRING./
    glob_patternSTRING**/*
    sort_methodCOMBOdefault6 options: default, date, filename, parent folder, full path, random
    sort_ascendingBOOLEANtrue
    seedINT00–18446744073709550000
    allowed_extensionsoptSTRING.jpeg,.jpg,.png,.tiff,.gif,.bmp,.webp
    dest_pathoptSTRING

    Outputs (1)

    NameTypeDescription
    file_listSTRING