# ComfyUI Prompt Manager ![License](https://img.shields.io/badge/license-MIT-blue.svg) ![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg) ![ComfyUI](https://img.shields.io/badge/ComfyUI-compatible-green.svg) ![Tests](https://github.com/ComfyAssets/ComfyUI_PromptManager/workflows/Tests/badge.svg) ![Code Quality](https://github.com/ComfyAssets/ComfyUI_PromptManager/workflows/Code%20Quality/badge.svg) A comprehensive ComfyUI custom node that extends the standard text encoder with persistent prompt storage, advanced search capabilities, automatic image gallery system, folder-based organization, LoRA Manager integration, and powerful ComfyUI workflow metadata analysis using SQLite. ## Overview ![Prompt Manager Interface](images/pm-01.png) ComfyUI Prompt Manager provides two powerful node types for comprehensive prompt management: ### **PromptManager** (CLIP Encoding Node) A drop-in replacement for ComfyUI's standard `CLIPTextEncode` node with database features: - **๐Ÿ”„ Drop-in Replacement**: Works exactly like the standard text encoder - **๐Ÿค– CLIP Encoding**: Outputs CONDITIONING for use with samplers and other CLIP-dependent nodes ![Prompt Manager Interface](images/pm-04.png) ### **PromptManagerText** (Text-Only Node) A text-focused variant that outputs raw STRING for maximum flexibility: - **๐Ÿ“ Pure Text Output**: Outputs STRING type for use with any text-accepting node - **๐Ÿ”— Text Concatenation**: Built-in prepend/append functionality for dynamic text assembly - **โšก Lightweight Processing**: No CLIP encoding overhead for text-only workflows ### **PromptSearchList** (Batch Processing Node) A search node that outputs prompts as a list for batch processing workflows: - **๐Ÿ” Database Search**: Search prompts by text, category, tags, and rating - **๐Ÿ“‹ List Output**: Uses `OUTPUT_IS_LIST` for native batch processing support - **๐Ÿ”— Batch Compatible**: Connect directly to batch processing nodes like String OutputList - **โšก Read-Only**: Lightweight search operation without database writes This node enables powerful batch workflows by allowing you to search your prompt database and process multiple prompts in a single execution. ### **Shared Features** Both nodes include the complete PromptManager feature set: - **๐Ÿ’พ Persistent Storage**: Automatically saves all prompts to a local SQLite database - **๐Ÿ” Advanced Search**: Query past prompts with text search, category filtering, and metadata - **๐Ÿ“ Folder Filter**: Browse and filter prompts by output subdirectory - **๐Ÿ–ผ๏ธ Automatic Image Gallery**: Automatically links generated images to their prompts - **๐Ÿท๏ธ Rich Metadata**: Add categories, tags, ratings, notes, and workflow names to prompts - **๐Ÿšซ Duplicate Prevention**: Uses SHA256 hashing to detect and prevent duplicate storage - **๐ŸŒ Advanced Web Interface**: Comprehensive admin dashboard with metadata analysis - **๐Ÿ“Š Analytics**: Track prompt usage patterns and effectiveness over time - **๐Ÿ”ฌ Workflow Analysis**: Extract and analyze ComfyUI workflow data from PNG images - **๐Ÿ“‹ Metadata Viewer**: Standalone tool for analyzing ComfyUI-generated images - **๐Ÿ› ๏ธ System Management**: Built-in diagnostics, backup/restore, and maintenance tools - **๐Ÿท๏ธ AI AutoTag**: Automatically tag your image collection using WD14 or JoyCaption vision models - **๐Ÿ”— LoRA Manager Integration**: Import LoRA metadata and preview images from [ComfyUI-Lora-Manager](https://github.com/willmiao/ComfyUI-Lora-Manager) ![Image Gallery](images/pm-02.png) ## Features ### Core Functionality #### PromptManager (CLIP Encoding) - **Text Encoding**: Standard CLIP text encoding for ComfyUI workflows - **Conditioning Output**: Produces CONDITIONING for samplers and generation nodes - **Full Compatibility**: Drop-in replacement for CLIPTextEncode nodes #### PromptManagerText (Text-Only) - **String Output**: Produces STRING for use with any text-accepting node - **Text Concatenation**: Prepend and append fields for dynamic text assembly - **Lightweight**: No CLIP encoding overhead for pure text workflows - **Flexible Integration**: Works with custom nodes, text processors, and other STRING inputs #### Shared Features - **Auto-Save**: Every prompt is automatically saved to the database - **Metadata Support**: Optional categories, tags, ratings (1-5), notes, and workflow names - **Hash-based Deduplication**: Prevents storing identical prompts multiple times ### ๐Ÿ–ผ๏ธ Advanced Gallery with Full Media Support ![Prompt Editor](images/pm-03.jpg) The comprehensive gallery system provides complete management of all ComfyUI output with professional viewing capabilities: #### **๐Ÿ“ Output-Wide Gallery Mode** ![Prompt Editor](images/pm-05.jpg) - **Complete Output Monitoring**: Automatically scans and displays ALL content from your ComfyUI output directory - **Multi-Format Support**: Handles images (.png, .jpg, .jpeg, .webp, .gif) and videos (.mp4, .webm, .avi, .mov, .mkv, .m4v, .wmv) - **Intelligent Organization**: View all generated content regardless of which workflow created it - **Advanced Filtering**: Filter by media type, date range, file size, and generation parameters - **Performance Optimized**: Efficient scanning with thumbnail generation and lazy loading #### **๐ŸŽฌ Full Video Support** - **Native Video Playback**: HTML5 video player with custom controls for all supported formats - **Video Thumbnails**: Automatic thumbnail generation with OpenCV, ffmpeg, or placeholder fallback - **Playback Controls**: Autoplay, mute, loop settings with persistent preferences - **Video Navigation**: Seamless navigation between videos with keyboard shortcuts - **Video Metadata**: Display duration, resolution, aspect ratio, and file information - **Mixed Media Gallery**: Videos and images integrated seamlessly in the same interface #### **๐Ÿ” Professional Image Viewer (ViewerJS Integration)** - **Full-Featured Viewing**: Zoom, rotation, slideshow modes with professional controls - **Advanced Navigation**: Smooth transitions, thumbnail strip, and keyboard shortcuts - **Zoom Controls**: Mouse wheel zoom, drag to pan, and touch gesture support - **Toolbar Features**: Comprehensive toolbar with zoom, rotate, flip, reset, and fullscreen - **Dark Theme Integration**: Seamless styling that matches the admin interface #### **๐Ÿ”ฌ Advanced Metadata Analysis** ![Prompt Editor](images/pm-06.jpg) - **Real-time PNG Parsing**: Extract ComfyUI workflow data from any generated image - **Integrated Metadata Panel**: Live workflow analysis with copy functionality - **Generation Parameters**: CFG scale, steps, sampler, seed, and model information - **One-click Copying**: Copy prompts, parameters, and workflow data directly - **File Path Integration**: Direct access to files in your output directory - **Cross-Platform Support**: Works on desktop, tablet, and mobile devices #### **โšก Performance Features** - **Smart Thumbnail System**: Generates optimized thumbnails for faster loading - **Lazy Loading**: Load content as needed for smooth browsing of large galleries - **Grid & List Views**: Choose between compact grid or detailed list display - **Pagination**: Efficient browsing of thousands of generated files - **Search & Filter**: Real-time search across filenames and metadata _Powered by [ViewerJS](https://github.com/fengyuanchen/viewerjs) for professional image viewing capabilities._ Viewer.js is vendored locally. See [Viewer.js maintenance](tools/vendor/README.md) for reproducible updates, verification, and automated update PRs. Prompt Manager appears as **Prompt Manager (Classic)** in the Add Node menu. It keeps the existing layout and behavior while using shared [ComfyAssets Toolkit](https://github.com/ComfyAssets/ComfyAssets-Toolkit) controls that follow ComfyUI's light/dark theme. Existing workflows keep the same internal node identifier and sockets. The reusable architecture is inspired by [Pixaroma](https://github.com/pixaroma/ComfyUI-Pixaroma); no implementation or assets were copied. See the [toolkit maintenance notes](tools/vendor/README.md#shared-comfyassets-browser-controls). **Prompt Manager (Focused)** adds an editor-first layout with collapsible composition and metadata fields. Open **Browse library** to search saved prompts, filter by saved category and comma-separated tags, preview a selection, then choose **Use prompt**; **Load metadata** controls whether category and tags come with it. Metadata fields suggest saved categories and tags; choose with the mouse or arrow keys and Enter. Tag selections append `, ` for the next tag; category remains a single value. New values can still be typed freely. Prepend and append STRING sockets remain visible when the fields are collapsed, so LoRA trigger outputs can connect directly. Encoding, storage, and CONDITIONING/text outputs match Classic. Both layouts support ComfyUI Classic and Nodes 2.0. **Prompt Manager (Split)** keeps the same editor and library visible together. Wide nodes place the library beside the editor; narrow nodes stack the panels. It shares Focused's category/tag autocomplete, search filters, preview-before-use, workflow persistence, and connectable prepend/append inputs. Encoding and storage match Classic and Focused. ### ๐Ÿ”ฌ ComfyUI Workflow Analysis - **PNG Metadata Parsing**: Advanced PNG chunk analysis to extract embedded ComfyUI data - **Workflow Data Extraction**: Complete ComfyUI workflow JSON recovery from images - **Prompt Recovery**: Extract positive/negative prompts from any ComfyUI-generated image - **Generation Parameters**: Recover steps, CFG scale, sampler, seed, and model information - **Multi-Node Support**: Handles PromptManager, CLIPTextEncode, and other node types - **Copy & Export**: One-click copying of prompts and workflow JSON download - **Standalone Viewer**: Dedicated metadata analysis tool at `/prompt_manager/metadata.html` - **Drag & Drop Interface**: Easy analysis by dropping PNG files directly into the viewer - **Error Handling**: Robust parsing with NaN value cleaning and malformed JSON recovery ### ๐Ÿ“‹ Standalone Metadata Viewer - **Independent Tool**: Access at `http://localhost:8188/prompt_manager/metadata.html` - **Real-time Analysis**: Instant PNG metadata extraction and display - **Comprehensive Display**: Shows all discoverable ComfyUI workflow information - **Export Capabilities**: Download workflow JSON files for reuse - **File Path Integration**: Click to reveal file locations in your system - **Visual Interface**: Clean, organized presentation of complex workflow data ### Search & Retrieval - **Full-text search** across all stored prompts - **Category filtering** for organized prompt collections - **Tag-based search** with support for multiple tags, with autocomplete that narrows to tags seen together with the ones already typed - **Rating filters** to find your best prompts - **Date range filtering** for temporal searches - **Recent prompts** quick access - **Top-rated prompts** for quality discovery - **Image search** by file properties and metadata ### ๐ŸŒ Advanced Web Interface - **Admin Dashboard**: Comprehensive browser-based management interface with modern dark theme - **Responsive Design**: Works on desktop, tablet, and mobile devices - **Real-time Search**: Instant search results as you type - **Bulk Operations**: Edit multiple prompts simultaneously with batch tools - **Settings Panel**: Configure behavior and display options - **System Management**: Complete toolset for database operations: - **๐Ÿ” Metadata Viewer**: Launch standalone PNG analysis tool - **๐Ÿ“ธ Scan Images**: Bulk scan output directories for ComfyUI images - **๐Ÿ’พ Backup/Restore**: Database backup and recovery operations - **๐Ÿ”ง Maintenance**: Database optimization and cleanup tools including orphaned prompt removal - **๐Ÿ“‹ Logs**: Comprehensive logging system with download capability - **๐Ÿ” Diagnostics**: System health checks and troubleshooting - **Export Tools**: Download prompts and metadata in various formats - **Progress Tracking**: Real-time progress indicators for long operations - **Error Handling**: Graceful error display with recovery suggestions ### Database Management - **SQLite backend** for reliable local storage - **Automatic schema creation** and management - **Database optimization** with proper indexing and maintenance tools - **Export functionality** to JSON or CSV formats - **Backup and restore** capabilities - **Relationship tracking** between prompts and generated images - **Orphaned prompt cleanup** to remove prompts without linked images ## Installation ### For ComfyUI Users 1. **Clone the repository** into your ComfyUI custom_nodes directory: ```bash cd ComfyUI/custom_nodes/ git clone https://github.com/ComfyAssets/ComfyUI_PromptManager cd ComfyUI_PromptManager ``` 2. **Install dependencies**: ```bash pip install -r requirements.txt ``` 3. **Restart ComfyUI** to load the new node 4. **Add the nodes** to your workflow: - **PromptManager**: Look for "Prompt Manager" in the conditioning category - use exactly like "CLIP Text Encode" - **PromptManagerText**: Look for "Prompt Manager Text" in the PromptManager/Text category - outputs STRING for any text node 5. **Access the web interface**: - **Admin Dashboard**: `http://localhost:8188/prompt_manager/admin` - Full management interface - **Metadata Viewer**: `http://localhost:8188/prompt_manager/metadata.html` - Standalone PNG analysis tool - **Simple Interface**: `http://localhost:8188/prompt_manager/` - Basic prompt browser ### Prerequisites - ComfyUI installation - Python 3.8 or higher - SQLite3 (included with Python) - `watchdog` library for automatic image monitoring ## Usage ### Basic Usage #### Using PromptManager (CLIP Encoding) Replace any `CLIPTextEncode` node with `PromptManager`: 1. **Add the PromptManager node** to your workflow 2. **Connect CLIP model** (same as standard text encoder) 3. **Enter your prompt** in the text field 4. **Connect the CONDITIONING output** to your sampler node #### Using PromptManagerText (Text-Only) For text-only workflows or when you need STRING output: 1. **Add the PromptManagerText node** to your workflow 2. **Enter your prompt** in the text field 3. **Optionally use prepend/append** for dynamic text assembly: - **Prepend Text**: Text added before your main prompt - **Append Text**: Text added after your main prompt 4. **Connect the STRING output** to any node that accepts text input #### Using PromptSearchList (Batch Processing) For batch processing workflows that need multiple prompts: 1. **Add the PromptSearchList node** to your workflow 2. **Configure search filters**: - **text**: Search for prompts containing this text - **category**: Filter by specific category - **tags**: Comma-separated tags to filter by (e.g., "anime, detailed") - **min_rating**: Minimum rating (0-5) to include - **limit**: Maximum number of results (1-1000, default 50) 3. **Connect the prompts output** to batch-compatible nodes like String OutputList 4. **Each matching prompt** will be processed as a separate batch item #### Shared Metadata Options Both nodes support the same metadata fields: - **Category**: "portraits", "landscapes", "abstract", etc. - **Tags**: "detailed, anime, masterpiece" (comma-separated) - **Rating**: 1-5 stars for prompt quality (web interface only) - **Notes**: Any additional information (web interface only) - **Workflow Name**: Name of your workflow for organization (web interface only) Both nodes will automatically save prompts to the database and link any generated images to the prompt. ### ๐Ÿ–ผ๏ธ Using the Output-Wide Gallery The comprehensive gallery system provides complete access to all your ComfyUI output: #### **๐Ÿ“ Accessing the Gallery** 1. **Open the admin interface** at `http://localhost:8188/prompt_manager/admin` 2. **Click the "๐Ÿ–ผ๏ธ Gallery" button** to open the output-wide gallery 3. **Browse all content** from your ComfyUI output directory #### **๐ŸŽฌ Video & Image Support** - **Mixed Media Viewing**: Images and videos appear together in the same gallery - **Video Thumbnails**: Videos show with play button overlays and ๐ŸŽฌ icons - **Smart Filtering**: Filter by media type (All, Images, Videos) using the dropdown #### **โš™๏ธ Gallery Settings** Configure your viewing experience in the settings panel: - **Display Settings**: Default view, items per page, grid columns, media info, infinite scrolling - **Performance Settings**: Image quality, lazy loading - **Video Settings**: Autoplay, mute by default, loop videos - **Thumbnail Management**: Generate optimized thumbnails for faster loading (runs on the configured worker threads; a run that stops at the per-run cap tells you how many remain) - **Find Duplicate Images**: Hashes every file on the worker threads with a progress bar; close the window and it keeps running, results wait in a pill - **Rescan Output Folder**: Drops the server-side listing cache and rewalks the folders #### **๐Ÿ–ผ๏ธ Image Viewing Experience** 1. **Click any image** to open the professional viewer with: - **Full-screen viewing** with zoom, rotation, and slideshow controls - **Integrated metadata panel** showing workflow data and generation parameters - **Navigation arrows** and keyboard shortcuts (โ†/โ†’ arrow keys) - **Copy functionality** for prompts, parameters, and workflow data 2. **Use keyboard shortcuts**: - **Arrow keys** (โ†/โ†’) for navigation - **ESC** to close viewer - **Space** for slideshow mode #### **๐ŸŽฌ Video Viewing Experience** 1. **Click any video** to open the video player with: - **HTML5 video controls** with play, pause, seek, and fullscreen - **Custom control buttons** for mute/unmute and loop toggle - **Video information panel** showing duration, resolution, and file details - **Navigation between videos** using arrow keys or buttons 2. **Playback settings** are remembered across sessions #### **๐Ÿ” Advanced Features** - **Real-time Search**: Search across filenames and metadata - **View Modes**: Switch between grid and list views - **Sorting Options**: Sort by date, size, or filename - **Pagination**: Efficiently browse thousands of files - **Thumbnail Generation**: Create optimized thumbnails for better performance ### ๐Ÿ”ฌ Analyzing ComfyUI Images Use the standalone metadata viewer to analyze any ComfyUI-generated PNG: 1. **Open the metadata viewer** at `http://localhost:8188/prompt_manager/metadata.html` 2. **Drag and drop** any PNG file with ComfyUI workflow data 3. **View extracted information**: - **Prompts**: Copy positive/negative prompts with one click - **Parameters**: See all generation settings used - **Model Info**: Identify checkpoint and settings - **Workflow**: Download complete workflow JSON 4. **Copy data** using the built-in copy buttons 5. **Export workflow** as JSON file for reuse in ComfyUI ### ๐Ÿ“ธ Bulk Image Scanning Import existing ComfyUI images into your database: 1. **Open admin dashboard** and click **"๐Ÿ“ธ Scan Images"** 2. **Start scan** to analyze every configured output directory 3. **Monitor progress** with real-time status updates. The scan runs on the server: closing the window only minimizes it to a progress pill, and reloading the page re-attaches to a running scan 4. **Review results** showing: - Images found and processed - Prompts extracted and linked - Any errors or issues encountered 5. **Access imported data** through the normal gallery interface The scan reads PNG text chunks and A1111-style parameters, and, when `ffprobe` is installed, the prompt ComfyUI's video savers embed in MP4/MOV/WebM files. Files are read on the number of **worker threads** set in Settings โ†’ Performance (default: half your cores), which makes a large library several times faster. ### ๐Ÿท๏ธ AI AutoTag Automatically tag your entire image collection using AI vision models: #### **Model Options** - **WD14 SwinV2 / WD14 ViT**: Fast ONNX-based classifiers (~400MB) that output Danbooru tags with confidence scores โ€” no prompt needed, adjustable confidence thresholds - **JoyCaption Beta One FP16**: Full precision model for highest quality tagging (requires more VRAM) - **JoyCaption Beta One GGUF (FP8)**: Quantized model for lower VRAM usage with minimal quality loss #### **Two Tagging Modes** 1. **AutoTag (Batch Mode)**: Tag your entire collection automatically - Click **"๐Ÿท๏ธ AutoTag"** in the admin dashboard - Choose your model type (FP16 or GGUF) - Select how to handle already-tagged images: - **Skip images with existing tags**: Preserve your meticulous manual tagging work - **Re-tag all images**: Overwrite existing tags with fresh AI analysis - Customize the system prompt to match your collection style - Monitor real-time progress as images are processed 2. **Review Mode**: Tag images one-by-one with approval - Review each image and its AI-generated tags before applying - Edit, add, or remove tags before saving - Skip images you don't want to tag - Perfect for curating high-quality tag assignments #### **Handling Existing Tags** For users who have meticulously tagged their collections from the start: - AutoTag respects your existing work with the **"Skip tagged"** option - **"auto-scanned"** placeholder tags don't count as real tags - Choose to re-tag specific images while preserving others - Review mode asks before overwriting on each image #### **Customization** Adjust the system prompt to match your tagging style: - Focus on specific attributes (style, mood, composition, subjects) - Match your existing tag vocabulary - Optimize for your collection's theme (anime, photography, landscapes, etc.) #### **Requirements** - Sufficient VRAM for the chosen model (FP16 requires more, GGUF is lighter) - Models are downloaded automatically on first use - Feature requests and improvements are welcome! ### ๐Ÿ“ Folder Filter ![Folder Filter](images/pm-lora-import.png) Organize and filter your prompt library by output subdirectory. The dashboard search panel includes a **Folder** dropdown that lists all subdirectories where your images are stored. - **Automatic Detection**: Folders are extracted from your image paths โ€” no configuration needed - **Multi-Directory Support**: Works across all configured gallery scan directories - **Quick Filtering**: Select a folder from the dropdown to instantly filter prompts to that subdirectory > **Note:** If you have an existing prompt library from before the folder feature was added, you will need to **rescan your image library** (click **Scan Images** in the admin dashboard) to populate folder data for your existing prompts. ### ๐Ÿ”— LoRA Manager Integration ![LoRA Settings](images/pm-settings-integrations.png) If you use [ComfyUI-Lora-Manager](https://github.com/willmiao/ComfyUI-Lora-Manager), PromptManager can import your LoRA metadata, trigger words, and example images directly into your prompt database. This lets you search, tag, and browse your LoRA collection alongside your regular prompts. > **WIP:** LoRA Manager support is a work in progress โ€” this was a highly requested feature. Please [open issues](https://github.com/ComfyAssets/ComfyUI_PromptManager/issues) for any bugs or feature requests. #### **Enabling the Integration** 1. Open the admin dashboard and click **Settings** 2. Scroll to the **Integrations** section โ€” PromptManager will auto-detect if LoRA Manager is installed ![LoRA Enabled](images/pm-lora-enabled.png) 3. Toggle the **LoraManager** switch to enable 4. Optionally enable **Auto-inject trigger words** to automatically append LoRA trigger words when `` is detected in your prompts 5. Click **Save Settings** (requires a ComfyUI restart to take effect) #### **Importing LoRA Data** Click **Import LoRA Data** in the settings panel to start the import. A progress popup shows real-time status as each LoRA is processed: - Scans all LoRA directories (including `extra_model_paths.yaml` paths) for metadata - Downloads example images from CivitAI as 512px thumbnails - Creates a prompt entry for each LoRA with trigger words, example prompts, and preview images - All imported LoRAs are tagged with `lora-manager` category for easy filtering ![LoRA Results](images/pm-lora-filtered.png) After import, filter by the `lora-manager` category to browse your LoRA collection. #### **CivitAI API Key (Optional)** A CivitAI API key is **required if your library contains NSFW LoRAs** โ€” CivitAI blocks unauthenticated access to NSFW preview images. Without a key, only SFW preview images are downloaded. To add your key: 1. Get your API key from [civitai.com/user/account](https://civitai.com/user/account) 2. Paste it into the **CivitAI API Key** field in the Integrations settings 3. Save and re-import to download any previously skipped images > **Note:** Re-importing is safe โ€” PromptManager skips LoRAs that were already imported. To do a fresh import, the previous `lora-manager` data is cleared automatically before re-scanning. ### ๐ŸŒ Web Interface Features The comprehensive web interface provides: - **Search Bar**: Real-time search across all prompts - **Filter Options**: Filter by category, tags, rating, and date - **Bulk Operations**: Select multiple prompts for batch editing - **Export Tools**: Download your prompt collection - **Settings Panel**: Configure auto-save and display options - **Diagnostics**: System health checks and troubleshooting ### ๐Ÿ”ง Database Maintenance Keep your database optimized with built-in maintenance tools: 1. **Open the admin dashboard** and click **"๐Ÿ”ง Maintenance"** 2. **Select maintenance operations**: - **Remove Duplicates**: Find and merge duplicate prompts while preserving images - **Vacuum Database**: Optimize database file size and performance - **Clean Orphaned Images**: Remove image records for missing files - **๐Ÿšฎ Prune Orphaned Prompts**: Remove prompts that have no linked images - **Check Consistency**: Verify database integrity and relationships - **Database Statistics**: Generate detailed database reports 3. **Run selected operations** and monitor progress in real-time 4. **Review results** showing detailed information about each operation ### Database Location By default, the database is saved as `prompts.db` in the extension directory. It contains your prompt library and image links. See the [database path compatibility note](#database-path-compatibility-211) before upgrading a deployment with a custom path. ### Searching Prompts Use the web interface for intuitive searching, or access the database directly: ```python from database.operations import PromptDatabase db = PromptDatabase() # Search for landscape prompts results = db.search_prompts(text="landscape", limit=10) # Find highly rated prompts results = db.search_prompts(rating_min=4) # Search by category and tags results = db.search_prompts( category="portraits", tags=["anime", "detailed"] ) # Get recent prompts recent = db.get_recent_prompts(limit=20) # Get images for a prompt images = db.get_prompt_images(prompt_id="123") ``` ## Examples ### PromptManager (CLIP Encoding) Examples #### Example 1: Basic Prompt Storage ``` Input: "A beautiful sunset over a mountain lake" Category: "landscapes" Tags: "nature, sunset, mountains, water" โ†’ Outputs: CONDITIONING for sampler nodes ``` #### Example 2: Character Prompt ``` Input: "Portrait of a cyberpunk hacker with neon implants" Category: "characters" Tags: "cyberpunk, portrait, sci-fi, neon" โ†’ Outputs: CONDITIONING for sampler nodes ``` ### PromptManagerText (Text-Only) Examples #### Example 3: Dynamic Text Assembly ``` Main Text: "beautiful landscape" Prepend Text: "masterpiece, ultra detailed," Append Text: ", 8k resolution, trending on artstation" โ†’ Final Output: "masterpiece, ultra detailed, beautiful landscape, 8k resolution, trending on artstation" ``` #### Example 4: Text Processing Pipeline ``` Input: "A serene mountain lake at sunset" Category: "landscapes" Tags: "nature, peaceful, golden hour" โ†’ Outputs: STRING for use with text processors, style nodes, or other custom nodes ``` #### Example 5: Multi-Node Text Workflow ``` PromptManagerText โ†’ Text Processor โ†’ Style Applicator โ†’ Final Text Node "cyberpunk city" โ†’ style processing โ†’ "neon-lit cyberpunk metropolis at night" ``` ### PromptSearchList (Batch Processing) Examples #### Example 6: Batch Processing with Tags ``` Tags: "anime, detailed" Limit: 10 โ†’ Outputs: List of up to 10 prompts with both "anime" and "detailed" tags โ†’ Each prompt is processed as a separate batch item ``` #### Example 7: Category-Based Batch ``` Category: "portraits" Min Rating: 4 Limit: 20 โ†’ Outputs: List of up to 20 highly-rated portrait prompts for batch generation ``` ### Traditional Examples #### Example 8: Abstract Art ``` Input: "Swirling colors in an abstract geometric pattern" Category: "abstract" Tags: "geometric, colorful, pattern, modern" Rating: 3 (set via web interface) Notes: "Good for experimental art" (set via web interface) ``` ## Database Schema ```sql -- Prompts table CREATE TABLE prompts ( id INTEGER PRIMARY KEY AUTOINCREMENT, text TEXT NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, workflow_name TEXT, category TEXT, tags TEXT, -- JSON array of tags rating INTEGER CHECK(rating >= 1 AND rating <= 5), notes TEXT, hash TEXT UNIQUE -- SHA256 hash for deduplication ); -- Generated images table CREATE TABLE generated_images ( id INTEGER PRIMARY KEY AUTOINCREMENT, prompt_id TEXT NOT NULL, image_path TEXT NOT NULL, filename TEXT NOT NULL, generation_time TIMESTAMP DEFAULT CURRENT_TIMESTAMP, file_size INTEGER, width INTEGER, height INTEGER, format TEXT, workflow_data TEXT, -- JSON workflow metadata prompt_metadata TEXT, -- JSON prompt parameters parameters TEXT, -- JSON generation parameters FOREIGN KEY (prompt_id) REFERENCES prompts(id) ); ``` ## Architecture ### Core Components - **`prompt_manager.py`** - Main ComfyUI node implementation (CLIP encoding) - **`prompt_manager_text.py`** - Text-only node implementation (STRING output) - **`prompt_search_list.py`** - Batch search node implementation (LIST output) - **`database/models.py`** - Database schema and connection management - **`database/operations.py`** - CRUD operations and search functionality - **`py/api/`** - Web API route modules (prompts, images, tags, lora integration, etc.) - **`py/config.py`** - Configuration management - **`py/lora_utils.py`** - LoRA Manager integration utilities - **`utils/hashing.py`** - SHA256 hashing for deduplication - **`utils/validators.py`** - Input validation and sanitization - **`utils/image_monitor.py`** - Automatic image detection system - **`utils/prompt_tracker.py`** - Prompt execution tracking - **`utils/metadata_extractor.py`** - PNG metadata analysis engine - **`utils/logging_config.py`** - Comprehensive logging system - **`utils/diagnostics.py`** - System diagnostics and health checks - **`web/admin.html`** - Advanced admin dashboard with metadata panel - **`web/index.html`** - Simple web interface - **`web/comfy/prompt_manager.js`** - ComfyUI canvas extension (the only file ComfyUI loads) - **`web/js/admin.js`**, **`web/js/gallery.js`** - Dashboard and gallery JavaScript - **`web/js/tags-page.js`** - Tag management JavaScript - **`web/metadata.html`** - Standalone PNG metadata viewer ### File Structure ``` ComfyUI_PromptManager/ โ”œโ”€โ”€ __init__.py # Node registration โ”œโ”€โ”€ prompt_manager.py # Main node implementation (CLIP encoding) โ”œโ”€โ”€ prompt_manager_text.py # Text-only node implementation (STRING output) โ”œโ”€โ”€ prompt_search_list.py # Batch search node implementation (LIST output) โ”œโ”€โ”€ database/ โ”‚ โ”œโ”€โ”€ __init__.py โ”‚ โ”œโ”€โ”€ models.py # Database schema โ”‚ โ””โ”€โ”€ operations.py # Database operations โ”œโ”€โ”€ py/ โ”‚ โ”œโ”€โ”€ __init__.py โ”‚ โ”œโ”€โ”€ api/ # Web API route modules โ”‚ โ”œโ”€โ”€ config.py # Configuration โ”‚ โ””โ”€โ”€ lora_utils.py # LoRA Manager integration โ”œโ”€โ”€ utils/ โ”‚ โ”œโ”€โ”€ __init__.py โ”‚ โ”œโ”€โ”€ hashing.py # Hashing utilities โ”‚ โ”œโ”€โ”€ validators.py # Input validation โ”‚ โ”œโ”€โ”€ image_monitor.py # Automatic image detection โ”‚ โ”œโ”€โ”€ prompt_tracker.py # Prompt execution tracking โ”‚ โ”œโ”€โ”€ metadata_extractor.py # PNG metadata analysis โ”‚ โ”œโ”€โ”€ logging_config.py # Logging system โ”‚ โ””โ”€โ”€ diagnostics.py # System diagnostics โ”œโ”€โ”€ web/ โ”‚ โ”œโ”€โ”€ admin.html # Advanced admin dashboard โ”‚ โ”œโ”€โ”€ gallery.html # Image gallery โ”‚ โ”œโ”€โ”€ index.html # Simple web interface โ”‚ โ”œโ”€โ”€ metadata.html # Standalone metadata viewer โ”‚ โ”œโ”€โ”€ comfy/ โ”‚ โ”‚ โ””โ”€โ”€ prompt_manager.js # ComfyUI canvas extension (WEB_DIRECTORY) โ”‚ โ””โ”€โ”€ js/ โ”‚ โ”œโ”€โ”€ admin.js # Dashboard JavaScript โ”‚ โ”œโ”€โ”€ gallery.js # Gallery JavaScript โ”‚ โ””โ”€โ”€ tags-page.js # Tag management JavaScript โ”œโ”€โ”€ tests/ โ”‚ โ”œโ”€โ”€ __init__.py โ”‚ โ””โ”€โ”€ test_basic.py # Test suite โ”œโ”€โ”€ requirements.txt # Dependencies โ”œโ”€โ”€ example_usage.py # Standalone examples โ”œโ”€โ”€ example_prompts.db # Example database โ””โ”€โ”€ README.md # This file ``` ## Configuration ### Database Settings You can customize the database path by creating a `config.json` file in the extension root: ```json { "database": { "default_path": "/path/to/your/prompts.db" } } ``` Relative paths are resolved against the extension directory. Absolute paths are used as-is, which is recommended for Docker deployments where the working directory may not persist: ```json { "database": { "default_path": "/data/custom_nodes/ComfyUI_PromptManager/prompts.db" } } ``` ### Database Path Compatibility (#211) PromptManager now honors the `database.default_path` setting in `config.json` when loaded as a ComfyUI custom node. Relative paths resolve against the extension directory, not ComfyUI's working directory; absolute paths are used as-is. Earlier versions could ignore this setting and use `/prompts.db` instead. Honoring a different configured path can therefore show an empty or different library. PromptManager does not automatically move or merge database files. Before upgrading or changing this setting: 1. Identify the database your current installation actually uses and confirm its library contents. Check both the configured path and the prior fallback `/prompts.db`; keep track of which existing file you intend to use. 2. Preserve a consistent backup of the active database with the dashboard's Backup/Restore backup action or SQLite's online backup API. Do not copy only the main file of a live SQLite database: committed data may still be in its `-wal` file. For a filesystem copy, stop ComfyUI cleanly first and preserve any remaining `-wal` file together with the main database. 3. Set `database.default_path` to the existing intended database file. An absolute path makes the selection explicit; do not move or overwrite either database while choosing the path. 4. Restart ComfyUI, then verify that the expected library appears and the active database path resolves to the file you selected. Keep the backup until both checks succeed. ### Gallery & Monitoring Settings Configure the automatic image detection and gallery system: ```python # Gallery monitoring configuration (GalleryConfig class) MONITORING_ENABLED = True MONITORING_DIRECTORIES = [] # Auto-detect ComfyUI output if empty SUPPORTED_EXTENSIONS = ['.png', '.jpg', '.jpeg', '.webp', '.gif'] PROCESSING_DELAY = 2.0 # Delay before processing new images PROMPT_TIMEOUT = 120 # Seconds to keep prompt context active CLEANUP_INTERVAL = 300 # Seconds between cleanup of expired prompts # Performance settings MAX_CONCURRENT_PROCESSING = 3 METADATA_EXTRACTION_TIMEOUT = 10 # Seconds for PNG analysis IMAGES_PER_PAGE = 20 THUMBNAIL_SIZE = 256 ``` ### Web Interface Settings Configure the web interface behavior: ```python # Web UI settings (PromptManagerConfig class) RESULT_TIMEOUT = 5 # Seconds to auto-hide results in ComfyUI node WEBUI_DISPLAY_MODE = 'newtab' # 'popup' or 'newtab' for Web UI button INFINITE_SCROLL = False # Dashboard list loads the next page on scroll by default SHOW_TEST_BUTTON = False # Show API test button in node UI ``` All of these are editable in the dashboard Settings modal and saved to `config.json` (which is private to the installation and holds the CivitAI key, so it is never committed). ### Performance Tuning - **Worker threads** (Settings โ†’ Performance): threads used by the image rescan, thumbnail generation and duplicate detection. Default is half the detected cores, maximum is the core count. Pillow releases the GIL while decoding, so the scan and thumbnails scale almost linearly; keep a few cores free while ComfyUI is generating. - The database automatically creates indexes for optimal search performance - Regular `VACUUM` operations keep the database optimized - Consider backing up the database periodically ## Advanced Features ### Export Your Prompts ```python from database.operations import PromptDatabase db = PromptDatabase() # Export to JSON db.export_prompts("my_prompts.json", format="json") # Export to CSV db.export_prompts("my_prompts.csv", format="csv") ``` ### Database Statistics ```python info = db.model.get_database_info() print(f"Total prompts: {info['total_prompts']}") print(f"Average rating: {info['average_rating']}") ``` ### Backup and Restore ```python # Create backup db.model.backup_database("backup_prompts.db") # The online backup includes committed data still in the WAL. ``` ## Development ### Running Tests ```bash cd ComfyUI_PromptManager pip install -r requirements-dev.txt python -m unittest discover -s tests # Python (what CI runs) node --test tests/js/*.test.js # frontend pure modules python -m coverage run -m unittest discover -s tests && python -m coverage combine && python -m coverage report ``` CI runs the suite on Linux, Windows and macOS for Python 3.10 to 3.12 with an 85% coverage gate. Tests that delete a database file first check that nothing in the process still holds it open (`tests/open_handles.py`), so a connection leak fails on Linux the way it would on Windows. ### Code Style The project follows PEP 8 guidelines with: - Black formatter (88 character line limit) - Type hints for all functions - Comprehensive docstrings - Proper error handling ### Contributing 1. Fork the repository 2. Create a feature branch 3. Add tests for new functionality 4. Ensure all tests pass 5. Submit a pull request ## Troubleshooting ### Common Issues **Database Permission Errors** - Ensure the ComfyUI process has write permissions to the node directory - Check that the database file isn't locked by another process **Import Errors** - Verify ComfyUI is properly installed - Check that all required dependencies are available **Performance Issues** - Run `VACUUM` on the database occasionally - Consider archiving old prompts if the database becomes very large ### Debug Mode For debugging, you can enable verbose logging in the node: ```python # Add to prompt_manager.py import logging logging.basicConfig(level=logging.DEBUG) ``` ## License MIT License - see LICENSE file for details. ## Support - **Issues**: Report bugs and request features via GitHub Issues - **Documentation**: See the Wiki for detailed guides - **Community**: Join the discussion in ComfyUI Discord ## Roadmap ### Recently Completed - **โœ… Security & Reliability Hardening (3.3.0)**: validated gallery roots, contained file serving, safe backups and restores, background scans, 85%+ test coverage on all three operating systems - **โœ… Worker Threads**: scan, thumbnails and duplicate detection run on a configurable thread pool - **โœ… Tag Autocomplete & Infinite Scrolling**: faster browsing in the dashboard and gallery - **โœ… Queue-Time Run Counting (3.2.4)**: run counts and image linking follow the ComfyUI queue - **โœ… LoRA Manager Integration**: Import LoRA metadata, trigger words, and preview images - **โœ… Folder Filter**: Browse and filter prompts by output subdirectory - **โœ… Multi-Directory Gallery**: Scan multiple output directories simultaneously - **โœ… WD14 Tagger**: Fast ONNX-based auto-tagging with Danbooru tags - **โœ… Tailwind v4 Migration**: ComfyUI theme token system for consistent styling - **โœ… Tag Management Page**: Dedicated page for tag search, rename, merge, and delete - **โœ… Junction Table Tags**: Normalized tag storage with proper foreign keys ### Planned Features - **โ˜๏ธ Cloud Sync**: Optional cloud backup and sync - **๐Ÿค Collaboration**: Share prompt collections with other users - **๐Ÿง  AI Suggestions**: Recommend similar prompts based on metadata analysis - **๐Ÿ“ˆ Advanced Analytics**: Detailed usage statistics and trends with workflow insights - **๐Ÿ”„ Workflow Templates**: Save and reuse common workflow patterns - **๐Ÿ“Š Visual Analytics**: Charts and graphs for prompt effectiveness analysis ## Changelog ### v3.3.1 (Proxy Routing Fix) - **๐ŸŒ Proxy support**: the dashboard, gallery, tag page and metadata viewer now work when ComfyUI is reached through a proxy mount such as SwarmUI's `/ComfyBackendDirect/`. Scripts, images, API calls, progress streams and gallery folder filters stay under the mount, and the canvas node's buttons use ComfyUI's `fileURL()`. Direct ComfyUI URLs are unchanged. Thanks to @ghosttigerllc-bit ([#164](https://github.com/ComfyAssets/ComfyUI_PromptManager/pull/164)) - **๐Ÿ“ฆ Dependencies**: the runtime minimums stay at `Pillow>=8.0.0` and `watchdog>=2.1.0`, so updating Prompt Manager never forces upgrades in the shared ComfyUI environment ### v3.3.0 (Hardening, Background Jobs & Worker Threads) - **๐Ÿ”’ Security**: gallery roots restricted to ComfyUI directories and validated wherever they are read; media-only, fail-closed image serving; Windows path escape in static routes closed; quote-safe HTML escaping with inline handlers moved to data attributes; the CivitAI key is never returned and only sent to HTTPS CivitAI hosts; auto-tag paths contained; side-effect routes are POST-only; backups include the WAL and restores are size-capped, integrity-checked and applied through SQLite's online backup API - **๐Ÿงต Worker Threads**: a Settings slider (default half the cores) used by the image rescan, thumbnail generation and duplicate detection. Measured: a 1 GB sample scanned in 2.5 s instead of 18 s at 8 threads - **๐Ÿ” Background Jobs**: the image rescan and the duplicate scan run on the server, stream progress, survive a closed tab, minimize to a progress pill and re-attach after a reload - **๐ŸŽฌ Video Prompts**: the scan reads the prompt ComfyUI's video savers embed in MP4/MOV/WebM containers (needs `ffprobe`) - **๐Ÿ–ผ๏ธ Thumbnails**: written atomically and served under versioned URLs so a regenerated thumbnail never shows a stale cached copy; the per-run cap applies only to thumbnails that still need generating and the gallery says how many remain - **๐Ÿท๏ธ Tag Autocomplete**: the dashboard tag box suggests tags, narrowed to those that co-occur with the tags already typed - **โ™พ๏ธ Infinite Scrolling**: optional in the gallery and the dashboard list (saved default plus a session toggle) - **โš™๏ธ Gallery Settings** now apply at load; grid columns, media info and the Rescan button work as labelled - **๐Ÿ› Correctness**: run counts increment when ComfyUI dequeues a prompt; negative prompts are never traced; per-thread SQLite connections and idempotent migrations (an old rebuild could delete every image row); `truncate_logs` no longer rolls the log over; the ComfyUI canvas loads only the canvas extension; Windows console banners are ASCII-safe; subfolders use `/` on every platform - **๐Ÿงช Tests & CI**: 1,460 Python and 142 JavaScript tests (from 510 and 26), coverage 96% with an 85% gate, CI on Linux, Windows and macOS for Python 3.10โ€“3.12, flake8 clean - **โš ๏ธ API changes**: image paths in responses are relative to the ComfyUI tree (use `url`); `autotag/download`, `autotag/start` and the thumbnail progress stream are POST-only; `lora/status` returns `has_civitai_api_key` instead of the key; `/search` is paginated ### v3.2.4 (Recently Used Sorting & Queue-Time Run Counts) - **๐Ÿ•’ Recently Used Sort**: sort the dashboard by last use, most used or rating, server-side across pages - **๐Ÿ”ข Run Counts**: `run_count` and `last_used_at` are recorded through the ComfyUI queue hook, so cached nodes still count - **๐Ÿ”— Positive-Prompt Image Linking**: generated images link to the positive prompt traced through the queued graph ### v3.2.1 (LoRA Manager Integration) - **๐Ÿ”— LoRA Manager Integration**: Import LoRA metadata, trigger words, and CivitAI example images from [ComfyUI-Lora-Manager](https://github.com/willmiao/ComfyUI-Lora-Manager) into your prompt database - **๐Ÿ’‰ Auto-Inject Trigger Words**: Optionally append LoRA trigger words when `` is detected in prompts during encoding - **๐Ÿ”‘ CivitAI API Key Support**: Authenticate with CivitAI to download NSFW preview images - **๐Ÿ“ฅ Import Progress Modal**: Real-time SSE streaming progress during LoRA import with per-model status > **Note:** LoRA Manager support is a WIP โ€” this was a highly requested feature. Please [open issues](https://github.com/ComfyAssets/ComfyUI_PromptManager/issues) for any bugs or feature requests. ### v3.2.0 (Folder Filter & QoL Improvements) - **๐Ÿ“ Folder Filter**: New folder dropdown in the search panel to filter prompts by output subdirectory - **๐Ÿ“‚ Multi-Directory Gallery Scan**: Configure multiple output directories and browse them all in one gallery - **๐Ÿ–ผ๏ธ Filmstrip Prompt Display**: Show prompt text and copy button in the filmstrip image viewer - **๐Ÿ–ฑ๏ธ Click-to-Close Viewer**: Click outside the image viewer to close it - **๐Ÿ› Bug Fixes**: Fixed database path config, UnboundLocalError in text inputs, node caching skip, diagnostics singleton lifecycle ### v3.1.0 (WD14 Tagger, Tailwind v4 & Major Refactors) - **๐Ÿท๏ธ WD14 Tagger Support**: Added WD14 SwinV2 and WD14 ViT as new auto-tag model options โ€” fast ONNX-based classifiers (~400MB) that output Danbooru tags with confidence scores, no prompt needed - **๐ŸŽš๏ธ Threshold Controls**: Adjustable general tag (default 0.35) and character tag (default 0.85) confidence thresholds for WD14 models via UI sliders - **๐ŸŽจ Tailwind v4 Migration**: Complete frontend redesign with ComfyUI theme token system (`--pm-*` design tokens) that adapts to ComfyUI's color palette - **๐Ÿ—๏ธ API Refactor**: Split monolithic `api.py` into domain-specific route modules for better maintainability - **๐Ÿ—ƒ๏ธ Junction Table Tags**: Migrated tag storage from JSON column to normalized junction tables with proper foreign keys - **๐Ÿ“„ Tags Page**: Dedicated tag management page with search, rename, merge, and delete operations - **๐Ÿ” Load More Button**: Progressive prompt loading instead of traditional pagination - **๐Ÿ”’ Security Hardening**: Resolved 15 GitHub code scanning alerts, prevented stack trace exposure in SSE errors - **๐Ÿงช Test Coverage**: Added comprehensive unit tests for validators, hashing, metadata, config, and prompt tracker; API integration tests; database tests with CI pipeline - **โš™๏ธ CI/CD Improvements**: Added code quality scanning, security scanning, Dependabot, and pre-commit hooks with Black formatting - **๐Ÿ› Bug Fixes**: Fixed custom image scan directory config (#108), gallery crash on thumbnail linking, broken imports after API refactor, widget value sync issues, and prepend/append metadata tag filtering in auto-tagger ### v3.0.26 (Top Bar Button) - **๐Ÿ”˜ Top Bar PM Button**: Added a "PM" button to the ComfyUI top bar for quick access to the admin dashboard - **๐Ÿš€ No Node Required**: Open PromptManager without having to add the node to your workflow first - **๐ŸŽจ Teal Button Design**: Distinctive teal-colored button positioned before the settings gear - **๐Ÿ”„ Frontend Compatibility**: Works with both new ComfyUI frontend (v1.3.1+) and legacy versions ### v3.0.25 (Film Strip & QoL Improvements) - **๐ŸŽž๏ธ Film Strip Preview**: Backported from V2 - thumbnail strip under each prompt showing linked images - **๐Ÿ–ผ๏ธ Quick Image Viewer**: Click any filmstrip thumbnail to open full-size image viewer - **๐Ÿ“ธ Smart Thumbnails**: Automatically uses generated thumbnails for faster loading, falls back to full images - **โฌ†๏ธ Auto-Scroll on Pagination**: Page navigation now smoothly scrolls to top after loading ### v3.0.24 (Manual Prompt Creation) - **โž• Add Prompt Button**: New "Add Prompt" button in the admin dashboard Bulk Actions bar - **๐Ÿ“ Direct Prompt Creation**: Create prompts directly from the UI without generating images - **๐Ÿ›ก๏ธ Protection from Pruning**: New prompts are automatically protected from orphan cleanup by default - **๐Ÿท๏ธ Full Metadata Support**: Set category, tags, rating, and notes when creating prompts - **๐Ÿ”’ Orphan Protection Toggle**: Option to protect or unprotect prompts from maintenance cleanup ### v3.0.23 (AI AutoTag Release) - **๐Ÿท๏ธ AI AutoTag**: Automatically tag your entire image collection using JoyCaption vision models - **๐Ÿค– Dual Model Support**: Choose between JoyCaption Beta One FP16 (high quality) or GGUF FP8 (lower VRAM) - **๐Ÿ“‹ Two Tagging Modes**: Batch mode for bulk tagging, Review mode for one-by-one approval - **โš™๏ธ Smart Tag Handling**: Skip already-tagged images or re-tag all - respects your existing work - **โœ๏ธ Customizable Prompts**: Adjust the system prompt to match your collection style and tag vocabulary - **๐Ÿ”„ Real-time Progress**: SSE-based streaming progress updates during batch operations - **๐Ÿ“ฆ Tag Accordion UI**: Collapsible tag display shows first row with expandable section for large tag sets - **๐ŸŽฏ Review Confirmation**: Prompts before overwriting existing tags in review mode ### v3.0.10 (Batch Processing Node) - **๐Ÿ“‹ PromptSearchList Node**: New node that searches the prompt database and outputs results as a list - **๐Ÿ”— Batch Processing Support**: Uses `OUTPUT_IS_LIST` for native ComfyUI batch processing compatibility - **๐Ÿ” Full Search Capabilities**: Search by text, category, tags, minimum rating, and result limit - **โšก Lightweight Operation**: Read-only search with no database writes - **๐ŸŽฏ Workflow Integration**: Connect directly to batch processing nodes like String OutputList ### v3.0.9 (Output-Wide Gallery & Video Support) - **๐Ÿ“ Output-Wide Gallery Mode**: Complete gallery redesign to show ALL content from ComfyUI output directory - **๐ŸŽฌ Full Video Support**: Native video playback with HTML5 player for .mp4, .webm, .avi, .mov, .mkv, .m4v, .wmv formats - **๐Ÿ–ผ๏ธ Video Thumbnail Generation**: Automatic video thumbnails using OpenCV, ffmpeg, or placeholder fallback - **โš™๏ธ Video Settings Panel**: Configurable autoplay, mute, and loop settings with persistent preferences - **๐ŸŽฎ Video Navigation**: Seamless navigation between videos with keyboard shortcuts and custom controls - **๐Ÿ“Š Video Metadata Display**: Show duration, resolution, aspect ratio, and detailed file information - **๐Ÿ”„ Mixed Media Integration**: Videos and images seamlessly integrated in the same gallery interface - **โšก Enhanced Performance**: Optimized thumbnail generation for both images and videos - **๐ŸŽ›๏ธ Advanced Gallery Settings**: Comprehensive settings panel with video controls and performance options - **๐Ÿ–ฑ๏ธ Improved Click Handling**: Fixed thumbnail failures to preserve click functionality - **๐Ÿ“ฑ Mobile Compatibility**: Enhanced responsive design for video playback on all devices ### v3.0.5 (Text-Only Node Release) - **๐Ÿ“ PromptManagerText Node**: New text-only variant that outputs STRING instead of CONDITIONING - **๐Ÿ”— Text Concatenation**: Built-in prepend/append functionality for dynamic text assembly - **โšก Lightweight Processing**: No CLIP encoding overhead for pure text workflows - **๐Ÿ”„ Dual Node Architecture**: Choose between CLIP encoding (PromptManager) or text-only (PromptManagerText) - **๐Ÿท๏ธ Shared Metadata System**: Both nodes use the same database and metadata features - **๐Ÿ–ผ๏ธ Unified Gallery**: Images from both node types appear in the same gallery system - **๐Ÿ“Š Enhanced Tracking**: Improved prompt tracking with prepend/append context preservation - **๐Ÿ“Š Enhanced Tracking**: Improved prompt tracking with prepend/append context preservation ### v3.0.3 (ViewerJS Integration & Enhanced Gallery) - **๐Ÿ–ผ๏ธ Professional Image Viewer**: Complete gallery redesign with [ViewerJS](https://github.com/fengyuanchen/viewerjs) integration - **โšก Advanced Image Navigation**: Zoom, rotation, slideshow, and professional viewing controls - **๐ŸŽจ Dark Theme Integration**: Seamless ViewerJS styling that matches the admin interface - **๐Ÿ”ฌ Enhanced Metadata Parsing**: Improved ComfyUI workflow parameter extraction with targeted parsing - **๐Ÿ“Š Real-time Parameter Display**: Live CFG, steps, sampler, and seed extraction from workflow nodes - **๐Ÿ“‹ Integrated Copy Functionality**: One-click copying of prompts and generation parameters - **๐Ÿ› ๏ธ Robust Value Detection**: Smart parsing that targets specific node types and validates parameters - **โŒจ๏ธ Keyboard Navigation**: Full keyboard support for gallery navigation and viewer controls - **๐Ÿ“ฑ Responsive Design**: Enhanced mobile and tablet compatibility ### v3.0.0 (Metadata Analysis Release) - **๐Ÿ”ฌ PNG Metadata Analysis**: Advanced ComfyUI workflow extraction from PNG images - **๐Ÿ“‹ Standalone Metadata Viewer**: Dedicated tool at `/web/metadata.html` for analyzing any ComfyUI image - **๐Ÿ–ผ๏ธ Integrated Metadata Panel**: Real-time workflow analysis in the image viewer - **๐Ÿ“ธ Bulk Image Scanning**: Mass import and analysis of existing ComfyUI output directories - **๐Ÿ› ๏ธ System Management Suite**: Complete backup, restore, maintenance, and diagnostic tools - **๐Ÿšฎ Orphaned Prompt Cleanup**: Remove prompts that have no linked images for database optimization - **๐Ÿ“‹ Advanced Logging**: Comprehensive logging system with web-based log viewer - **๐ŸŽจ Enhanced Admin Dashboard**: Modern dark theme with improved UX and management tools - **๐Ÿ”ง Robust Error Handling**: Advanced PNG parsing with NaN value cleaning and error recovery - **๐Ÿ“ File Path Integration**: Direct file path display and system integration - **โšก Performance Optimizations**: Improved metadata extraction and database operations ### v2.0.0 (Gallery Release) - **๐Ÿ–ผ๏ธ Automatic Image Gallery**: Complete image tracking and gallery system - **๐ŸŒ Advanced Web Interface**: Comprehensive admin dashboard with responsive design - **๐Ÿ“ฑ Image Viewer**: Full-screen modal with navigation and keyboard shortcuts - **๐Ÿ” Enhanced Search**: Real-time search with advanced filtering options - **โšก Performance Improvements**: Optimized database operations - **๐Ÿ› ๏ธ Basic Diagnostics**: Initial system diagnostics and health monitoring - **๐Ÿ“Š Bulk Operations**: Multi-select prompt editing and management ### v1.0.0 (Initial Release) - Core text encoding with database storage - Search and filtering functionality - Metadata support (categories, tags, ratings, notes) - Hash-based deduplication - SQLite backend with optimized schema - Basic web interface - Export functionality