Files
automatic/modules
CalamitousFelicitousness 443a73b740 refactor(caption): code review fixes for offload, inference, and maintainability
Comprehensive review of modules/caption/ addressing memory management,
consistency, and code quality:

Inference correctness:
- Add devices.inference_context() to _qwen(), _smol(), _sa2() handlers
- Remove redundant @torch.no_grad() decorator from joycaption predict()
- Remove dead dtype=torch.bfloat16 kwarg from Florence loader

Memory management:
- Bound moondream3 image cache with LRU eviction (max 8 entries)
- Replace fragile id(image) cache keys with content-based md5 hash
- Add devices.torch_gc() after model loading in deepseek
- Move deepbooru model to CPU before dropping reference on unload
- Add external handler delegation to VQA.unload() (moondream3,
  joycaption, joytag, deepseek)
- Protect batch offload mutation with try/finally

Code deduplication:
- Extract strip_think_xml_tags() shared helper for Qwen/Gemma/SmolVLM
- Extract save_tags_to_file() into tagger.py from deepbooru and
  waifudiffusion

Documentation and clarity:
- Document deepseek global monkey-patches (LlamaFlashAttention2, attrdict)
- Document Florence task="task" as intentional design choice
- Add vendored-code comment to joytag.py
- Document openclip direct .to() usage vs sd_models.move_model
- Comment model.eval() calls that are required (trust_remote_code,
  custom loaders) vs removed where redundant (standard from_pretrained)

API robustness:
- Add HTTP 422 error response for VQA caption error strings in API
  endpoints (post_vqa, _dispatch_vlm)
2026-02-11 02:48:11 +00:00
..
2026-01-20 09:53:20 +01:00
2025-07-05 17:13:31 -04:00
2025-12-30 18:36:02 +01:00
2026-01-19 11:10:05 +01:00
2025-07-08 15:47:07 -04:00
2026-01-19 11:10:05 +01:00
2026-01-19 11:10:05 +01:00
2026-01-30 11:34:25 +01:00
2025-11-27 14:47:56 -08:00
2026-01-20 09:53:20 +01:00
2026-01-10 20:48:36 +03:00
2025-11-09 15:41:20 -05:00
2026-02-07 10:17:32 +00:00
2025-07-28 19:41:39 -04:00
2026-01-20 09:53:20 +01:00
2026-01-21 18:16:47 -08:00
2026-02-05 16:55:06 +01:00
2026-01-19 11:10:05 +01:00
2026-02-04 13:08:31 +01:00
2026-02-04 13:08:31 +01:00
2025-10-16 19:39:05 -04:00
2026-01-19 11:10:05 +01:00
2025-07-05 17:13:31 -04:00
2025-01-10 08:25:00 -05:00
2026-01-30 11:34:25 +01:00
2026-01-20 18:56:49 +01:00
2024-12-20 18:58:29 -05:00
2026-01-16 10:36:02 +01:00
2026-01-24 02:16:05 -08:00
2026-01-24 13:57:13 +01:00
2024-12-11 12:32:34 -05:00
2025-11-07 12:21:48 -05:00
2026-01-24 13:54:40 +01:00
2026-01-19 11:10:05 +01:00
2025-11-12 19:24:47 -05:00
2026-02-09 18:30:18 +01:00
2025-10-30 14:01:32 -04:00
2026-01-21 18:15:20 -08:00
2026-01-24 13:54:40 +01:00
2026-01-31 12:37:17 +00:00
2026-01-19 11:10:05 +01:00
2025-04-21 20:20:04 -04:00
2025-11-17 20:12:47 -05:00
2026-01-24 13:54:40 +01:00
2025-08-13 16:06:25 -04:00
2025-10-17 13:42:28 -04:00
2025-10-24 10:29:58 -04:00
2025-10-24 10:29:58 -04:00
2026-01-30 11:34:25 +01:00
2026-01-16 08:56:30 +01:00
2026-01-30 11:34:25 +01:00
2026-01-30 11:34:25 +01:00
2026-02-09 22:31:00 +01:00
2026-01-19 10:51:28 +01:00
2026-01-24 10:28:46 +01:00
2025-08-02 15:28:45 -04:00
2026-02-02 12:28:43 +09:00
2025-10-16 19:39:05 -04:00
2025-01-08 09:35:49 -05:00
2025-11-04 08:23:45 -05:00
2025-07-31 17:33:44 -04:00
2026-01-24 13:54:40 +01:00
2026-02-05 16:55:06 +01:00
2025-08-01 18:26:57 -04:00
2025-07-27 08:17:41 -04:00
2025-07-27 08:17:41 -04:00
2025-09-12 16:12:45 -04:00
2026-01-16 17:31:56 +00:00
2025-07-05 17:42:13 -04:00
2025-10-12 15:35:08 -04:00
2026-02-04 15:05:22 +01:00
2025-03-30 15:04:17 -04:00
2026-01-21 08:45:45 +01:00
2026-02-04 13:08:31 +01:00
2025-08-15 10:56:36 -04:00
2026-01-24 02:16:05 -08:00
2026-01-24 13:54:40 +01:00
2025-11-02 06:29:19 -05:00
2026-01-24 13:54:40 +01:00
2025-12-26 09:25:25 -08:00
2026-01-16 09:40:48 +01:00
2025-05-13 21:51:33 -04:00
2025-11-12 09:19:28 -05:00
2026-01-10 13:27:38 -08:00
2025-10-22 08:39:45 -04:00
2025-11-14 15:47:13 -05:00
2025-11-08 14:54:34 -08:00
2026-01-24 13:54:40 +01:00
2025-10-05 20:17:32 -04:00
2026-01-07 15:01:39 +09:00