Nodes/Craftgear Nodes/A1111 Metadata Reader
ComfyUI Node

A1111 Metadata Reader

The A1111 Metadata Reader

By craftgear·Created 8 months ago·Updated 6 months ago· 1
A1111 Metadata Reader
    • positive_prompt
    • negative_prompt
    • model json
    • loras json
    • steps
    • sampler
    • cfg_scale
    • seed
    • size
    • clip_skip
    • raw_parameters
    image_path

    You know that feeling when you see a gorgeous image on Civitai, download it, and want to know exactly how it was made? If it's from the SD 1.5/SDXL era, the generation settings are sitting right there in the file - A1111-style metadata with the prompt, negative, sampler, steps, CFG and seed. A1111 Metadata Reader (class name A1111WebpMetadataReader) digs that string out of an image file and returns every field as a separate output you can wire straight back into your graph. It's the reading half of this pack's metadata pair, and it pairs neatly with the Checkpoint Selector and Load LoRAs With Tags.

    Don't be put off by the class name - "Webp" is a legacy of when it started. It reads WebP, PNG, and JPEG.

    How it works

    Give it an image_path and it resolves the file: the path as-is, else under ComfyUI's input directory, else by basename. Then it extracts the metadata by format:

    • WebP - the EXIF UserComment from the RIFF container.
    • PNG - parameters / Extparameters style text chunks (tEXt, zTXt, iTXt).
    • JPEG - EXIF UserComment.

    The raw string is then parsed into fields using key-name matching - Steps:, Sampler:, CFG scale:, Seed:, Size:, Model hash:, Clip skip:, plus Hashes/Lora hashes and Civitai resources: when present.

    The outputs that matter

    • positive_prompt, negative_prompt - feed the positive into a text node and you've recovered the original prompt.
    • model json - {"name":"","hash":"","modelVersionId":""} shaped. This is the one you wire into Checkpoint Selector's model_json input to load the exact checkpoint.
    • loras json - a JSON list of LoRAs. Wire it into Load LoRAs With Tags' loras_json input and it stacks them at strength 1.0 automatically.
    • steps (INT), sampler (STRING), cfg_scale (FLOAT), seed (INT), size, clip_skip (INT) - set your KSampler to match, or just read them off.
    • raw_parameters - the untouched string, for when you want to eyeball everything at once.

    The node also has a preview area, and drag-and-drop works for .webp/.png/.jpg/.jpeg.

    Install

    Search craftgear in ComfyUI Manager and install a numbered release (the nightly option in the version screen fails on security restrictions), or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/craftgear/comfyui-craftgear-nodes
    

    Restart ComfyUI. No models, no extra dependencies.

    Where people get burned

    • All-empty outputs. If metadata is missing or unparseable, the node returns empty defaults ('', 0, {}, []). So a clean-looking result of zeros doesn't mean it failed to read the file - it means the file genuinely has no A1111 metadata. ComfyUI-native PNGs carry the workflow JSON, not parameters, so a pure ComfyUI image will read empty unless something wrote A1111-style metadata into it. That's what the pack's own A1111 Metadata Writer is for.
    • Path resolution. It tries your input folder and then a basename match, so a filename that exists in multiple places can resolve to an unexpected file. Give it the full path if you're working outside input.
    Categorycraftgear/image

    Inputs (1)

    NameTypeDefaultDescription
    image_pathSTRING

    Outputs (11)

    NameTypeDescription
    positive_promptSTRING
    negative_promptSTRING
    model jsonSTRING
    loras jsonSTRING
    stepsINT
    samplerSTRING
    cfg_scaleFLOAT
    seedINT
    sizeSTRING
    clip_skipINT
    raw_parametersSTRING