Commit Graph

354 Commits

Author SHA1 Message Date
CalamitousFelicitousness d2937166d3 fix(sdnq): sync benchmark prep mirror with kernel helpers
upstream replaced math.log2/triton.next_power_of_2 with sdnq utils in
the attention prep; mirror the same hadamard sizing in make_prep_fn.
2026-07-09 17:42:49 +01:00
CalamitousFelicitousness 75a245cbeb fix(sdnq): disable tf32 for the benchmark fp32 reference
sdnext enables tf32 globally; a math-backend dispatch fallback (gqa,
some mask shapes) degrades the fp32 reference to tf32 precision,
measured 4.2e-4 vs 5.0e-7 relative to fp64. the default mem-efficient
backend is unaffected.
2026-07-09 17:39:59 +01:00
CalamitousFelicitousness ad25416cf2 feat(sdnq): derive benchmark recommendations from measured webui state
Recommendations must hold on any gpu, so every verdict now comes from
measuring the configuration the advice points to.

- run benchmarks in the webui's configured dtype, --dtype overrides
- bench the prep mode matching the environment: compiled, verified
  dynamic=false workaround, or eager; label each with the webui change
  the numbers correspond to
- add a prep column for the q/k/v quantization cost outside the
  kernel; eager prep measured 1.9 ms vs 0.2 ms fused at sdxl,
  inverting the quantized matmul verdict
- compare Use Quantized MatMul against the unquantized sdnq row so
  quantization pays for its own prep
- star the lowest-error config within 5% of the fastest sdnq time;
  the same rule drives the worth-enabling verdict vs torch sdpa
- drop the (auto, default) suffix; document the settings mapping and
  star rule in the notes
- wrap correctness and shape tables in panels to separate sections
2026-07-09 17:39:59 +01:00
CalamitousFelicitousness 95234dd3c3 feat(sdnq): measure fp8 attention configs in the benchmark
The pv matmul recommendation trusted the float8 hardware probe alone,
so gpus where fp8 pv compiles but runs slower than unquantized pv got
a recommendation that degrades generation speed and error. Measured on
an rtx 2000 ada, fp8 pv lands at x0.93 of the sdpa baseline while int8
qk alone reaches x1.26.

- add fp8 pv and fp8 qk bench configs, gated on the eager float8
  probe so unsupported gpus keep clean tables
- include fp8 pv in the video presets since the pv stage matters most
  at long sequence lengths
- recommend a quantized pv type only when the fastest measured pv
  variant beats plain int8 qk by at least 5%, otherwise recommend auto
  and name the variants that measured no gain
- cite the measured fp8 qk ratio in the matmul type reason instead of
  the static compile claim
2026-07-09 17:39:59 +01:00
CalamitousFelicitousness af0b76f550 fix(sdnq): correct triton and fp8 detection in attention benchmark
The environment panel reported triton as missing and float8 as
unsupported on ada gpus. The triton lookup used the distribution name,
which varies by platform (triton-windows on windows), and the fp8 probe
ran through the torch.compile input prep, so a broken compile toolchain
read as a hardware limitation with the actual error discarded.

- read the module version for the triton line instead of the
  distribution name
- probe float8 with eager input prep so the result reflects gpu
  capability; show the failure reason when genuinely unsupported
- probe the compiled input prep separately and cold, before any eager
  kernel run: inductor lowers part of the dynamic-shape prep to a cpu
  helper kernel, so a missing host c++ compiler fails every sdnq
  attention call at generation, and a prior eager run in the same
  process masks the cold-start failure the webui hits
- on failure, verify the SDNQ_COMPILE_KWARGS dynamic:false workaround
  live and report it in the environment panel and recommendation notes
- benchmark with eager input prep when the compiled path is broken so
  kernel numbers still fill in
- replace the unicode star marker with ascii: rich's legacy windows
  renderer crashes with a cp1252 UnicodeEncodeError on piped output
2026-07-09 17:39:59 +01:00
CalamitousFelicitousness 169f033fb3 feat(sdnq): add attention benchmark cli tool
Benchmark and validate sdnq attention on the local gpu: correctness
checks for mask, causal, gqa and padding code paths, float8 support
probe, per-shape speed and error comparison against torch sdpa and
sageattention, and measured recommendations for the settings section.

Tables fill in live with per-config compile/warmup/timing progress,
current settings are compared against recommended values, and --save
writes a plain-text transcript of the results. --config-timeout turns
stuck compiles into failed rows; sd15 skips its hadamard configs since
compiling hadamard with a non pow2 head dim currently hangs inductor.

- shape presets follow real model geometries: sd15, sdxl, anima,
  flux2 klein, wan22 a14b, ltx 2.3, plus a masked joint-attention case
- runs the shipped kernel from modules/sdnq/kernels/triton_atten.py
  directly, with stock sdpa restored for baselines and references
2026-07-09 02:42:18 +01:00
Vladimir Mandic db26b77909 add boogu
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-04 15:26:36 +02:00
Vladimir Mandic 022d7ca481 update all reference models info
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-03 11:51:25 +02:00
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