Nodes/AAA Metadata System/Eric's Metadata Filter V2
ComfyUI Node

Eric's Metadata Filter V2

Find every image that used that model, in seconds

By EricRollei·Created 10 months ago·Updated 8 months ago· 13
Eric's Metadata Filter V2
    • matched_paths
    • match_count
    • images
    folder_path
    field_typekeywords
    operationcontains
    value
    limit10
    value2
    custom_field
    recursive_searchtrue
    use_databasetrue
    include_substringstrue
    case_sensitivefalse
    load_imagesfalse
    skip_missingtrue
    sort_bynone
    sort_descendingfalse
    advanced_query

    "Which of my 4,000 output images used this LoRA?" is a question no file explorer answers. Eric's Metadata Filter V2 does: point it at a folder, tell it which metadata field to look at, and it hands back the matching files, a count, and optionally the images themselves. If you keep a metadata database on your generations, this is the node that turns it into a search engine.

    It's part of the AAA Metadata System pack's metadata family, and it's a power tool for anyone who's been saving with metadata-aware nodes. The pack's metadata structure records things like prompt, model, rating, aesthetic and technical scores, LoRA usage, and face/blur analysis - this filter queries all of that. It's also useful for QA: "show me everything in this folder rated below 3" or "everything that used the broken model."

    How it works

    You give it a folder and a query. It searches either the pack's SQLite database (fast, structured) or falls back to scanning the folder and reading each image's metadata directly. The field_type dropdown picks what you're filtering on, operation picks how, and value is the needle. The search is substring-friendly by default (include_substrings on, case-insensitive unless you say otherwise), and results can be sorted and limited.

    The advanced_query field is the escape hatch: when the friendly dropdowns aren't enough, you can drop in a structured query there instead. If the results ever look wrong and use_database is on, try switching it off to scan files directly - the two paths can disagree if the database is stale.

    Inputs and outputs that matter

    The three that define a query:

    • folder_path - where to look (required, string).
    • field_type - keywords, aesthetic_score, technical_score, prompt, model, directory, lora, any_text, rating, faces, blur, or custom. custom plus custom_field is how you query something not in the list.
    • operation - contains, equals, greater_than, less_than, between, exists, missing. Pair between with value and value2.

    The limit (default 10) caps results so you don't get a 4,000-item dump; load_images decides whether the actual images come back as an IMAGE output or just paths.

    Outputs: matched_paths (the file paths, as one string), match_count (how many matched), and images (an IMAGE batch, only if you asked for it).

    Installing it

    Ships in AAA Metadata System by Eric Hiss (GitHub: EricRollei). Install via ComfyUI Manager (search "AAA Metadata System") or:

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

    Restart ComfyUI. Nothing extra to download.

    Common issues

    The most common "failure" is empty results, and it's almost always the same root cause: the images in that folder have no readable metadata because they weren't saved by a metadata-writing node, or the database is empty. The filter is only as good as the data - no metadata, no matches. If you're sure the metadata exists, check field_type: filtering aesthetic_score when the images only have prompts will return nothing even though prompt would. And watch limit - if you expect 50 matches and get 10, that's the cap doing its job, not a bug. For a slightly friendlier version of this node with fewer knobs, the pack also ships Enhanced Metadata Filter V2.

    CategoryEric's Nodes/Metadata

    Inputs (16)

    NameTypeDefaultDescription
    folder_pathSTRING
    field_typeCOMBOkeywords12 options: keywords, aesthetic_score, technical_score, prompt, model, directory, +6
    operationCOMBOcontains7 options: contains, equals, greater_than, less_than, between, exists, +1
    valueSTRING
    limitINT101–1000
    value2optSTRING
    custom_fieldoptSTRING
    recursive_searchoptBOOLEANtrue
    use_databaseoptBOOLEANtrue
    include_substringsoptBOOLEANtrue
    case_sensitiveoptBOOLEANfalse
    load_imagesoptBOOLEANfalse
    skip_missingoptBOOLEANtrue
    sort_byoptCOMBOnone5 options: none, filename, modified_date, created_date, value
    sort_descendingoptBOOLEANfalse
    advanced_queryoptSTRING

    Outputs (3)

    NameTypeDescription
    matched_pathsSTRING
    match_countINT
    imagesIMAGE