- 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.
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.
Fix compatibility issue with older SQLite versions that don't support
ORDER BY clause inside GROUP_CONCAT function.
- Remove ORDER BY from GROUP_CONCAT in SQL queries
- Add GROUP_CONCAT for created_at dates
- Sort IDs manually in Python after fetching results
- Maintain same behavior of keeping oldest prompt as primary
This resolves the startup error:
"sqlite3.OperationalError: near 'ORDER': syntax error"
The fix ensures compatibility with all SQLite versions while preserving
the original functionality of keeping the oldest duplicate.
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.
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.