Commit Graph
29 Commits
Author SHA1 Message Date
Vito Sansevero db5f6c3307 fix(gallery): improve thumbnail generation progress feedback and modal width
Frontend improvements:
- Fixed "Check thumbnails at startup" modal to use EventSource properly
- Shows current file being processed with directory path
- Displays file type (image/video) and action (generating/skipping)
- Real-time progress updates with ETA calculation
- Detailed status messages in scrollable log area
- Increased modal width from max-w-md to max-w-2xl for long filenames
- Path truncation for files over 60 characters
- Console logging for debugging when debug mode enabled
- Better EventSource error handling with connection state logging

Backend improvements:
- Verbose scanning progress with directory counts
- File type breakdown in start message (X images, Y videos)
- More frequent progress updates (every 5 files instead of 10)
- Include current file path, type, and action in progress events
- Send error notifications during processing (first 5 errors)
- Enhanced completion message with error count and processing rate
- Detailed logging throughout the process

The thumbnail generation now provides real-time, detailed feedback in both
the settings panel and the startup prompt modal, making it clear which files
are being processed and the overall progress.
2025-08-11 19:10:41 -07:00
Vito Sansevero 638dd44db2 fix(gallery): complete metadata parsing improvements for all gallery views
- Fixed TypeError "text.toLowerCase is not a function" by adding type checking
- Added support for modern ComfyUI node types:
  - CFGGuider for CFG scale values
  - BasicScheduler for steps parameter
  - KSamplerSelect for sampler selection
  - RandomNoise/SeedHistory for seed values
- Unified metadata parsing logic between main gallery and metadata viewer
- Fixed prompt identification to properly distinguish positive vs negative prompts
- Added NaN cleaning for JSON parsing to handle malformed data
- Improved text node analysis with PromptManager priority

All three gallery implementations now correctly parse and display:
- Checkpoint names
- Positive and negative prompts
- Technical parameters (steps, CFG, sampler, seed)
- Support for both legacy and modern ComfyUI workflows

Tested and verified with test_metadata_file.png across all implementations.
2025-08-11 15:30:40 -07:00
Vito Sansevero 6fdfdea89c fix(gallery): enhance metadata parsing for modern ComfyUI workflows
- Add support for new ComfyUI node types in gallery metadata extraction:
  - CFGGuider for CFG scale values
  - BasicScheduler for steps parameter
  - KSamplerSelect for sampler selection
  - RandomNoise/SeedHistory for seed values
- Update both main gallery (/gallery) and metadata viewer (/metadata.html)
- Fix metadata display issues where technical parameters showed as "Unknown"
- Add comprehensive test image and debug tools for validation
- Maintain backward compatibility with legacy KSampler nodes

This resolves metadata parsing issues with modern ComfyUI workflows
that use the newer node architecture for sampling and generation.
2025-08-11 15:15:19 -07:00
Vito Sansevero a17dcba540 fix(gallery): resolve prompt display issue when navigating between images
Fixes issue where PromptManager Gallery showed identical prompts for all
images when using workflows like Flux models that generate multiple images
with the same base workflow.

**Problem:**
- Gallery relied solely on PNG metadata extraction for prompt display
- Images generated from same workflow (e.g., Flux models) contained
  identical workflow metadata but should show different prompts
- Navigation between images didn't update prompt information correctly

**Solution:**
1. **Enhanced metadata extraction:**
   - Improved parseWorkflowData() to handle more ComfyUI node types
   - Added support for PromptManagerText, UNETLoader, DualCLIPLoader
   - Better negative prompt detection patterns
   - Enhanced sampling parameter extraction

2. **New API endpoint:**
   - Added GET /prompt_manager/images/prompt/{image_path}
   - Queries database for actual prompt used during generation
   - Provides accurate prompt data linked to specific images

3. **Hybrid metadata loading:**
   - Primary: Query database for linked prompt data
   - Fallback: Extract from PNG metadata if no database record
   - Combines database prompts with PNG technical parameters

**Changes:**
- py/api.py: Added get_image_prompt() endpoint and route
- web/gallery.html: Enhanced loadImageMetadata() and parseWorkflowData()

**Result:**
- Gallery now displays correct, unique prompts for each image
- Prompt information updates properly when navigating between images
- Generation data refreshes correctly with prev/next navigation
- Maintains backward compatibility for images without database records

Resolves user-reported issue with Flux.1_Krea_Dev_workflow.json where
all images showed identical prompts in gallery view.
2025-08-11 14:18:13 -07:00
Vito Sansevero ff12c03619 feat(gallery): Add thumbnail check on startup 2025-06-19 16:56:04 -07:00
Vito Sansevero 6fd0eb7a37 feat(gallery): add input for direct page navigation 2025-06-11 13:43:07 -07:00
Vito Sansevero f5d2e998f3 feat(gallery): Add duplicate image scanning feature 2025-06-09 09:03:12 -07:00
Vito Sansevero d3d03f4c07 feat(web): Add gallery button for image management 2025-06-09 08:41:24 -07:00
Vito Sansevero 8d8d6f00fe feat: Add gallery page for PromptManager with features 2025-06-09 08:41:11 -07:00
Vito Sansevero 6c73532055 feat(prompt_manager): support PromptManagerText nodes 2025-06-08 15:50:18 -07:00
Vito Sansevero 9cbe0eec31 feat(viewer): integrate ViewerJS for image gallery 2025-06-04 08:57:26 -07:00
Vito Sansevero 180ae12f4d feat(web): add sort and star hover functionality 2025-06-04 06:52:04 -07:00
Vito Sansevero 9785c3b0b2 feat(admin): add sticky search controls and prune option 2025-06-03 17:55:44 -07:00
Vito Sansevero 389d739303 refactor(admin): improve notification z-index handling 2025-06-03 17:03:29 -07:00
Vito Sansevero 6b6ba3c62c feat(prompt_manager): add prepend and append text options 2025-06-03 17:03:18 -07:00
Vito Sansevero ece65edbb2 feat(metadata): Add metadata extraction in viewer 2025-06-01 12:25:41 -07:00
Vito Sansevero 2dd63d98d4 refactor(prompt_manager): update search state handling 2025-06-01 07:44:33 -07:00
Vito Sansevero 0cd92f9c36 feat(tags): Add individual tag modal functionality 2025-05-29 06:47:50 -07:00
Vito Sansevero 763e1d64b0 refactor: improve stats update logic 2025-05-28 12:59:59 -07:00
Vito Sansevero fb09229719 feat(admin): add pagination controls to recent prompts 2025-05-28 11:01:10 -07:00
Vito Sansevero d02a939051 feat(web): add logs modal for viewing system logs 2025-05-28 08:27:45 -07:00
Vito Sansevero 3f77b07f85 feat(web): add image scanning feature in admin UI 2025-05-27 14:58:07 -07:00
Vito Sansevero f896f13b1a style: Fix formatting and spacing issues 2025-05-27 14:29:27 -07:00
Vito Sansevero 57aae95f8d feat(admin): add DB backup and restore functionality 2025-05-27 14:29:17 -07:00
Vito Sansevero 9f3c77f6d3 feat(prompt_manager): preserve user resize preferences 2025-05-27 14:01:34 -07:00
Vito Sansevero ab1df9c50a feat(admin): add maintenance modal and operations 2025-05-26 10:11:29 -07:00
Vito Sansevero 166968f8a7 feat(admin): add copy prompt to clipboard feature 2025-05-25 21:22:34 -07:00
Vito Sansevero d8a8f278dc feat(image viewer): add image fit/full toggle feature 2025-05-24 14:53:46 -07:00
Vito Sansevero 092f80bb05 feat(web): Add admin and index UI for PromptManager 2025-05-24 12:26:21 -07:00