Skip to content

feat: optimize random images, improve ComfyUI detection and prompt display#855

Closed
Copilot wants to merge 1 commit intooptimize-random-imagesfrom
copilot/sub-pr-854
Closed

feat: optimize random images, improve ComfyUI detection and prompt display#855
Copilot wants to merge 1 commit intooptimize-random-imagesfrom
copilot/sub-pr-854

Conversation

Copy link

Copilot AI commented Nov 30, 2025

Optimizes random image selection using native SQLite, improves ComfyUI metadata parsing, and adds intelligent prompt formatting based on content type.

Backend

  • Random images: Refactored get_random_images() from 60+ lines of multi-cycle index calculations to ~20 lines using ORDER BY RANDOM() LIMIT n
  • ComfyUI support: Added fallback to parameters field in PNG metadata for ComfyUI-generated images

Frontend

  • Smart prompt display: Auto-detects tag-style vs natural language prompts
    • Tags displayed as badges
    • Natural language shown as paragraphs
  • Text length calculation: Added getTextLength() with CJK character weighting (1 Chinese char = 3 letters)
  • Detection rules:
    • Any tag > 50 chars → natural language
    • Average tag length > 30 → natural language

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Optimize random images and improve ComfyUI detection feat: optimize random images, improve ComfyUI detection and prompt display Nov 30, 2025
Copilot AI requested a review from zanllp November 30, 2025 12:53
@zanllp zanllp closed this Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments