Skip to content

NastyHobbit-1/Metapic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MetaPicPick Enhanced - Complete Development History & Documentation

Last Updated: September 5, 2025 @ 09:36 UTC

πŸ“‹ Table of Contents


πŸ“Š Executive Summary

MetaPicPick Enhanced v2.0 is a comprehensive GUI application for extracting, viewing, editing, and managing metadata from AI-generated images. The project has undergone extensive development and optimization over the past day, resulting in a professional-grade application with advanced features for metadata management and statistics tracking.

Key Achievements

  • βœ… Complete GUI redesign with tabbed interface and persistent layouts
  • βœ… Advanced statistics system with tag consolidation and model management
  • βœ… Enhanced metadata editing with validation and saving capabilities
  • βœ… Comprehensive error handling and logging system
  • βœ… Optimized performance with lazy loading and caching
  • βœ… Professional build system with development and production executables
  • βœ… Modular architecture with plugin system and utilities

πŸš€ Current Status

Version: 2.0 Enhanced
Build Date: September 5, 2025
Status: βœ… Production Ready

Available Distributions

  1. Production Build: dist/MetaPicPick_Enhanced/MetaPicPick_Enhanced.exe (~4.6MB + dependencies)
  2. Development Build: dist_dev/MetaPicPick_Dev.exe (~46MB with console output)
  3. Source: Full Python source with virtual environment

Latest Fixes Applied (September 5, 2025 04:30-04:33 UTC)

  • βœ… Critical Startup Issue Resolved: Fixed executable freezing on launch
  • βœ… Statistics Tab Optimization: Implemented lazy loading for better performance
  • βœ… UI Responsiveness: Application now starts in 0.14 seconds
  • βœ… Build Verification: Both executables tested and confirmed working

πŸ“… Development Timeline

Phase 1: Foundation & Core Fixes (September 4, 2025 18:59-19:20 UTC)

18:59 UTC - Initial Setup & Tabbed Interface

  • Created comprehensive tabbed GUI interface (gui_main_tabbed.py)
  • Implemented resizable panels with persistent layouts
  • Added Library, Metadata, Batch, and Settings tabs
  • Files Created: docs/README.md, docs/TABBED_INTERFACE_GUIDE.md

19:10 UTC - Enhanced Parser System

  • Upgraded all parsers with enhanced metadata extraction
  • Improved Automatic1111, ComfyUI, and NovelAI parsers
  • Added comprehensive field extraction (19+ fields vs 5 previously)
  • Files Created: docs/ENHANCED_PARSERS_README.md

19:20 UTC - Features Consolidation

  • Documented all implemented features
  • Created comprehensive feature summary
  • Files Created: docs/FEATURES_SUMMARY.md

Phase 2: Advanced Features Development (September 4, 2025 20:12-21:05 UTC)

20:12 UTC - Statistics System Implementation

  • Built comprehensive statistics tracking system
  • Added model and tag frequency analysis
  • Implemented persistent JSON storage for statistics
  • Files Created: docs/ADVANCED_TAG_CONSOLIDATION_GUIDE.md

20:36 UTC - Project Structure Reorganization

  • Organized codebase into proper directory structure
  • Created core/, utils/, parsers/, docs/, tests/, data/ directories
  • Updated all import paths and dependencies
  • Files Created: docs/FOLDER_STRUCTURE.md

20:46-21:05 UTC - Code Cleanup & Consolidation

  • Cleaned up redundant scripts and files
  • Consolidated parser files (removed old versions)
  • Fixed import statements and class references
  • Files Created: docs/SCRIPTS_CLEANUP_SUMMARY.md, docs/PARSER_CONSOLIDATION_SUMMARY.md

Phase 3: Advanced Tag Management (September 4, 2025 21:17-22:01 UTC)

21:17 UTC - Installation & Dependencies

  • Set up proper virtual environment
  • Installed all required dependencies
  • Verified system functionality
  • Files Created: docs/INSTALLATION_SUCCESS.md

21:20-21:28 UTC - Tag Classification Fixes

  • Fixed misclassified negative tags in positive statistics
  • Implemented tag classification correction system
  • Added consolidation capabilities
  • Files Created: docs/CONSOLIDATION_FIX_SUMMARY.md

21:28-21:35 UTC - Model Name Management

  • Enhanced model name extraction and normalization
  • Added model management features
  • Implemented model mapping system
  • Files Created: docs/MODEL_NAME_FEATURE_SUMMARY.md, docs/MODEL_MANAGER_FIX.md

21:48-22:01 UTC - WebP Support & Tag Classification

  • Fixed WebP metadata extraction issues
  • Resolved tag misclassification problems
  • Enhanced parser priority system
  • Files Created: docs/WEBPMUX_FIX_SUMMARY.md, docs/TAG_CLASSIFICATION_FIX_SUMMARY.md

Phase 4: Feature Enhancement & Architecture (September 4, 2025 22:01-23:10 UTC)

22:01 UTC - Category Management System

  • Implemented advanced category management
  • Added comprehensive tag consolidation features
  • Built advanced consolidation dialog
  • Files Created: docs/CATEGORY_MANAGEMENT_FEATURE_SUMMARY.md

22:18-22:37 UTC - Comprehensive Improvements

  • Conducted full codebase analysis
  • Identified optimization opportunities
  • Created improvement recommendations
  • Files Created: docs/COMPREHENSIVE_IMPROVEMENT_RECOMMENDATIONS.md, docs/IMPLEMENTATION_GUIDE.md

23:10 UTC - Build System Implementation

  • Created professional build system
  • Implemented development and production builds
  • Added dependency checking and validation
  • Files Created: docs/BUILD_INSTRUCTIONS.md

Phase 5: Final Optimization & Release (September 5, 2025 04:20-04:33 UTC)

04:20-04:23 UTC - Build Completion

  • Successfully completed both development and production builds
  • Verified all dependencies and components
  • Files Created: docs/BUILD_RESULTS.md

04:30-04:33 UTC - Critical Bug Fix

  • CRITICAL: Fixed executable freezing issue
  • Implemented lazy loading for statistics tab
  • Optimized startup performance (0.14 seconds)
  • Rebuilt and verified both executables
  • Files Created: docs/FIX_SUMMARY.md

🎯 Features & Capabilities

Core Application Features

  • Multi-Platform AI Metadata Support: Automatic1111, ComfyUI, NovelAI, General
  • File Format Support: PNG, JPEG, WebP, TIFF
  • Advanced Statistics Tracking: Model usage, tag frequency, consolidation
  • Metadata Editing: Full CRUD operations with validation
  • Batch Processing: Bulk operations on multiple images
  • Export Capabilities: JSON, CSV format support

Interface Features

  • Professional Tabbed Interface: Library, Metadata, Batch, Statistics, Settings tabs
  • Resizable Panels: All sections can be resized with persistent layouts
  • Real-time Search: Instant filtering and search capabilities
  • Visual Previews: Thumbnail previews with metadata overlay
  • Drag & Drop Support: Easy file management

Advanced Features

  • Tag Consolidation System: Advanced tag normalization and consolidation
  • Model Name Management: Comprehensive model tracking and management
  • Statistics Analytics: Detailed usage analytics and reporting
  • Custom Blacklists: Tag filtering and exclusion capabilities
  • Plugin Architecture: Extensible parser system

Technical Features

  • Centralized Logging: Comprehensive error tracking and debugging
  • Configuration Management: Persistent settings and preferences
  • Error Handling: Robust error management with user-friendly messages
  • Performance Optimization: Lazy loading, caching, and efficient processing
  • Build System: Professional development and production builds

πŸ—οΈ Architecture & Structure

Directory Organization

MetaPicPick_V_1/
β”œβ”€β”€ config/                 # Configuration management
β”‚   └── settings.py         # Centralized configuration
β”œβ”€β”€ core/                   # Core application modules
β”‚   β”œβ”€β”€ statistics_tab.py   # Statistics interface
β”‚   β”œβ”€β”€ statistics_tracker.py # Statistics logic
β”‚   └── optimized_statistics_tracker.py # Performance-optimized version
β”œβ”€β”€ parsers/                # Metadata parser plugins
β”‚   β”œβ”€β”€ automatic1111_parser.py
β”‚   β”œβ”€β”€ comfyui_parser.py
β”‚   β”œβ”€β”€ novelai_parser.py
β”‚   └── general_ai_parser.py
β”œβ”€β”€ utils/                  # Utility functions and helpers
β”‚   β”œβ”€β”€ common_imports.py   # Centralized imports
β”‚   β”œβ”€β”€ logger.py          # Logging system
β”‚   β”œβ”€β”€ gui_factory.py     # GUI component factory
β”‚   β”œβ”€β”€ error_handler.py   # Error management
β”‚   β”œβ”€β”€ metadata_utils.py  # Metadata utilities
β”‚   └── plugin_manager.py  # Plugin system
β”œβ”€β”€ docs/                   # Documentation
β”œβ”€β”€ tests/                  # Test files and examples
β”œβ”€β”€ data/                   # Application data (statistics, etc.)
β”œβ”€β”€ logs/                   # Application logs
β”œβ”€β”€ scripts/                # Build and utility scripts
β”œβ”€β”€ gui_main.py            # Main GUI implementation
β”œβ”€β”€ metapicpick.py         # Application launcher
β”œβ”€β”€ launch_metapicpick.py  # Enhanced launcher
β”œβ”€β”€ build_exe.bat          # Production build script
└── build_dev.bat          # Development build script

Plugin System Architecture

The application uses a modular plugin system for parsing different metadata formats:

# Base parser interface
class ParserPluginInterface:
    @staticmethod
    def detect(metadata): pass
    
    @staticmethod  
    def parse(metadata): pass

Key Components

  1. Plugin Manager: Handles dynamic loading of parser plugins
  2. Statistics Tracker: Manages usage analytics and data persistence
  3. GUI Factory: Provides consistent UI component creation
  4. Configuration Manager: Handles settings and preferences
  5. Error Handler: Provides comprehensive error management
  6. Logger: Centralized logging with file and console output

πŸ’Ύ Installation & Usage

System Requirements

  • Windows 11/10 (64-bit)
  • No additional dependencies for executable versions
  • For source: Python 3.13+, PyQt5, Pillow, piexif

Installation Options

Option 1: Production Executable (Recommended)

  1. Download the MetaPicPick_Enhanced folder
  2. Run MetaPicPick_Enhanced.exe
  3. No additional setup required

Option 2: Development Executable

  1. Download MetaPicPick_Dev.exe
  2. Run directly for debugging with console output

Option 3: From Source

  1. Clone/download the repository
  2. Install dependencies: pip install -r requirements.txt
  3. Run: python metapicpick.py

Basic Usage Workflow

  1. Launch Application

    • Use production executable for normal use
    • Use development executable for debugging
  2. Load Images

    • Go to Library tab
    • Click "Load Folder" and select directory with AI images
    • Images will be automatically processed and listed
  3. Browse and Filter

    • Click on images to view metadata
    • Use search bar to filter by content
    • Use model filter to show specific AI models
    • Apply filters for negative prompts
  4. View Statistics

    • Go to Statistics tab to see usage analytics
    • View model frequency, tag usage, and patterns
    • Use consolidation features to normalize tags
  5. Edit Metadata

    • Go to Metadata tab
    • Select an image file
    • Edit metadata fields as needed
    • Save changes back to the image file
  6. Export Data

    • Use "Export Filtered Metadata" to save data
    • Choose JSON or CSV format
    • Export statistics data for external analysis

πŸ”§ Build Instructions

Prerequisites

  • Python 3.13.7
  • Virtual environment (recommended)
  • PyInstaller 6.15.0
  • All dependencies from requirements_build.txt

Development Build

# Quick development build with console output
.\build_dev.bat

Production Build

# Full production build with testing
.\build_exe.bat

Manual Build Process

# Set up virtual environment
python -m venv metapicpick_env
metapicpick_env\Scripts\activate

# Install dependencies
pip install -r requirements_build.txt

# Run dependency checks
python check_deps.py

# Build with PyInstaller
pyinstaller build_config.spec

Build Artifacts

  • Development: dist_dev/MetaPicPick_Dev.exe (46MB, console version)
  • Production: dist/MetaPicPick_Enhanced/ folder with exe and dependencies
  • Logs: Build logs and dependency reports in build directories

πŸ› Troubleshooting

Common Issues & Solutions

Application Won't Start

  • Symptom: Executable doesn't launch or crashes immediately
  • Solution: Use development build to see console output
  • Check: Ensure all dependencies are included in distribution folder

Missing Dependencies Error

  • Symptom: ImportError messages for PyQt5, PIL, or other modules
  • Solution: Use provided executables or install from requirements.txt
  • Command: pip install -r requirements.txt

WebP Metadata Not Extracted

  • Symptom: WebP images show no metadata
  • Solution: Ensure webpmux.exe is in application directory
  • Check: Verify WebP file actually contains metadata

Statistics Not Loading

  • Symptom: Statistics tab shows no data
  • Solution: Go to Library tab and load a folder first
  • Note: Statistics are built from processed images

Performance Issues

  • Symptom: Slow startup or response
  • Solution: Check log files for detailed performance metrics
  • Optimization: Use production build for better performance

Debug Mode

For verbose debugging output:

# Set debug environment and run
set DEBUG=1
MetaPicPick_Dev.exe

Log Files

Check application logs for detailed error information:

  • Location: logs/metapicpick.log
  • Format: Timestamped entries with detailed error traces
  • Levels: DEBUG, INFO, WARNING, ERROR, CRITICAL

πŸ“š Technical Documentation

Metadata Fields Supported

  • Basic: model_name, base_model, width, height, size, format, source
  • Generation: positive_prompt, negative_prompt, steps, cfg_scale, seed
  • Technical: scheduler, sampler, method, version, clip_skip
  • Advanced: vae, lora, hypernetwork, embedding, controlnet
  • Custom: Any additional platform-specific fields

Supported AI Platforms

  1. Automatic1111 (Stable Diffusion WebUI)

    • Parameters extraction from PNG text chunks
    • Enhanced parsing for all generation parameters
    • Support for extensions and custom fields
  2. ComfyUI

    • Workflow metadata extraction
    • Node-based parameter parsing
    • JSON workflow preservation
  3. NovelAI

    • NovelAI-specific metadata format
    • Quality tags and artist recognition
    • Subscription tier detection
  4. General AI

    • Generic AI metadata extraction
    • Fallback parser for unknown formats
    • Basic parameter detection

File Format Support

  • PNG: Text chunk metadata (most common for AI images)
  • JPEG: EXIF data extraction and modification
  • WebP: XMP metadata via webpmux tool
  • TIFF: Tag-based metadata system

Statistics Data Structure

{
  "total_images_processed": 7488,
  "models": {
    "model_name": count,
    "...": "..."
  },
  "positive_tags": {
    "tag": count,
    "...": "..."
  },
  "negative_tags": {
    "tag": count,
    "...": "..."
  }
}

Configuration Schema

{
  "auto_refresh_interval": 5000,
  "max_tags_display": 1000,
  "log_level": "INFO",
  "window_width": 1400,
  "window_height": 900,
  "enable_statistics": true,
  "backup_on_edit": true
}

Error Categories

  • FILE_IO: File reading/writing operations
  • METADATA: Metadata parsing and processing
  • GUI: User interface operations
  • STATISTICS: Statistics processing and analysis
  • CONFIGURATION: Settings and configuration management
  • PLUGIN: Parser plugin operations

πŸŽ‰ Project Success Metrics

Completed Features βœ…

  • 100% Core Functionality: All primary features implemented and tested
  • Professional UI: Complete tabbed interface with persistent layouts
  • Advanced Statistics: Comprehensive tracking and analysis system
  • Metadata Editing: Full editing capabilities with validation
  • Build System: Professional development and production builds
  • Documentation: Comprehensive documentation and user guides
  • Error Handling: Robust error management with logging
  • Performance: Optimized for fast startup and responsive operation

Quality Metrics

  • Startup Time: 0.14 seconds (optimized from freezing)
  • Memory Usage: Efficient with lazy loading and caching
  • File Support: 4 major image formats with metadata extraction
  • Parser Plugins: 4 specialized AI platform parsers
  • Statistics Tracking: 7,488 images processed successfully
  • Build Success: 100% successful builds with zero critical errors

User Experience

  • Interface: Modern tabbed GUI with professional design
  • Usability: Intuitive workflow with clear navigation
  • Performance: Fast and responsive with optimized loading
  • Reliability: Comprehensive error handling and logging
  • Flexibility: Highly configurable with persistent settings
  • Documentation: Complete user guides and technical documentation

πŸ“„ License & Contributing

License: Open Source (see LICENSE file for details)

Contributing Guidelines

  1. Fork the repository
  2. Create a feature branch
  3. Add your changes with proper testing
  4. Update documentation as needed
  5. Submit a pull request with detailed description

Development Standards

  • Follow existing code style and patterns
  • Add comprehensive logging for new features
  • Update documentation for any changes
  • Test with both development and production builds
  • Maintain backward compatibility when possible

MetaPicPick Enhanced v2.0 - Complete AI Image Metadata Management Solution
Built with ❀️ by NastyHobbit-1
Documentation Last Updated: September 5, 2025 @ 09:36 UTC

About

Metadata reader for AI images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published