Nodes/AAA Metadata System/Eric's Metadata Query V3
ComfyUI Node

Eric's Metadata Query V3

Eric's Metadata Query V3

By EricRollei·Created 10 months ago·Updated 8 months ago· 13
Eric's Metadata Query V3
    • result
    • metadata
    input_filepath
    query_modesimple
    queryai_info.generation.model
    default_valueunknown
    sourceauto
    fallback_sourcestrue
    return_fullfalse
    format_outputtrue
    debug_loggingfalse

    You know that feeling when someone posts a killer image, you save it, and you can't remember the model or seed? Eric's Metadata Query V3 is the node that answers that from inside ComfyUI. Point it at an image file, give it a path like ai_info.generation.model, and it walks the file's metadata and hands you the value. It's the read side of this pack's save-with-metadata system, and it's the node that makes "conditional workflow" a real thing instead of a buzzword.

    The core inputs are three: input_filepath (where the file lives - feed it from Eric Load Image Extended's full_path output, or paste it), query_mode, and query. The query default of ai_info.generation.model is a good example of the syntax: simple dot notation, straight into the metadata structure. Switch query_mode to jsonpath and you can write filters like $.ai_info.generation[*].seed; switch to regex and the query runs against the whole metadata blob. default_value is your fallback string when the path finds nothing, and it defaults to unknown - if you see a lot of that, you're querying the wrong key or the wrong source.

    Where beginners trip: source defaults to auto, which tries the pack's preferred source first and walks the fallback chain (with fallback_sources on by default). If you saved with save_xmp but not embedded metadata, auto still finds it - that's the point of the fallback. Set return_full to true and you get the entire metadata dictionary back through the metadata DICT output instead of a single string. format_output prettifies the string result, and debug_logging turns on console noise when a query is misbehaving.

    Outputs are result (STRING) and metadata (DICT). The wiring that makes this powerful: send result into a switch or conditional node - "if model is SDXL, use this sampler; otherwise use that one." Or pipe metadata into a text node to render a caption. It's also the fastest way to audit your own archive: batch through old files and pull prompts, CFG, seeds without opening each one.

    Mechanically it's a thin wrapper over the pack's MetadataService, which handles embedded EXIF/XMP, XMP sidecars, .txt, and the SQLite database behind the scenes, with result caching for repeated calls. No API keys, no network - everything is local file reading. The one outside caveat: the pack also writes an Automatic1111-compatible parameter string if you enable it, and this node can read that too, so it works on images from A1111 that have the standard prompt-in-metadata format.

    This is a niche, single-author pack - zero community footprint, so you won't find a crowd of tutorials - but the Query node is one of its most genuinely useful pieces. Install the pack and restart:

    cd ComfyUI/custom_nodes
    git clone https://github.com/EricRollei/AAA_Metadata_System
    cd AAA_Metadata_System
    pip install -r requirements.txt
    

    Find it under Eric's Nodes → Metadata, start with the default query, and change one key at a time until you're reading whatever you need. Metadata isn't glamorous, but once you can query it, your image archive stops being a black box.

    CategoryEric's Nodes/Metadata

    Inputs (9)

    NameTypeDefaultDescription
    input_filepathSTRING
    query_modeCOMBOsimple3 options: simple, jsonpath, regex
    querySTRINGai_info.generation.model
    default_valueSTRINGunknown
    sourceoptCOMBOauto5 options: auto, embedded, xmp, txt, db
    fallback_sourcesoptBOOLEANtrue
    return_fulloptBOOLEANfalse
    format_outputoptBOOLEANtrue
    debug_loggingoptBOOLEANfalse

    Outputs (2)

    NameTypeDescription
    resultSTRING
    metadataDICT