Nodes/SP-Nodes/Image Load With Meta
ComfyUI Node

Image Load With Meta

Pull the seed (or anything else) back out of a PNG

By bananasss00·Created 2 years ago·Updated 5 days ago· 20
Image Load With Meta
    • image
    • file_name_no_ext
    • out1
    • out2
    • out3
    • out4
    • out5
    • png_info
    path
    prompt_type
    value1[9][inputs][seed]
    value2
    value3
    value4
    value5

    One of ComfyUI's genuinely clever properties is that a generated PNG carries its own workflow inside it - the prompt, the seed, every node's settings, embedded right in the file's metadata. Drag the image back into ComfyUI and the whole graph reconstructs. ImgMetaValueExtractor - labeled "Image Load With Meta" in the node picker - leans on exactly that: it loads an image and pulls specific values back out of that embedded metadata, without you having to reconstruct the whole graph just to steal one number. It's the node behind the README's "Extract Image MetaInfo for Hires" example: grab the seed a past image was generated with, feed it straight into a hires pass, done.

    How the extraction works

    You give it a path to the image and a prompt_type - prompt or workflow, ComfyUI's two different embedded-metadata formats. Then up to five value paths, value1 through value5, each a string. The default on value1 is [9][inputs][seed] - read that as a JSON-path-style key: "in node ID 9's inputs, get the seed field." That default is really just an example, not something you can use as-is on your own images - node IDs are assigned per-workflow by ComfyUI, so "node 9" in one graph is whatever the tenth node happens to be, and might be a KSampler in one workflow and a text box in another. You'll need to actually open the image's embedded metadata (or the workflow view in ComfyUI) to find the real node ID and field name you want before this does anything useful.

    Inputs and outputs

    • path - the image file to read.
    • prompt_type - prompt or workflow, whichever embedded format you're extracting from.
    • value1value5 - up to five JSON-path-style keys into that metadata. Leave the ones you don't need blank.

    Outputs: image (the loaded image itself), file_name_no_ext (handy for naming a hires output after its source), out1out5 (whatever value1value5 resolved to, typed * so they'll connect to almost anything downstream), and png_info - the raw embedded metadata string, useful for eyeballing what's actually in there when you're figuring out your value paths in the first place.

    Installing SP-Nodes

    Manager: search "SP-Nodes," install, restart. Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/bananasss00/ComfyUI-SP-Nodes
    

    Restart after. No model download - reading PNG metadata doesn't need one, and ComfyUI already has whatever it needs to read the format it wrote in the first place.

    Where people get stuck

    By far the most common failure: the image simply doesn't have the metadata anymore. Anything that re-saves or re-compresses a PNG - Discord, Twitter/X, a screenshot tool, converting to JPEG - strips the embedded workflow along with it. If png_info comes back empty, that's almost certainly what happened; you need the original file straight out of ComfyUI's output folder, not a re-uploaded or re-shared copy.

    Second most common: getting the value path wrong. If out1 comes back empty or errors, check png_info first to see the actual structure of what's embedded - node IDs and field names vary per workflow, and the default [9][inputs][seed] is a placeholder, not a universal key. And remember prompt_type has to match what you're actually indexing into - the prompt format and the workflow format aren't structured the same way, so a path that works against one won't necessarily resolve against the other.

    CategorySP-Nodes

    Inputs (7)

    NameTypeDefaultDescription
    pathSTRING
    prompt_typeCOMBO2 options: prompt, workflow
    value1STRING[9][inputs][seed]
    value2STRING
    value3STRING
    value4STRING
    value5STRING

    Outputs (8)

    NameTypeDescription
    imageIMAGE
    file_name_no_extSTRING
    out1*
    out2*
    out3*
    out4*
    out5*
    png_infoSTRING