Nodes/AAA Metadata System/LoRA Database Maintenance v03
ComfyUI Node

LoRA Database Maintenance v03

Check Health, Kill Dead Entries, Back Up

By EricRollei·Created 10 months ago·Updated 9 months ago· 13
LoRA Database Maintenance v03
    • operation_result
    • health_report
    • backup_info
    maintenance_actionCheck Health
    confirm_actionfalse
    backup_before_changestrue
    custom_backup_name

    Every database eventually rots. You delete a LoRA file, but its entry lingers in the index. You move a folder, and suddenly half your library points at paths that don't exist. LoRA Database Maintenance v03 is the housekeeping node for this pack's LoRA database - the JSON store the whole LoRA Tester family reads and writes. It's not glamorous, and you won't use it every day, but when your gallery shows ghost entries or your Params Loader returns blanks for a file you know you have, this is the node that fixes the bookkeeping.

    The single required input is maintenance_action, with six choices: Check Health (reports on the database's state), Remove Dead Entries (drops records whose files no longer exist), Fix Missing Paths (repairs entries by re-finding moved files), Optimize Database (rebuilds/compacts the store), Backup Database (copies it with a timestamped name), and Clean Duplicates. The two supporting flags matter: confirm_action must be flipped on for destructive operations (Remove/Fix are the scary ones), and backup_before_changes defaults to true, so the node makes a safety copy before it edits anything. There's a custom_backup_name for when you want a specific label instead of the auto-generated one.

    Outputs are operation_result (what happened), health_report (the state of the store - handy for spotting corruption before it bites), and backup_info (where your backup landed, if one was made).

    Mechanically it's operating on lora_tester_db.json in the pack's node folder - a plain JSON file, not a real SQLite database, despite the "database" branding. That's worth knowing for two reasons: it's trivially backup-able (copy the file), and it's trivially editable by hand if you ever want to fix one bad entry directly. The "database" word oversells it a little, but for the scale most people operate at, a JSON store is honestly fine.

    The routine worth running: after every pruning session where you deleted LoRA files, hit Remove Dead Entries once with backup_before_changes on, then confirm. That keeps the gallery nodes honest and prevents the family's other nodes from surfacing files that no longer exist.

    Realistic expectations: this is a niche, one-author pack with no community chatter, and maintenance nodes are the least exciting thing in it. But "remove dead entries" is the exact kind of boring task that, done consistently, is the difference between a library you trust and a library that lies to you. 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
    

    Run Check Health first, read the report, and let that decide whether you need the heavier ops. Preventative maintenance, but for your LoRA list.

    Categoryloaders/lora tester

    Inputs (4)

    NameTypeDefaultDescription
    maintenance_actionCOMBOCheck HealthMaintenance operation to perform
    confirm_actionBOOLEANfalseConfirm destructive operations (required for Remove/Fix operations)
    backup_before_changesBOOLEANtrueCreate backup before making changes
    custom_backup_nameoptSTRINGCustom backup filename (leave empty for auto-generated)

    Outputs (3)

    NameTypeDescription
    operation_resultSTRING
    health_reportSTRING
    backup_infoSTRING