Commit Graph

11718 Commits

Author SHA1 Message Date
vladmandic fedb1fac4e Merge branch 'dev' of https://github.com/vladmandic/sdnext into dev 2025-12-08 18:00:10 +01:00
vladmandic 9f9e60f159 update changelog
Signed-off-by: vladmandic <mandic00@live.com>
2025-12-08 18:00:07 +01:00
Vladimir Mandic 5a1d60e1b9 Merge pull request #4448 from CalamitousFelicitousness/feat/vqa-prefill-thinking-moondream3
VQA Refactor
2025-12-08 17:43:48 +01:00
vladmandic 83920e9b31 update dependencies
Signed-off-by: vladmandic <mandic00@live.com>
2025-12-08 16:41:23 +01:00
Vladimir Mandic fab25f77e3 Merge pull request #4455 from liutyi/dev
FLUX.2 Dev Cover(s) and size
2025-12-08 16:34:56 +01:00
Disty0 d4e2cbb826 SDNQ fix torch.compile always being active 2025-12-08 18:15:08 +03:00
Disty0 3ae7ecdbad SDNQ fix quantization_device getting ignored on post load quant 2025-12-08 01:29:52 +03:00
Disty0 064b64c76c cleanup 2025-12-08 01:14:19 +03:00
Disty0 6e05a12a49 SDNQ post process pre-quants after load 2025-12-08 01:08:53 +03:00
Disty0 0835ca6f66 SDNQ add explicit model.quantization_method = QuantizationMethod.SDNQ 2025-12-08 00:46:40 +03:00
Disty0 7a6356f8eb SDNQ fix transformers v5 and check for torch._dynamo.config.disable 2025-12-08 00:36:15 +03:00
Disty0 4f90054bf7 SDNQ transformers v5 support 2025-12-07 21:37:41 +03:00
Oleksandr Liutyi a06aecada3 FLUX.2 Dev Cover(s) and size 2025-12-07 14:25:13 +00:00
Vladimir Mandic 469962cc9c Merge pull request #4453 from awsr/python-datetime-compat
Fix timestamp formatting for thumbnails
2025-12-07 06:49:38 +01:00
awsr f01e977695 Fix timestamp formatting for thumbnails 2025-12-06 18:34:15 -08:00
vladmandic 7bd04e0b5c add /detailers api endpoint
Signed-off-by: vladmandic <mandic00@live.com>
2025-12-06 12:33:52 +01:00
CalamitousFelicitousness a51e1501d6 fix(vqa): no moondream3 compile during explicit load
- Initialize KV caches before moving model to device
- Disable flex_attention decoding to avoid torch.compile hang
- Remove unused compile step (controlled by cuda_compile setting)

The flex_attention's create_block_mask triggers torch compilation
which can hang the system when called during model preload.
2025-12-06 02:26:34 +00:00
CalamitousFelicitousness 7714f71994 feat(vqa): un/load support and extract detection
Make external VQA handlers (moondream3, joytag, joycaption, deepseek)
compatible with VQA load/unload mechanism for consistent model lifecycle.

- Added vqa_detection.py, add shared detection helpers
- Add load and unload functions to all external handlers
- Replace device_map="auto" with sd_models.move_model in joycaption
- Update dispatcher and moondream handlers to use shared helpers
2025-12-05 23:52:02 +00:00
CalamitousFelicitousness 5193285bc7 refactor(vqa): convert to class-based singleton
Refactor VQA module from module-level globals to a VQA class singleton
  pattern with self-contained per-model loading methods.

Changes:
- Add VQA class with model/processor state and detection data storage
- Extract load methods for clean model pre-loading via UI
- Interrogate to return string only; store detection data on instance
- Add vqa_draw.py for bounding box/point annotation utilities
    Stub, further transfer of drawing functions to follow
- Update moondream3.py to store detection data on VQA singleton
- Update endpoints.py and ui_caption.py for new return type
2025-12-05 20:53:18 +00:00
Disty0 1cfb61809f cleanup 2025-12-05 18:40:49 +03:00
Disty0 5b86bef796 SDNQ add longcat keys 2025-12-05 18:37:20 +03:00
CalamitousFelicitousness d1b1d574a6 fix(vqa): add graceful error for empty "Use Prompt" task
Replace silent fallback to "Describe the image" with explicit error
when user selects "Use Prompt" but leaves the prompt field empty.
Follows the same pattern as missing image validation.
2025-12-05 01:48:07 +00:00
CalamitousFelicitousness a8a9e6d836 fix(vqa): separate Moondream 2 and 3 task prompts
Moondream 3 does not support gaze detection (detect_gaze method),
so "Detect Gaze" task is now only shown for Moondream 2.
2025-12-05 01:38:28 +00:00
CalamitousFelicitousness 195161c436 fix(settings): hide VLM prefill/thinking settings from Settings UI
These settings are accessible from the Caption tab and can be saved
as defaults via "Set UI defaults", so they don't need to appear in
Settings > Interrogate.
2025-12-05 00:54:24 +00:00
CalamitousFelicitousness 2b6226b62b feat(vqa): persist thinking mode and improve reasoning output formatting
- Add interrogate_vlm_thinking_mode setting to save checkbox state
- Update ui_caption to restore Thinking Mode preference on load
- Add blank line before 'Answer:' label for visual separation
- Remove '\n\n' replacement in clean() that stripped blank lines
- Fix Qwen reasoning detection when <think> tag is in prompt, not response
- Add reasoning icon to Moondream 2 and 3 model names
2025-12-05 00:00:25 +00:00
CalamitousFelicitousness a4b5e84a13 feat(vqa): enhance Moondream 2 with reasoning mode, gaze detection, and annotations
- Add thinking_mode/reasoning parameter to enable reasoning mode
- Add Detect Gaze task with placeholder hint
- Parse point/detect results to return annotation data for visualization
- Handle keep_thinking setting: format as "Reasoning:\n...\nAnswer:\n..." or discard
- Add comprehensive debug logging throughout handler
2025-12-05 00:00:25 +00:00
CalamitousFelicitousness c75a09be83 fix(vqa): handle Moondream point and detect tasks
Add handlers for "Point at..." and "Detect..." tasks in moondream()
that were falling through to answer_question() and failing.
2025-12-05 00:00:25 +00:00
CalamitousFelicitousness 506515b018 feat(vqa): add load/unload model buttons to Caption tab
- Add load_model() function to pre-load VLM into memory
- Add unload_model() function to free VLM from memory
- Add Load/Unload buttons to Caption tab UI
2025-12-05 00:00:25 +00:00
CalamitousFelicitousness a90d85ddfd feat(ui): add dynamic task selection based on VLM model
- Rename "Predefined question" to "Task"
- Task dropdown updates choices when model changes
- Prompt placeholder updates based on selected task
- Model-specific tasks: Florence-2 gets detection tasks, Moondream gets point/detect
2025-12-05 00:00:25 +00:00
CalamitousFelicitousness 4df6aa7944 fix(ui): set prefill text to empty by default 2025-12-05 00:00:25 +00:00
CalamitousFelicitousness 0d88fcd396 feat(ui): add prefill and thinking controls to Caption tab
Add minimal UI controls to expose new VQA functionality:
- Prefill Text input for guiding VLM responses
- Thinking Mode checkbox for reasoning models
- Keep Thinking Trace checkbox for output retention
- Keep Prefill checkbox for output retention
- Annotated Image output panel for detection visualization
- Updated button handlers to pass new parameters
2025-12-05 00:00:24 +00:00
CalamitousFelicitousness c2810dfee2 fix(api): update VQA API endpoint for tuple return format
Update interrogate API endpoint to handle the new (text, image)
tuple return format from VQA interrogate function.
2025-12-05 00:00:24 +00:00
CalamitousFelicitousness 27fa48cc99 feat(vqa): major VQA handler refactor with prefill, thinking, and visualization
Comprehensive overhaul of the VQA interrogation system including:
- Prefill text support for guiding VLM responses
- Thinking mode support with tag cleanup/retention
- Dynamic prompt/task selection based on model type
- Bounding box visualization for detection results
- Debug infrastructure (SD_VQA_DEBUG env var)
- New model support: MiMo-VL, Nidum Gemma, Allura Gemma
- Model-specific prompt lists (Florence, Moondream)
2025-12-05 00:00:24 +00:00
CalamitousFelicitousness 0a322c0faf feat(vqa): add Moondream 3 Preview handler
Add support for Moondream 3 Preview VLM with:
- Text query, caption, point, and detect capabilities
- Bounding box visualization for object detection
- Max pixels setting for resolution control
- Device offloading support
2025-12-05 00:00:24 +00:00
CalamitousFelicitousness c024c0c9c6 feat(settings): add VLM prefill and thinking retention options
Add new VLM configuration options:
- interrogate_vlm_keep_prefill: Keep prefill text in output
- interrogate_vlm_keep_thinking: Keep reasoning trace in output

Also adjust defaults:
- Change interrogate_clip_flavor_count: 16 -> 1024 with updated range
- Change interrogate_vlm_prompt default to first item ("Use Prompt")
2025-12-05 00:00:24 +00:00
Vladimir Mandic 26dd77cb4b Merge pull request #4447 from awsr/authfetch-fix
Allow for explicit null response
2025-12-05 00:43:28 +01:00
awsr 6ef6c4c891 Allow for explicit null response
Fixes constant spam to browser console from every fetch request
2025-12-04 15:35:23 -08:00
Vladimir Mandic c1098cb7ab Merge pull request #4445 from awsr/gallery-folder-modification-to-look-better-when-the-path-is-extremely-long
Gallery folder modification to look better when the path is extremely long
2025-12-04 22:26:50 +01:00
awsr e1c05b0e91 Improve standard theme compatibility 2025-12-04 04:56:59 -08:00
awsr a322186650 Improve rendering on non-modern UI 2025-12-04 04:18:31 -08:00
awsr 6cff06eafe Improve layout of gallery status info 2025-12-04 03:58:50 -08:00
awsr 489db27210 Fix GalleryFolder rendering for long paths 2025-12-04 03:56:56 -08:00
awsr 78e8bff46f Reposition setting lastSortName
Makes more sense to use the provided catch-all that's part of switch...case
2025-12-04 03:24:11 -08:00
vladmandic 66ead091ee update diffusers
Signed-off-by: vladmandic <mandic00@live.com>
2025-12-04 11:34:57 +01:00
awsr 28144d83e4 Better rendering of long path names 2025-12-03 21:16:38 -08:00
vladmandic 32b5f8ee2a Merge branch 'dev' of https://github.com/vladmandic/sdnext into dev 2025-12-03 19:19:40 +01:00
vladmandic 31aaf57021 update changelog & todo
Signed-off-by: vladmandic <mandic00@live.com>
2025-12-03 19:19:36 +01:00
Vladimir Mandic 16cdef5a6c Merge pull request #4441 from CalamitousFelicitousness/fix/vqa-minor-improvements
Fix/vqa minor improvements
2025-12-03 19:18:16 +01:00
Vladimir Mandic 6c8a8ef6df Merge pull request #4442 from awsr/gallery-maintenance3
Small gallery update
2025-12-03 19:15:26 +01:00
awsr 955759a4cd Set minimum display time for message 2025-12-02 19:26:30 -08:00