A standalone command-line tool to analyze and filter PNG files based on their metadata. This tool is particularly useful for identifying intermediate vs. final images in InvokeAI output directories.
- Analyze PNG files in a directory and display metadata statistics
- Filter PNG files based on text chunk metadata (e.g., find all intermediate images)
- Save filtered PNG file lists to a text file for further processing
- Display detailed metadata for individual PNG files
The PNG Metadata Analyzer is included with the SQLite InvokeAI DB Tool. To use it, you need to have Node.js installed.
# Install dependencies
npm install# Analyze all PNG files in a directory
npm run png-analyzer analyze <directory>
# Filter PNG files by metadata (e.g., find all intermediate images)
npm run png-analyzer filter <directory> parameters intermediate
# Save filtered PNG file list to a text file
npm run png-analyzer save <directory> parameters intermediate <output-file.txt>
# Inspect a single PNG file to check if metadata can be read correctly
npm run png-analyzer inspect <path-to-png-file>
# List all PNG files with unknown status (neither intermediate nor final)
npm run png-analyzer unknown <directory>
# Save the list of unknown PNG files to a text file
npm run png-analyzer unknown <directory> --save <output-file.txt>
# Compare metadata of two PNG files
npm run png-analyzer compare <file1> <file2> [options]npm run png-analyzer analyze <directory> [options]Options:
-d, --detailed: Show detailed metadata for each file
npm run png-analyzer filter <directory> <key> <value> [options]Arguments:
directory: Directory containing PNG fileskey: Text chunk key to filter by (e.g., "parameters")value: Text chunk value to filter by (e.g., "intermediate")
Options:
-d, --detailed: Show detailed metadata for each file
npm run png-analyzer save <directory> <key> <value> <output-file>Arguments:
directory: Directory containing PNG fileskey: Text chunk key to filter by (e.g., "parameters")value: Text chunk value to filter by (e.g., "intermediate")output-file: Path to save the filtered file list
npm run png-analyzer inspect <file>Arguments:
file: Path to a single PNG file to inspect
npm run png-analyzer unknown <directory>Arguments:
directory: Directory containing PNG files
Options:
-s, --save <file>: Save the list of unknown files to a file
npm run png-analyzer compare <file1> <file2> [options]Arguments:
file1: Path to the first PNG file to comparefile2: Path to the second PNG file to compare
Options:
-d, --detailed: Show detailed comparison including all text chunks and node differences
npm run png-analyzer filter C:\path\to\images parameters intermediatenpm run png-analyzer save C:\path\to\images parameters final final_images.txtnpm run png-analyzer analyze C:\path\to\images --detailednpm run png-analyzer inspect C:\path\to\images\example.pngnpm run png-analyzer unknown C:\path\to\imagesnpm run png-analyzer unknown C:\path\to\images --save unknown_images.txtnpm run png-analyzer compare C:\path\to\images\file1.png C:\path\to\images\file2.pngnpm run png-analyzer compare C:\path\to\images\file1.png C:\path\to\images\file2.png --detailedInvokeAI embeds metadata in PNG files using text chunks. Common text chunks include:
parameters: Contains generation parameters, including whether the image is intermediate or finalprompt: The prompt used to generate the imageworkflow: Workflow information
The analyzer helps you identify and filter images based on these text chunks.