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

Eric's Enhanced Metadata Filter V2

The friendlier search box for your image metadata

By EricRollei·Created 10 months ago·Updated 8 months ago· 13
Eric's Enhanced Metadata Filter V2
    • matched_paths
    • match_count
    • images
    folder_path
    field_typekeywords
    operationcontains
    value
    value2
    limit10
    load_imagesfalse
    use_databasetrue
    additional_query
    recursive_searchfalse
    debug_loggingfalse

    Metadata filter nodes tend to accumulate switches until using them is harder than just eyeballing the folder. Enhanced Metadata Filter V2 is the pack's attempt to keep it simple: fewer field types, fewer operations, one obvious "value" box, and an escape hatch for power users. If Eric_Metadata_Filter_V2 is the Swiss-army version, this is the "give me the common cases" version.

    It's part of the AAA Metadata System pack's metadata family, and it does the same core job - find images in a folder whose metadata matches a query - with a leaner surface. For the beginner who just wants "show me everything using this model" without studying twelve dropdowns, this is the better starting point.

    How it works

    You point it at a folder_path, pick a field_type and operation, type a value, and it queries the pack's metadata store - the SQLite database when use_database is on (fast), otherwise a direct scan of the files. Under the hood it builds a structured query from those friendly parameters and runs it through the pack's query machinery. The power-user hook is additional_query: when the dropdowns can't express what you need, you drop a JSON-formatted query in there and it layers on top of the simple criteria.

    The simplifications are real: this version has eight field_type choices (keywords, aesthetic_score, technical_score, prompt, model, directory, lora, any_text) instead of twelve, and six operations (contains, equals, greater_than, less_than, between, exists) instead of seven. No custom field type, no missing operation, no sort controls. If you need those, that's what the full filter V2 is for.

    Inputs and outputs that matter

    • folder_path - where to search (required, string).
    • field_type - keywords, prompt, model, lora, directory, aesthetic_score, technical_score, any_text.
    • operation - contains, equals, greater_than, less_than, between, exists.
    • value (and value2 for between) - the search term.
    • limit - default 10, caps results at 100 max in this version (the full filter goes to 1,000).
    • load_images - return the matched images as an IMAGE output or just paths.
    • use_database - prefer the fast DB path (default on).
    • additional_query - the JSON escape hatch.

    Outputs: matched_paths (STRING), match_count (INT), and images (IMAGE, when requested).

    Installing it

    Part of AAA Metadata System by Eric Hiss (GitHub: EricRollei). 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. No extra downloads.

    Common issues

    The same data trap as the other filter: no metadata, no matches. Images saved by a bare Save Image node carry no prompt/model keywords, so a model query returns nothing even though the folder looks full of results. If you get 10 results and expect more, that's the limit - this version caps lower than its sibling, so raise it or switch nodes. And note recursive_search defaults to off here, unlike the full filter - if you're pointing at a folder with subfolders, flip it on or you'll only search the top level. If you outgrow it, the full Eric_Metadata_Filter_V2 adds custom fields, more operations, and sorting.

    CategoryEric's Nodes/Metadata

    Inputs (11)

    NameTypeDefaultDescription
    folder_pathSTRING
    field_typeCOMBOkeywords8 options: keywords, aesthetic_score, technical_score, prompt, model, directory, +2
    operationCOMBOcontains6 options: contains, equals, greater_than, less_than, between, exists
    valueSTRING
    value2STRING
    limitINT101–100
    load_imagesBOOLEANfalse
    use_databaseBOOLEANtrue
    additional_queryoptSTRING
    recursive_searchoptBOOLEANfalse
    debug_loggingoptBOOLEANfalse

    Outputs (3)

    NameTypeDescription
    matched_pathsSTRING
    match_countINT
    imagesIMAGE