104 Commits

Author SHA1 Message Date
Vladimir Mandic 79a843474d Merge branch 'dev' into feat/attention-core 2026-08-26 15:59:28 +02:00
Vladimir Mandic d0cceefd0f Merge pull request #5064 from vladmandic/dev
refresh branch
2026-08-26 15:48:41 +02:00
Vladimir Mandic acb4e758d3 add heif/heic support
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-26 10:24:17 +02:00
Vladimir Mandic 1946892b7f improve memory reporting, explicit interpolation and minimax tracking
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-25 09:11:46 +02:00
CalamitousFelicitousness 4ae6515163 feat(lora): quantized apply method setting
New lora_sdnq_apply radio (exact, requantize) in the lora settings.
requantize keeps the previous behavior: every quantized layer takes the
dequantize-add-requantize path, with factor attach and svd hosting gated
off. A settings-only flip re-applies loaded networks: the mechanism
rides a per-module apply stamp and the network-changed signature, and
the activate fallthrough strips factors a closed gate leaves attached.
Requantize chosen by the setting logs as info instead of the
reduced-fidelity warning.

- locale hint covers fidelity and memory tradeoffs of both methods
- suite: gate, legacy routing and flip-transition tests
2026-08-25 00:25:22 +01:00
CalamitousFelicitousness 8c377aeeee refactor(settings): dedicated lora settings tab
The lora block moves out of Networks into its own settings tab, with
header groups by what each option acts on: loading, prompt, application,
quantized models and metadata. Locale hints follow to the new section.
2026-08-25 00:25:22 +01:00
CalamitousFelicitousness 82a7e94450 feat(lora): activation-weighted hosting via per-checkpoint calibration
Plain svd truncation of hosted deltas is optimal in weight space but not
in output space: activations concentrate energy in a few input channels,
so scaling the delta by per-channel input RMS before the svd spends the
rank budget on output error instead. Statistics stream from the model's
own forwards on sub-8-bit SDNQ checkpoints and cache per checkpoint;
measured on real LoKR files this raises output-delta retention by ~0.05
at rank 256 and ~0.09 at rank 64, most on MLP down projections.

- modules/lora/lora_calib.py: capture hooks, per-checkpoint cache under
  data/sdnq-calib, statistics land on layers as sdnq_calib_rms; gated by
  lora_sdnq_host_calib, skipped when the model is compiled
- lora_sdnq.apply_hosted: weighted truncation when statistics exist,
  calib count in the load summary
- cli/sdnq-calibrate.py: complete calibration now against a live server
- cli/lora-quant-fidelity.py --calib: hosted rho scored in the
  activation-weighted norm
- test/test-sdnq-lora-factors.py: calibration category, 5 tests
2026-08-25 00:25:22 +01:00
CalamitousFelicitousness 6c0dd0b15f feat(lora): host non-factorable adapters on the sdnq side-channel
Non-additive families (lokr, loha, oft, dora, full) merged into the
quantized weight and lost most of their delta on low-bit formats. On
sub-8-bit layers the set's calc_updown delta now rides the svd
side-channel as its top singular directions instead: factorable members
are subtracted out and appended exactly, so only the non-factorable
remainder is truncated. Truncation keeps the dominant part of the
effect and drops an orthogonal residual, where requantize keeps the
grid extrema and adds grid-shift noise of the delta's own magnitude;
on real lokr files retention rises from 0.04 to about 0.5 at the
default rank.

Hosted layers take no weight backup and unload bit-exactly. The svd
runs under a forked rng so generation seeds are unaffected. At 8 bits
and above requantize retains most of the delta and remains the path.
lora_sdnq_host_rank caps the hosted rank; 0 disables hosting.
2026-08-25 00:25:22 +01:00
CalamitousFelicitousness 10771bd123 Merge branch 'dev' into feat/attention-core
dev added sdnq_attention_quantize_fp32 to modules/attention.py, which this
branch replaced with the modules/attention package. The option moves to the
sdnq backend in two places: the options dict the prepared call captures, and
the options tuple that rebuilds the chain when a captured option changes.
Reading it in only the first place would leave a setting that takes effect on
the next model load and not before.

The new option gets a hint alongside the rest of the section.
2026-08-24 22:54:59 +01:00
Dity0 f6777b168d SDNQ Atten: add quantize_fp32 2026-08-24 19:34:54 +03:00
CalamitousFelicitousness e0c3e00af2 chore(settings): remove dead attention options
xformers_options had no reader, and Sub-quadratic has not been an
attention choice for a long time, so the hypertile branches keyed on it
never ran. Configs that still store xformers_options load without the
unknown-setting warning.
2026-08-23 08:21:28 +01:00
Dity0 43b739066d Add tensor-wise quantization support with group_size=-2 2026-08-21 00:04:33 +03:00
Dity0 0218a0aadc Add FP16 Accumulation option to SDNQ Atten 2026-08-18 20:44:05 +03:00
Vladimir Mandic f75e38c4ef krea2 optional dense masking
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-17 10:18:32 +02:00
Vladimir Mandic 392c969754 add offload state_dict
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-17 08:52:46 +02:00
Vladimir Mandic 8be5be487f Merge pull request #5028 from cjmcgee/fix/rocm-disable-mmap
fix(rocm): add option to load models without mmap
2026-08-16 18:19:38 +02:00
Christopher McGee a9b9de63ab fix(rocm): add option to load models without mmap
On ROCm, host-to-device DMA from mmap'd safetensors pages stalls ~1s per
copy, so weights move to the GPU at ~27 MB/s instead of ~28 GB/s. With
offload enabled this re-copies weights every forward, so generation
appears to hang.

Adds `diffusers_disable_mmap` (Settings > Model Loading), off by default,
which makes diffusers read shards into anonymous memory instead. Costs
peak RAM equal to the model size, so it is opt-in.

SD3.5-large on RX 9070 (gfx1201), same prompt and steps:
  off: no image after 120s
  on:  image in 20s

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 11:46:07 -04:00
Dity0 51a598bfc3 Enable smooth_k by default 2026-08-16 12:42:13 +03:00
CalamitousFelicitousness 09eeff30c7 refactor(settings): reorganize the offload settings by mode
The offload section interleaved shared and mode-specific options. The
page now reads top down: general options, an Offload Overrides section
holding the exclusions shared by balanced and group offload, then one
tuning section per mode. Use torch streams becomes Prefetch with streams
and Record torch streams becomes Overlap stream transfers, the section
headers carry hints, and the hints reflect live behavior, including
dropping the model-reload badge from options that apply on change.
2026-08-14 23:59:55 +01:00
Vladimir Mandic 0ac89385a0 timers reporting
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-14 09:18:24 +02:00
CalamitousFelicitousness 46c30a00f2 feat(offload): per-component group offload engine
Group offload is applied per component through one engine shared by
regular and modular pipelines. Each component carries a config
signature: re-application with unchanged settings is a no-op instead
of raising before the first forward or silently keeping a stale
config, and changed settings remove the hooks and reapply. Switching
offload modes cleans up the previous mode's hooks in both directions.

- text encoders always offload at leaf level without streams, so
  their weights are never held in pinned host memory
- the vae never takes group hooks and stays resident: the hooks are
  forward-scoped, while pipelines enter through encode/decode and
  tiled calls re-enter per tile
- new pin offload memory option: disabled pins one group at a time
  instead of holding the whole module in non-pageable memory, and
  modules larger than half of system memory degrade automatically
- record stream is clamped to stream mode; the standalone
  combination is rejected upstream
2026-08-10 22:10:42 +01:00
Dity0 251945939b Add Lloyd-Max quantization with use_codebook 2026-08-10 22:51:32 +03:00
Vladimir Mandic 6aa5b45b80 remove directml
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-10 13:43:45 +02:00
Dity0 2250d8052a remove sdnq_dequantize_compile option
- advanced users should use the env var SDNQ_USE_TORCH_COMPILE instead
2026-08-10 13:30:56 +03:00
Vladimir Mandic c6dc750a81 remove resolution from some reference models
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-28 14:18:55 +02:00
Vladimir Mandic 42cb4cf489 explicit seedvr implementation
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-18 10:35:07 +02:00
Disty0 75926e6fc4 Remove sdnq_use_quantized_matmul and use sdnq_quantize_matmul_mode instead 2026-07-15 18:45:30 +03:00
CalamitousFelicitousness 6e63f351eb refactor(ui): drop quicksettings companion machinery for secondary unet
The secondary unet loads from the networks panel toggle or the settings
page; companion ordering and dynamic visibility pushes in ui_settings.py
are not worth their footprint for one setting.
2026-07-12 03:44:20 +01:00
CalamitousFelicitousness 8c884c1e02 feat(model): secondary unet override slot and ideogram4 native loading
One UNET override cannot serve dual-transformer arches: ideogram4
conditional/unconditional and wan combined-stage experts need separate
files, and previously a single override landed on both experts.

- sd_unet_secondary option with per-slot tracking, consumed-state sync,
  arch-change reset, and incompatible-override fallback
- dropdown renders beside the primary, follows it into quicksettings,
  and is visible only for dual-transformer model types
- ideogram4 native single-file spec with a quant-aware fused-qkv
  converter; such converters run before comfy_quant detection via
  TransformerSpec.converter_handles_quant
- quicksettings render in configured order (sort keyed on the option
  object and always fell back to alphabetical)
- post-load dtype warning skips quantized transformers
2026-07-11 06:40:07 +01:00
Vladimir Mandic 2c632bb562 refactor detailer
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-04 11:17:56 +02:00
Vladimir Mandic a4d107a919 refactor detailer
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-03 21:03:28 +02:00
Vladimir Mandic fcee7e23f2 add experimental pruna
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-02 11:25:33 +02:00
Vladimir Mandic b3cf481c11 Merge pull request #4970 from vladmandic/feat/video-models
Feat/video models
2026-07-01 11:11:57 +02:00
CalamitousFelicitousness 10647c7b67 fix(video): apply Wan 2.2 MoE boundary at runtime in both image and video paths
Wan 2.2 A14B ships a per-model boundary_ratio (0.9 I2V, 0.875 T2V) that selects the high- or low-noise expert per step. The video and base-model image loaders both load the shipped value; the slider override is applied at generation time in set_pipeline_args, the one point both paths pass through before invoking the pipeline.

The denoising loop reads config.boundary_ratio each call, so tuning takes effect with no reload for video and base-model images alike. The slider defaults to -1, meaning use the model's value; 0 to 1 set the boundary explicitly. Single-expert stages stay load-time because they drop a transformer to free VRAM.
2026-06-30 23:00:26 +01:00
Vladimir Mandic 0e35079f06 attempt to load incomplete model
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-29 13:39:46 +02:00
Vladimir Mandic b61475574e preview check for output panel visibility
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-25 10:54:35 +02:00
Disty0 8029156fa2 SDNQ Atten use simple row-wise quant instead 2026-06-24 17:59:38 +03:00
Disty0 2c44dca2be reduce warp range 2026-06-24 13:23:00 +03:00
Disty0 0af57a0af1 And no quant atten 2026-06-23 20:41:19 +03:00
Disty0 b682d90a4a Fix UI settings 2026-06-23 14:26:24 +03:00
Disty0 72a4d2c2bd Add Hadamard support to SDNQ Atten 2026-06-23 14:17:34 +03:00
Disty0 dfa713e6fc Add SDNQ attention 2026-06-23 08:10:02 +03:00
Vladimir Mandic 6e6ed82732 fix conflciting label
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-22 16:27:31 +02:00
Vladimir Mandic 893c1e702d main panel positioning
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-21 12:52:32 +02:00
Vladimir Mandic 7e51186e60 better handle onnxruntime
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-21 11:19:08 +02:00
Vladimir Mandic 2b81eadecf add force dtype on load
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-20 09:38:50 +02:00
Pablo Hellmann 642a2be76f Add user option to enable/disable not-in-focus live previews 2026-06-17 16:08:37 +02:00
Pablo Hellmann 396b15e567 Revert "Adds per step based live preview as a option"
This reverts commit ecad61ce92.
2026-06-17 16:00:05 +02:00
Pablo Hellmann fbc1f66805 Revert "Ruff fixes"
This reverts commit 10145f7f2b.
2026-06-17 16:00:03 +02:00
Pablo Hellmann 10145f7f2b Ruff fixes 2026-06-16 20:23:06 +02:00