ComfyUI Node

Load Any File

Load text, images, masks, and metadata from any file with glob patterns

By geroldmeisinger·Created 9 months ago·Updated about 12 hours ago· 183
Load Any File
    • content
    • image
    • mask
    • metadata
    annotated_filepath

    Most of ComfyUI's loaders are picky: there's a Load Image, a Load Text, a Load something-else, and heaven help you if you want to load a dozen files at once. Load Any File is the pack's blunt instrument for all of it - it reads any text or binary file, hands you the content (as text or base64), and tries to load it as an image, and tries to pull metadata. One node, four outputs, and it does all of them whenever it can.

    The real power is in the filepath. annotated_filepath supports glob patterns via Python's glob.iglob, so a single path like subdir/**/*.png expands to every matching file, and the node emits an output list - one entry per matched file. Downstream nodes then run once per file. That's how you "load all images from a folder" as a list, or feed a pile of CSVs into Spreadsheet OutputList, without scripting anything.

    Paths are annotated, not absolute: it defaults to your [input] directory, and you can switch bases by appending [input], [output], or [temp] - note the leading space. For security only those three directories are allowed, and the number of files is capped at 1024.

    The outputs

    • content - file contents as a string for text files, base64 for binary files.
    • image - the file as an image batch tensor, when it's an image.
    • mask - mask batch tensor, when the file has one.
    • metadata - EXIF/workflow metadata. This is the interesting one.

    The metadata gotcha

    metadata calls exiftool via the pyexiftool package - but only if the exiftool command is actually installed on your system. If it isn't, it silently falls back to PIL.Image.info, which gives you PNG chunk info (including ComfyUI's embedded workflow) but not full EXIF. On Ubuntu/Debian that's one install:

    sudo apt install libimage-exiftool-perl
    

    Without exiftool you still get ComfyUI's embedded workflow via the PIL fallback, which is what most people actually want - the pack's whole metadata workflow (Load Any File metadata → JSON OutputList $["PNG:Prompt"] → Workflow Discriminator) works without it. But if you need camera EXIF or XMP, install the binary.

    Installing

    Search "OutputLists Combiner" in ComfyUI Manager, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/geroldmeisinger/ComfyUI-outputlists-combiner
    cd ComfyUI-outputlists-combiner
    uv pip install -r requirements.txt
    

    Restart after. Dependencies include chardet (encoding detection) and pyexiftool - no model downloads. If a glob returns nothing, check that you used [input] (or whichever base) with the space - it's the most common typo, and the node just returns empty lists when the path misses.

    CategoryUtility

    Inputs (1)

    NameTypeDefaultDescription
    annotated_filepathSTRINGBase directory defaults to `[input]` user-directory. Supports glob-pattern expansion `subdir/**/*.png`. Use suffix ` [input]` ` [output]` or ` [temp]` (mind the leading whitespace!) to specify a different ComfyUI user-directory.

    Outputs (4)

    NameTypeDescription
    contentSTRINGFile content for text files, base64 for binary files.
    imageIMAGEImage batch tensor.
    maskMASKMask batch tensor.
    metadataSTRINGExif data from ExifTool. Requires `exiftool` command to be available in `PATH`.