Skip to content

feat: optimize random images, improve ComfyUI detection and prompt di…#854

Merged
zanllp merged 1 commit into
mainfrom
optimize-random-images
Nov 30, 2025
Merged

feat: optimize random images, improve ComfyUI detection and prompt di…#854
zanllp merged 1 commit into
mainfrom
optimize-random-images

Conversation

@zanllp

@zanllp zanllp commented Nov 30, 2025

Copy link
Copy Markdown
Owner

…splay

Backend optimizations:

  • Refactor get_random_images() using SQLite ORDER BY RANDOM()
  • Simplify from 60+ lines to ~20 lines with better performance
  • Remove complex multi-cycle index calculations
  • Maintain file existence check and auto-cleanup

ComfyUI support:

  • Add fallback to 'parameters' field in PNG metadata
  • Improve detection for ComfyUI-generated images

Frontend improvements:

  • Smart prompt display: auto-detect tag vs natural language format
  • Add getTextLength() with Chinese character weight (1 char = 3 letters)
  • Refactor isTagStylePrompt() with clear rules:
    • Any tag length > 50 natural language format
    • Average tag length > 30 natural language format
  • Natural language prompts shown as paragraphs
  • Tag-style prompts shown as badges
  • Better support for Chinese/English mixed content

Build:

  • Update frontend asset references

…splay

Backend optimizations:
- Refactor get_random_images() using SQLite ORDER BY RANDOM()
- Simplify from 60+ lines to ~20 lines with better performance
- Remove complex multi-cycle index calculations
- Maintain file existence check and auto-cleanup

ComfyUI support:
- Add fallback to 'parameters' field in PNG metadata
- Improve detection for ComfyUI-generated images

Frontend improvements:
- Smart prompt display: auto-detect tag vs natural language format
- Add getTextLength() with Chinese character weight (1 char = 3 letters)
- Refactor isTagStylePrompt() with clear rules:
  * Any tag length > 50  natural language format
  * Average tag length > 30  natural language format
- Natural language prompts shown as paragraphs
- Tag-style prompts shown as badges
- Better support for Chinese/English mixed content

Build:
- Update frontend asset references
@zanllp

zanllp commented Nov 30, 2025

Copy link
Copy Markdown
Owner Author

@copilot

Copilot AI commented Nov 30, 2025

Copy link
Copy Markdown

@zanllp I've opened a new pull request, #855, to work on those changes. Once the pull request is ready, I'll request review from you.

@zanllp zanllp merged commit 41ae0fb into main Nov 30, 2025
@zanllp zanllp deleted the optimize-random-images branch January 10, 2026 16:56
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