Commit Graph
169 Commits
Author SHA1 Message Date
Vito Sansevero 97cc4c175f cleanup: remove temporary debug files 2025-08-11 15:15:45 -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 a6997e0c8c chore: bump version to 3.0.17 in pyproject.toml 2025-08-11 14:20:49 -07:00
Vito 922be66aa4 Merge pull request #42 from ComfyAssets/fix/gallery-prompt-navigation-issue
fix(gallery): resolve prompt display issue when navigating between images fixes #41
2025-08-11 14:20:12 -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 6aa924cbf0 style: Fix formatting and imports in prompt manager 2025-08-08 20:45:34 -07:00
Vito Sansevero 190146f7b6 chore(pyproject): bump version to 3.0.16 2025-08-04 07:00:14 -07:00
Vito 0c01a86803 Merge pull request #40 from ComfyAssets/fix/sqlite-order-by-compatibility
fix(database): resolve SQLite ORDER BY syntax error in GROUP_CONCAT fixes #36
2025-08-04 06:59:32 -07:00
Vito Sansevero f161fc4c1f fix(database): resolve SQLite ORDER BY syntax error in GROUP_CONCAT
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.
2025-08-04 06:56:05 -07:00
Vito 52d137183e Merge pull request #39 from ComfyAssets/fix/windows-duplicate-images
fix(gallery): resolve duplicate image display on Windows, should fix #37
2025-08-04 06:50:09 -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 b39eeb0c59 Merge pull request #38 from ComfyAssets/fix/workflow-format-compatibility
Fix/workflow format compatibility
2025-08-04 06:33:15 -07:00
Vito Sansevero f488eec029 chore: bump version to 3.0.15 in pyproject.toml 2025-08-04 06:32:48 -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 e2eef54eb3 feat(utils): Add ComfyUI integration utilities 2025-07-25 14:03:49 -07:00
Vito Sansevero e0a7f509a1 feat: Add ComfyUI integration to PromptManagerText 2025-07-25 14:03:40 -07:00
Vito Sansevero e2d2ff17ae feat(prompt_manager): integrate ComfyUI for metadata 2025-07-25 14:03:08 -07:00
Vito Sansevero eb183d191c style(init): clean up whitespace and formatting 2025-07-25 14:02:57 -07:00
Vito Sansevero cb3d09ad46 chore: bump version to 3.0.13 in pyproject.toml 2025-06-19 16:56:52 -07:00
Vito Sansevero f7a2c2a5f5 style: Change log level from info to debug 2025-06-19 16:56:45 -07:00
Vito Sansevero caa48d7cdf refactor(database): enhance prompt ID validation logic 2025-06-19 16:56:33 -07:00
Vito Sansevero 2c890f7eaa style(models): Change log level from info to debug 2025-06-19 16:56:25 -07:00
Vito Sansevero 6e7a958355 style(api): Change log level from info to debug 2025-06-19 16:56:14 -07:00
Vito Sansevero ff12c03619 feat(gallery): Add thumbnail check on startup 2025-06-19 16:56:04 -07:00
Vito fccac4f93d Merge pull request #34 from ComfyAssets/cleanup-logs
Cleanup logs
2025-06-19 13:06:55 -07:00
Vito Sansevero 283268a1ec chore: bump version to 3.0.12 in pyproject.toml 2025-06-19 13:06:37 -07:00
Vito Sansevero 685e44fde0 style: Change log level from info to debug 2025-06-19 13:06:18 -07:00
Vito Sansevero ecbd2b4ca2 style: Change log level from info to debug 2025-06-19 13:06:09 -07:00
Vito Sansevero 536a3c8f59 style(prompt_manager_text): Change log level to debug 2025-06-19 13:06:01 -07:00
Vito Sansevero 5ac2dd9315 style(prompt_manager): Change log level from info to debug 2025-06-19 13:05:53 -07:00
Vito Sansevero ed0b1efc81 refactor(init): simplify initialization process 2025-06-19 13:05:41 -07:00
Vito Sansevero 890060bc38 chore(pyproject): update version and add icon URL 2025-06-16 06:38:16 -07:00
Vito c0e64a5974 Merge pull request #33 from ComfyAssets/gallery-pages
Gallery pages
2025-06-11 13:44:02 -07:00
Vito Sansevero f3d49a95d6 chore: bump version to 3.0.10 in pyproject.toml 2025-06-11 13:43:27 -07:00
Vito Sansevero 6fd0eb7a37 feat(gallery): add input for direct page navigation 2025-06-11 13:43:07 -07:00
Vito 38e6605554 Merge pull request #32 from ComfyAssets/new_gallery
New gallery
2025-06-09 10:14:00 -07:00
Vito Sansevero 3a0501c577 chore(images): update and add new images 2025-06-09 10:13:03 -07:00
Vito Sansevero 9c8cd3abe6 docs: Add images to README for visual clarity 2025-06-09 10:12:54 -07:00
Vito Sansevero a31a0a7c41 feat: Add output-wide gallery with full media support 2025-06-09 09:04:05 -07:00
Vito Sansevero 52ffdeda2e feat(database): add method to find duplicate prompts 2025-06-09 09:03:52 -07:00
Vito Sansevero f6dd6d65cf feat(api): add duplicate image scan and delete endpoints 2025-06-09 09:03:26 -07:00
Vito Sansevero f5d2e998f3 feat(gallery): Add duplicate image scanning feature 2025-06-09 09:03:12 -07:00
Vito Sansevero 592812918d chore: bump version to 3.0.9 in pyproject.toml 2025-06-09 08:41:56 -07:00
Vito Sansevero 0c54c4dced feat(api): Add gallery and thumbnail management endpoints 2025-06-09 08:41:42 -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 6321991af0 chore(pyproject): bump version to 3.0.8 2025-06-08 15:53:20 -07:00
Vito 17c4d3c13b Merge pull request #30 from ComfyAssets/text-only
Text only
2025-06-08 15:52:55 -07:00
Vito Sansevero feb8248fdd chore: bump version to 3.0.7 in pyproject.toml 2025-06-08 15:50:48 -07:00
Vito Sansevero 5c34ce3561 style(docs): improve markdown formatting consistency 2025-06-08 15:50:48 -07:00