$ show LuqP2/Image-MetaHub
Image MetaHub is a local-first Electron desktop application for organizing, browsing, and re-generating AI-generated images. It indexes media files in place (no uploads, no moving files) and extracts structured metadata — prompts, models, LoRAs, samplers, seeds, workflows — from 15+ generators including ComfyUI, A1111, InvokeAI, Midjourney, DALL-E, Fooocus, and Adobe Firefly (via C2PA/JUMBF/CBOR parsing). Beyond images it handles video, audio, and 3D model metadata. The app provides tagging, collections, automation rules, ratings, analytics, image comparison with pixel-level diffing, lineage/provenance tracking, and integration with local ComfyUI/A1111 instances for re-generation and upscaling. Pro features (visual search, clustering, batch export) are gated by an offline license system with a 7-day trial and Stripe billing.
The LLM identified 6 files worth highlighting for reuse:
A standalone, published npm package (@image-metahub/metadata-engine) that parses AI image metadata from 15+ generators. Includes a ComfyUI workflow graph traversal engine, C2PA/JUMBF/CBOR parsing for Adobe Firefly, a browser variant, and its own test suite and versioning. Fully isolated from the Electron app — the single most reusable asset in the repo, extractable into any project needing AI image metadata extraction.
Defines a binary vector index format with int8 per-vector quantization, segment files, row chunks, a manifest, centroid approximation for text-image centering, and hubness correction. Model-agnostic and self-contained — reusable for any embedding-based similarity search system that needs compact on-disk storage and fast cosine scoring.
Implements atomic copy/move/rename operations with sidecar file handling and rollback on failure. Demonstrates a robust, non-obvious file-operation pattern (verify → copy → commit → rollback) applicable to any desktop application managing file assets where partial failures would corrupt user data.
A 4-phase clustering algorithm (exact match → token bucketing → hybrid Jaccard-Levenshtein similarity → refinement) for grouping near-duplicate prompts. Self-contained, deterministic, and adaptable to other text-similarity clustering problems beyond AI image metadata.
A Web Worker implementing brute-force top-K vector search with a min-heap accumulator and int8-quantized cosine similarity. A clean, efficient pattern for on-device embedding search that keeps the UI thread responsive — reusable in any client-side vector search scenario.
Stripe billing event processor using an inbox/outbox pattern with idempotency windows, encrypted license delivery payloads, and refund convergence logic. A solid reference implementation for subscription billing event processing that tolerates webhook retries and partial delivery failures.