Commit Graph

346 Commits

Author SHA1 Message Date
QualiaRain fd5b2b7feb lint: fix RUF013 implicit Optional in cli/process.py Result.__init__
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 13:00:24 -04:00
QualiaRain 584f2b84c4 fix cli+api: data-uri decode guards, mutable default, caption/ffprobe/palette IndexError guards
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 13:00:23 -04:00
Vladimir Mandic 9c6d6907ea fix hfinfo
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-05 07:24:34 +02:00
Vladimir Mandic 5e99dee3c2 full codespell coverage
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-04 12:36:10 +02:00
Vladimir Mandic c8d6fd5cf8 Revert "much stricter ruff linting"
This reverts commit 310dbf1574.
2026-05-11 08:13:57 +02:00
Vladimir Mandic 310dbf1574 much stricter ruff linting
Co-authored-by: Copilot <copilot@github.com>
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-05-11 07:15:37 +02:00
CalamitousFelicitousness e2c856459c feat(autocomplete): aliases, extra-networks, translations, baseline fixes
- tag aliases (optional 4-tuple) and translations (companion file)
- lora and wildcard triggers; embeddings fold into tag-mode results
- new GET /sdapi/v1/wildcards endpoint
- LRU cap, IME safety, multi-textarea safety, modifier-key pass-through
- manifest-retry and config-bridge hardening
- tags-fetch: alias/translation harvesters with authenticated rate limits
2026-04-24 21:55:27 +01:00
Vladimir Mandic b3f09aa417 Merge pull request #4707 from vladmandic/feat/tag-dictionaries
Feat/tag dictionaries
2026-04-13 11:57:48 +02:00
vladmandic f06eb21d52 add hf-info
Signed-off-by: vladmandic <mandic00@live.com>
2026-04-12 19:06:09 +02:00
Vladimir Mandic aa34db2c50 Merge branch 'dev' into feat/tag-dictionaries 2026-04-08 10:03:42 +02:00
awsr c003b0eb48 PIL Image.Image type fix 2026-04-06 01:06:19 -07:00
vladmandic e0f6766b8a update permissions
Signed-off-by: vladmandic <mandic00@live.com>
2026-03-27 19:17:37 +01:00
CalamitousFelicitousness 6a7a879c77 fix(autocomplete): address PR review feedback
- Remove remote manifest fetch from startup dropdown population;
  list only locally available tag files via files_cache.list_files()
- Rename CLI utilities to tags-fetch, tags-prune, tags-manifest
- Replace create/destroy mirror div with persistent offscreen mirror
  for caret position measurement
- Add ResizeObserver to reposition dropdown on textarea resize
- Add autocomplete-mirror classname to measurement div
2026-03-26 19:46:23 +00:00
CalamitousFelicitousness d4d5bce3b9 feat(autocomplete): add native tag autocomplete for prompt textareas 2026-03-26 00:47:14 +00:00
CalamitousFelicitousness 5312265d27 refactor(autocomplete): rename dicts to autocomplete, relocate to models/ 2026-03-26 00:47:14 +00:00
CalamitousFelicitousness a0a6a250e0 chore(dicts): minify all JSON files for consistency 2026-03-26 00:47:14 +00:00
CalamitousFelicitousness 838b972d11 chore(dicts): rename checkpoint to partial in fetch_dicts 2026-03-26 00:47:14 +00:00
CalamitousFelicitousness 36b2ed6bb7 feat(dicts): add curated dicts, pruning, and manifest generation
Add 4 curated vocabulary dicts (art, photography, quality, negative)
that ship bundled for out-of-the-box autocomplete. Add manifest.json
listing all dicts available on HuggingFace.

CLI tools:
- cli/prune_dicts.py: per-category pruning with configurable thresholds
- cli/gen_manifest.py: generate manifest from on-disk dict files
- cli/fetch_dicts.py: unified 14-category scheme, idol source, auto
  manifest regeneration after fetch

Fetch and prune auto-update manifest.json when one already exists.
2026-03-26 00:47:13 +00:00
CalamitousFelicitousness 0405689606 feat(dicts): add tag sources with separator support 2026-03-26 00:47:13 +00:00
CalamitousFelicitousness 9343768d78 feat(api): add tag dictionary API and settings for prompt autocomplete 2026-03-26 00:47:13 +00:00
awsr 8e10ec3fec RUF013 compatibility 2026-03-20 18:42:44 -07:00
CalamitousFelicitousness 9cf2ab08a0 feat(civitai): add url parsing to cli search tool
Extract model ID from civitai.com URLs pasted as the query argument,
matching the same behavior added to the main search module.
2026-03-20 04:33:51 +00:00
vladmandic 64e193b60b merge: cli/hf-search.py 2026-03-12 14:11:47 +01:00
awsr feffbe0851 Update subprocess.run usage 2026-03-05 20:06:09 -08:00
Vladimir Mandic 6fdd3a53cf reduce mandatory requirements
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-02-18 17:53:08 +01:00
Vladimir Mandic 41f206dec9 Merge pull request #4637 from CalamitousFelicitousness/refactor/remove-face-restoration
Refactor/remove face restoration
2026-02-11 11:12:34 +01:00
vladmandic b4e5b563c6 update lint rules
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-11 10:47:07 +01:00
CalamitousFelicitousness 80014fac7c fix(caption): address PR review feedback
- Remove superfluous SimpleNamespace import in cli/api-caption.py, use Map instead
- Drop _ prefix from internal helper functions in modules/api/caption.py
- Move DeepDanbooru model path to top-level models folder instead of nesting under CLIP
2026-02-11 02:50:06 +00:00
CalamitousFelicitousness 139e331d80 style(caption): fix lint warnings across caption module
- Rename shadowing import in waifudiffusion batch to avoid F823/E0606
- Fix import order in cli/api-caption.py (stdlib before third-party)
- Rename local variable shadowing function name in cli/api-caption.py
- Remove unnecessary global statement in devices.bypass_sdpa_hijacks
2026-02-11 02:50:06 +00:00
CalamitousFelicitousness e2cdbe47fa fix(caption): safetensors-only downloads, model load fixes, UI default, prefill tests
- Add use_safetensors=True to all 16 model from_pretrained calls to
  avoid downloading redundant .bin files alongside safetensors
- Add device property to JoyTag VisionModel so move_model can relocate
  it to CUDA (fixes 'ViT object has no attribute device')
- Fix Pix2Struct dtype mismatch by casting float inputs to model dtype
  while preserving integer tensor types
- Patch AutoConfig.register with exist_ok=True during Ovis loading to
  handle duplicate aimv2 registration on model reload
- Detect Qwen VL fine-tune architecture from config model_type instead
  of repo name, fixing ToriiGate and similar third-party fine-tunes
- Change UI default task from Short Caption to Normal Caption, and
  preserve it on model switch instead of resetting to Use Prompt
- Add dual-prefill testing across 5 VQA test methods using a shared
  _check_prefill helper
- Fix pre-existing ruff W605 in strip_think_xml_tags docstring
2026-02-11 02:48:11 +00:00
CalamitousFelicitousness bf7a72f12e fix(caption): remove dead min_length param, split Florence/PromptGen prompts, fix gaze detection
- Remove caption_openclip_min_length from settings, API models, endpoints, and UI
  (clip_interrogator library has no min_length support; parameter was never functional)
- Split vlm_prompts_florence into base Florence prompts and PromptGen-only prompts
  (GENERATE_TAGS, Analyze, Mixed Caption require MiaoshouAI PromptGen fine-tune)
- Add 'promptgen' category to /vqa/prompts API endpoint
- Fix gaze detection: move DETECT_GAZE check before generic 'detect ' prefix
  to prevent "Detect Gaze" matching as detect target="Gaze"
- Update test suite: remove min_length tests, fix min_flavors to use mode='best',
  add acceptance-only notes, fix thinking trace detection, improve bracket/OCR tests,
  split Florence/PromptGen test coverage
2026-02-11 02:48:11 +00:00
CalamitousFelicitousness 588222f2d1 test: update caption API tests
Update cli/test-caption-api.py:
- Update test structure for new caption API endpoints
- Fix Moondream gaze detection test prompt to use 'Detect Gaze'
  instead of 'Where is the person looking?' to match handler trigger
- Improve test result categorization and tracking
2026-02-11 02:48:11 +00:00
CalamitousFelicitousness d78c5c1cd0 refactor: update CLI tools for caption module
- Rename cli/api-interrogate.py to cli/api-caption.py
- Update cli/options.py, cli/process.py for new module paths
- Update cli/test-tagger.py for caption module imports
2026-02-11 02:48:11 +00:00
CalamitousFelicitousness 83fa8e39ba refactor(api): update cli tools for DeepBooru tagger migration
- Update cli/api-interrogate.py to use /sdapi/v1/tagger for DeepBooru
- Handle tagger response format (scores dict or tags string)
- Remove DeepBooru test from interrogate endpoint tests
- Update API model descriptions to reference tagger for anime tagging
2026-02-11 02:47:41 +00:00
CalamitousFelicitousness 3208067259 test(api): improve caption API test coverage and validation
Add model architecture coverage tests:
- VQA model family detection for 19 architectures
- Florence special prompts test (<OD>, <OCR>, <CAPTION>, etc.)
- Moondream detection features test
- VQA architecture capabilities test
- Tagger model types and WD version comparison tests

Improve test validation:
- Add is_meaningful_answer() to reject responses like "."
- Verify parameters have actual effect (not just accepted)
- Show actual output traces in PASS/FAIL messages
- Fix prefill tests to verify keep_prefill behavior

Add configurable timeout:
- Default timeout increased to 300s for slow models
- Add --timeout CLI argument for customization

Other improvements:
- Add JoyCaption to recognized model families
- Reduce BLIP models to avoid reloading large models
- Better detection result validation for annotated images
2026-02-11 02:47:40 +00:00
CalamitousFelicitousness f3c4fae440 test(api): add caption API test suite
Comprehensive test script for all Caption API endpoints:
- GET/POST /sdapi/v1/interrogate (OpenCLiP/DeepBooru)
- POST /sdapi/v1/vqa (VLM captioning)
- GET /sdapi/v1/vqa/models, /sdapi/v1/vqa/prompts
- POST /sdapi/v1/tagger
- GET /sdapi/v1/tagger/models

Usage: python cli/test-caption-api.py [--url URL] [--image PATH]
2026-02-11 02:47:40 +00:00
CalamitousFelicitousness 385532154f Merge remote-tracking branch 'origin/dev' into refactor/remove-face-restoration
# Conflicts:
#	.pylintrc
#	.ruff.toml
2026-02-10 14:38:14 +00:00
vladmandic 7eb9b1cc5c create tests folder
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-10 14:31:53 +01:00
vladmandic bd61633e14 switch to pyproject.toml for tool config
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-10 13:51:51 +01:00
vladmandic 0d2e9fbf62 cleanup and update changelog
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-09 18:20:10 +01:00
CalamitousFelicitousness 3d0edb4f8f refactor: remove face restoration from CLI tools and XYZ grid
- Remove gfpgan/codeformer face template lines from cli/generate.py
- Remove gfpgan_visibility, codeformer_visibility, codeformer_weight
  from cli/generate.json upscale config
- Simplify cli/process.py upscale_restore_image() to remove the
  restore path and codeformer parameters
- Remove codeformer/gfpgan special cases from xyz_grid_shared.py
  apply_detailer(), keep generic boolean parsing
- Remove p.restore_faces assignment from xyz_grid_on.py
2026-02-08 23:00:05 +00:00
Vladimir Mandic bf1e763156 add attention benchmark
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-02-07 13:37:09 +00:00
Oliver Hertel 9ebd05dc7b test file for weighted lists 2026-02-07 09:57:19 +01:00
vladmandic 605d87cb2d reorg cli
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-05 10:33:42 +01:00
vladmandic 2d6cc5addb metadata restore to always-on scrips
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-05 10:21:49 +01:00
vladmandic 2ec79a1807 update changelog and todo
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-04 14:10:17 +01:00
vladmandic d9a2a21c8c add sampler api endpoints
Signed-off-by: vladmandic <mandic00@live.com>
2026-02-04 13:08:31 +01:00
Vladimir Mandic 20aeb8b793 /sdapi/v1/xyz-grid
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-01-31 11:04:50 +00:00
CalamitousFelicitousness 26c679f9e7 refactor(caption): remove unused _device tracking property 2026-01-21 11:56:07 +00:00
CalamitousFelicitousness 6b10f0df4f refactor(caption): address PR review feedback
Rename WD14 module and settings to WaifuDiffusion:
- Rename wd14.py to waifudiffusion.py
- Rename WD14Tagger class to WaifuDiffusionTagger
- Rename WD14_MODELS constant to WAIFUDIFFUSION_MODELS
- Rename settings: wd14_model -> waifudiffusion_model,
  wd14_character_threshold -> waifudiffusion_character_threshold
- Update all log messages from "WD14" to "WaifuDiffusion"

Code quality improvements:
- Simplify threshold parameter defaulting using `or` operator
- Extract save_output logic into _save_tags_to_file() helper with
  isolated error handling to prevent single file failures from
  impacting entire batch
- Fix timing log format consistency (remove 's' suffix)
2026-01-21 11:56:07 +00:00