Commit Graph
26 Commits
Author SHA1 Message Date
Vito Sansevero 3fe2ee5075 feat(api): serve static files and update thumbnail paths 2026-02-02 15:09:25 -08:00
Vito Sansevero da239bb7e1 feat(api): exclude protected prompts from pruning 2025-12-09 09:29:34 -08:00
Vito Sansevero 11d25afa56 feat(api): add unload autotag model endpoint 2025-12-09 06:05:04 -08:00
Vito Sansevero 56eed388a8 feat(api): add AutoTag endpoints and image routes 2025-12-07 17:25:06 -08:00
Vito Sansevero 22593e8514 docs: add comprehensive docstrings to all Python modules
- Add Google-style docstrings to main node files (prompt_manager.py, prompt_manager_text.py)
- Enhance database module docstrings with detailed parameter and return documentation
- Add comprehensive docstrings to all utils modules with usage examples
- Document API endpoints and configuration classes thoroughly
- Update module-level docstrings in all __init__.py files
- Ensure consistent naming (ComfyUI_PromptManager) across all documentation
- Follow Python best practices for docstring formatting
2025-08-12 06:51:36 -07:00
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 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 7cc042f48c fix(gallery): resolve duplicate image display on Windows
Fix issue where every image appears twice in gallery on Windows systems
due to case-insensitive filesystem and path handling differences.

- Deduplicate files when searching with both lowercase/uppercase extensions
- Use pathlib.as_posix() to ensure forward slashes in URLs on all platforms
- Add normalized path tracking to prevent duplicate file collection

The root cause was:
1. Files were found twice (once for *.png and once for *.PNG) on Windows
2. URLs with backslashes caused path inconsistencies

Fixes gallery showing 1922 images when only 961 files exist on disk.
2025-08-04 06:48:53 -07:00
Vito Sansevero 983306366f fix(api): handle new ComfyUI workflow format with list-based inputs
Fix AttributeError when processing PNG files with newer ComfyUI workflow format
where node inputs are stored as lists instead of dictionaries.

- Add _get_node_inputs() helper to normalize both dict and list input formats
- Add _find_text_in_node() to extract text from nodes using multiple strategies
- Update _extract_positive_prompt_from_comfyui_data() to use safe accessors
- Maintain full backward compatibility with existing workflow formats

Fixes error: "'list' object has no attribute 'get'" when scanning images
from workflows using the newer ComfyUI format.
2025-08-04 06:31:35 -07:00
Vito Sansevero 6e7a958355 style(api): Change log level from info to debug 2025-06-19 16:56:14 -07:00
Vito Sansevero f6dd6d65cf feat(api): add duplicate image scan and delete endpoints 2025-06-09 09:03:26 -07:00
Vito Sansevero 0c54c4dced feat(api): Add gallery and thumbnail management endpoints 2025-06-09 08:41:42 -07:00
Vito Sansevero 2af331b375 refactor(api): improve ComfyUI output dir detection logic reported in #27 2025-06-08 13:45:43 -07:00
Vito Sansevero 3d00d1ef45 feat(api): add pruning for orphaned prompts 2025-06-03 17:55:56 -07:00
Vito Sansevero e13d4f0284 refactor(api): update html path in PromptManagerAPI 2025-06-03 17:05:53 -07:00
Vito Sansevero 9e117496e0 feat(api): add gallery interface and config settings, for metadata 2025-06-01 12:25:19 -07:00
Vito Sansevero 815b034c2d feat(api): add endpoint to add tags to prompts 2025-05-29 06:47:36 -07:00
Vito Sansevero 861dbd8a12 refactor(api): clean up and enhance category handling 2025-05-28 13:00:10 -07:00
Vito Sansevero 4f6d7234d6 feat(api): add pagination and A1111 parsing support 2025-05-28 11:01:20 -07:00
Vito Sansevero fb46931b1a feat(logging): integrate logging throughout API 2025-05-28 08:28:49 -07:00
Vito Sansevero 7a42cf96ed feat(api): add scan images endpoint for metadata parsing 2025-05-27 14:57:51 -07:00
Vito Sansevero 4fca3f6d87 feat(api): add database backup and restore endpoints 2025-05-27 14:29:01 -07:00
Vito Sansevero bb7329bff7 feat(api): handle duplicate prompts with metadata update 2025-05-27 12:35:43 -07:00
Vito Sansevero 67b77d457e feat(api): add maintenance endpoint for database 2025-05-26 10:11:19 -07:00
Vito Sansevero 27ca3b0555 fix(api): fix foreign key constraint error deletion 2025-05-25 21:37:02 -07:00
Vito Sansevero 96113cbabd feat(api): Add PromptManager API and config files 2025-05-24 12:27:01 -07:00