Nodes/ComfyUI_LoadImageWithMetaDataEx/Load Image with Metadata (From Filepath)
ComfyUI Node

Load Image with Metadata (From Filepath)

Read an image's stored metadata from a filepath you wire in — and batch it

By Zachary116699·Created about a year ago·Updated about a year ago· 2
Load Image with Metadata (From Filepath)
    • image
    • Metadata RAW
    filepathinput/example.png

    ComfyUI bakes the whole graph into the PNG it saves - that metadata is the reason people can share one image and get the workflow back by dragging it onto the canvas. But the built-in Load Image node doesn't hand that to you for files you open. Its prompt and extra_pnginfo inputs carry the metadata of the image the workflow is currently saving, not the file you loaded. So if you want to actually read what's stored inside an arbitrary image - pull the prompt out of a folder of PNGs, log every generation in a batch, audit what produced an old render - vanilla ComfyUI gives you nothing to grab it with. This node exists for that gap.

    Load Image with Metadata (From Filepath) is a tiny, single-node pack, and the author says it up front: the code is mostly copied from Crystools' "Load Image With Metadata" node, with one change that's the whole point. Crystools' original picks files from a dropdown of whatever sits in your input folder. This one takes the filepath as a connected string input instead - which is exactly what you need when a loop is handing you paths one at a time. It's a niche fix, not a revolution, but the niche is real: reading metadata across many images is miserable with dropdown pickers, and this turns it into a normal dataflow problem.

    How it works

    Give it a path, and it returns the image plus a Metadata RAW dict in the same shape Crystools uses - so it plugs straight into Crystools' "Show Metadata" node for display. Under the hood it opens the file, applies EXIF orientation, and builds the metadata dict per format:

    • PNG - reads the text chunks. ComfyUI's workflow and prompt chunks get JSON-parsed for you; any other text metadata is kept as a string.
    • JPEG - walks the EXIF tags, including the GPS IFD.
    • WebP - a piexif pass tries to grab prompt/workflow from EXIF, wrapped in a try/except. Some WebP files just don't carry it, and you get a thin dict instead of an error.

    It always adds a fileinfo block: filename, resolution, file size, and last-modified date as a string. For a batch-logging job that's a chunk of the record for free.

    The one input and two outputs

    There's exactly one thing to set: filepath (STRING, default input/example.png). That's it. Paths resolve relative to where ComfyUI runs, so input/foo.png for files in your input folder, or an absolute path if you prefer. The README is explicit that it's a single string - no string lists - so when you batch a folder you feed paths one per loop iteration, not all at once.

    • image (IMAGE) - the loaded image as a float tensor; wires into anything that takes an image.
    • Metadata RAW (METADATA_RAW) - the metadata dict; route it into Crystools' Show Metadata to actually look at it.

    Install

    Easiest: in ComfyUI Manager, search LoadImageWithMetaDataEx and install. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Zachary116699/ComfyUI-LoadImageWithMetaDataEx
    

    Then restart ComfyUI. That's the whole install - no model downloads, no requirements.txt, and the dependencies (Pillow, torch, numpy, piexif) are all things ComfyUI already ships. You'll find it under the LoadImageWithMetadataEx category.

    Gotchas

    • The path must exist. The node raises FILE_NOT_FOUND if it can't open the path, and there's no picker to rescue you - a typo is a hard error, not a soft warning.
    • Relative paths resolve against ComfyUI's working directory, not your workflow's folder. Launch from elsewhere and input/example.png won't resolve.
    • It reads a real file on disk, so the image you dragged onto the canvas (a temp preview) won't work - save it first.
    • It's essentially one Crystools function with the input type changed, so don't expect active maintenance. If you already run Crystools and don't need the loop-driven filepath, just use the original.

    Will you reach for this every day? Probably not - unless you're the person who needs to read stored metadata across many images in a loop, in which case it's a small, sharp tool with no real vanilla alternative. It's barely been found yet (zero search impressions); if this is your use case, that scarcity is your gain.

    CategoryLoadImageWithMetadataEx

    Inputs (1)

    NameTypeDefaultDescription
    filepathSTRINGinput/example.png

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    Metadata RAWMETADATA_RAW