Commit Graph

8964 Commits

Author SHA1 Message Date
CalamitousFelicitousness 387a349dfd fix(lora): scale the dora diff before the decompose norm
finalize_updown ran apply_weight_decompose on the unscaled delta and
multiplied the result by alpha/rank afterward. LyCORIS and ComfyUI both
bake alpha/rank into the diff before computing the row norms, so any
DoRA with alpha != rank renormalized against the wrong merged weight
(64% relative delta error for kohya-style alpha=1 rank=8; exact only
when alpha == rank, which full-matrix LoKR forces).

- scale updown by calc_scale() before apply_weight_decompose; apply
  only the multiplier afterward
- multiplier lerps the full merged delta (0 disables, 1 equals the
  trainer output); LyCORIS weight-mode ratio interpolation leaves the
  diff applied at multiplier 0 and is not used
- add a numeric regression test mirroring the LyCORIS forward reference
2026-07-14 08:06:45 +01:00
CalamitousFelicitousness ca729a01ca feat(lora): handle bias companion keys on fused-qkv targets
A diff_b bias delta on a fused BFL target passed through whole and
failed at apply with a shape mismatch. diff_b stores one value per
output feature, so it partitions with the fused rows exactly like the
up-weight; slice it with the chunk in the LoRA loader. The legacy
weight-shaped bias key (LyCORIS sparse-residual heritage) has no
defined partition on a fused target and no known emitter pairs it with
chunk-capable families, so the group is skipped with a warning in the
LoRA, LoKR and LoHA loaders.

- add slice_bias_delta beside slice_dora_scale; warn and skip
  non-per-output diff_b shapes
- cover sliced diff_b flowing out as ex_bias and the legacy-bias skip
  in the offline suite
2026-07-14 08:06:45 +01:00
CalamitousFelicitousness 1b3fd835c6 feat(lora): validate kron dims against the module at lokr load time
A LoKR group whose Kronecker product does not fit the resolved module
previously bound anyway and failed at apply time as a caught per-module
error, leaving the adapter partially applied with only an error log.
Reject the group at load with a warning instead, matching the LoRA
path's shapes_match gate.

- lokr_kron_shape derives (out, in_flat) from full, rank-decomposed or
  Tucker-rebuilt factors, folding conv kernel dims into in_flat
- lokr_shapes_match honors SDNQ original shapes and chunk partitions:
  equal chunks need total * out rows, row-range slices an exact range;
  the input dim is never chunked
- cover non-fused and fused rejection in the offline suite
2026-07-14 08:06:45 +01:00
CalamitousFelicitousness 4cac283561 feat(lora): slice per-output dora_scale on fused-qkv targets
LyCORIS wd=True saves a dora_scale companion for LoRA/LoHA/LoKR; on
fused BFL targets the chunk paths passed it through whole, so apply
failed with a shape mismatch and the module was dropped. Per-output
magnitudes (wd_on_out=True, the default) partition exactly with the
fused rows; per-input magnitudes couple the chunks through shared
column norms and have no exact split.

- slice per-output dora_scale rows with the chunk in the LoRA, LoKR
  and LoHA loaders
- skip per-input DoRA on fused targets with a specific warning
- cover sliced and skipped orientations in the offline suite
2026-07-14 08:06:45 +01:00
CalamitousFelicitousness 1587b9682d feat(lora): support the lycoris_ prefix in every native adapter arch
The lycoris_ save format is arch-independent: LyCORIS standalone wraps
the loaded diffusers model and emits the wrapped module path with dots
as underscores, so verbatim passthrough is correct for any arch. Only
flux2 handled it; zimage, chroma, ernie and krea2 reported such files
as not loaded.

- add lycoris_ to KNOWN_PREFIXES_DEFAULT and PASSTHROUGH_PREFIXES_DEFAULT
- drop flux2's per-arch prefix append and resolve_targets branch
- add lycoris_ to ANIMA_PREFIXES (anima replaces the default tuple);
  network_prefix_for already routes it to the transformer namespace
- cover the passthrough with a zimage loader test
2026-07-14 08:06:45 +01:00
Disty0 49ee0dc647 set group_size_m to 8 on intel too 2026-07-14 02:16:33 +03:00
Disty0 72f8031838 SDNQ update matmul configs 2026-07-14 01:53:48 +03:00
Vladimir Mandic f8cfc408e9 strict subpaths
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 21:48:42 +02:00
Vladimir Mandic f829f2d776 fix infotext
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 20:58:33 +02:00
Vladimir Mandic 31da9cce6f gallery improve sort
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 20:35:05 +02:00
Vladimir Mandic fb71f63d77 fix gallery delete and save
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 19:08:59 +02:00
Disty0 d39bd45d04 check ipex and xpu on sdnq 2026-07-13 19:16:02 +03:00
Disty0 78482ef6ca Enable Triton MM for Intel 2026-07-13 18:24:14 +03:00
Disty0 32650c7e50 SDNQ add fused Triton kernels 2026-07-13 18:01:01 +03:00
Vladimir Mandic ea1d164de3 css updates
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 15:52:55 +02:00
Vladimir Mandic 56fabd4950 add joy-image-edit-plus
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 11:26:33 +02:00
Vladimir Mandic b7944a1be9 video model loader
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-13 11:26:33 +02:00
Disty0 dc7e3929cd SDNQ Atten skip TE 2026-07-13 04:49:55 +03:00
Disty0 41659f9f95 Update Trtiton MM configs 2026-07-12 16:17:14 +03:00
Disty0 16c82c58af make fp8 skip check only valid for linux 2026-07-12 15:37:18 +03:00
Vladimir Mandic 03473c1316 add loaded-loras api endpoint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-12 13:10:35 +02:00
CalamitousFelicitousness 00d1b7cff6 feat(ui): load unet into secondary slot from networks panel
The refine toggle doubles as the slot selector on the UNet/DiT page:
with it active a card click sets sd_unet_secondary instead of sd_unet,
mirroring base/refiner selection on the model page.
2026-07-12 03:50:48 +01:00
CalamitousFelicitousness 5e1a0719ab feat(model): detect header metadata and nvfp4 in the model probe
detect_quant now reads _quantization_metadata as the authoritative quant
source when present, and resolves marker-file formats from the marked
layers' stored weight dtypes instead of file-wide dtype voting, which
mislabeled fp8 files carrying extra uint8 tensors and had no nvfp4
mapping at all. Schema bump so cached probe entries refresh.
2026-07-12 03:44:54 +01:00
CalamitousFelicitousness f05a3ae3e9 fix(sdnq): skip compiled dequant for fp8 weights without hardware support
Triton has no e4m3 conversions before sm_89, so any compiled graph
touching fp8 storage weights fails with an InductorError on Ampere.
Select the eager dequant and re-quantize paths for e4m3 weights when
the hardware cannot compile them; other dtypes keep compiled dequant.
SDNQ_ALLOW_FP8_COMPILE overrides the detection.
2026-07-12 03:44:54 +01: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 3fe54d1045 chore: rename probe cache files to signatures.json and civitai.json 2026-07-12 03:44:19 +01:00
CalamitousFelicitousness 4785dedc32 fix(ui): set refiner option from networks panel refine toggle
The hidden change_refiner button passed key='sd_model_checkpoint', so
loading a card with the refine toggle active reloaded the base model
and never set sd_model_refiner.
2026-07-11 20:26:12 +01:00
CalamitousFelicitousness 8291365955 refactor(model): simplify probe cache handling
json_helpers does its own error handling and file locking, so the
try/except wrappers, threading locks and isfile checks were dead
weight; probe cache file paths are now defined in paths.py.
2026-07-11 20:26:12 +01:00
CalamitousFelicitousness c54c0535c0 fix(civitai): accept civitai.red urls in header peek
The .red mirror rewrites downloadUrl to its own host; normalize to
civitai.com so the ssrf guard, cache hash and fetch host agree.
2026-07-11 20:26:12 +01:00
Disty0 ad400ba817 SDNQ handle subnormals in FP formats and cleanup Triton MM 2026-07-11 21:52:51 +03: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
CalamitousFelicitousness 3831e4563f feat(model): variant-specific fp8 precision tokens
fp8_e4m3fn and fp8_e5m2 differ in kernel support, so a bare fp8 token
is not enough to know whether a file runs on a given architecture;
scaled_fp8 derives its token from the detected format.
2026-07-11 06:40:07 +01:00
CalamitousFelicitousness c72e68e888 feat(model): read exact comfy_quant format from local marker tensors
Local probes read the marker tensor bytes for the true format string
(nvfp4, mxfp8, int8_tensorwise) instead of inferring from weight
dtypes; remote ranged peeks stay dtype-inferred. precision_token maps
quant format or dominant dtype to the short filename token.
2026-07-11 06:40:07 +01:00
CalamitousFelicitousness 055388aa70 feat(civitai): attach model probe analysis to header peeks
peek-header now returns the full probe (architecture fingerprint,
dtypes, quant scheme) alongside the metadata block, and caches the
response persistently by civitai file id; file content per id is
immutable, so cached probes skip the ranged fetch entirely.
2026-07-11 06:40:07 +01:00
CalamitousFelicitousness e5800b005e feat(model): add header-only model probe with arch fingerprints
Analyzes safetensors/gguf headers without reading weights: curated
tensor-name fingerprints for common families, container kind detection
(model/lora/vae/text-encoder), element-weighted precision over core
tensors, comfy_quant/scaled-fp8/gguf quant detection, lora base
resolution via trainer metadata with shape arbitration, and full
__metadata__ passthrough. Results cached by mtime in
data/model_probe.json.

- analyze_header is pure and shared by remote ranged peeks and local
  file reads
- fingerprints verified against the local library and live civitai
  headers; unmatched families report unknown rather than guessing
2026-07-11 06:40:07 +01:00
CalamitousFelicitousness e0ed573d66 feat(civitai): add ranged safetensors header peek endpoint
The API carries no field distinguishing dual-transformer expert files;
conversion tools embed it in the header __metadata__. peek-header
range-fetches the JSON header and returns the metadata block without
downloading the file. Restricted to civitai.com urls.
2026-07-11 06:40:07 +01:00
Disty0 736012d5af SDNQ Atten use FMA on PV 2026-07-10 14:27:53 +03:00
Vladimir Mandic 8ce3313f9a improve log viewer
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-10 13:14:27 +02:00
CalamitousFelicitousness d087c3e687 feat(civitai): route text encoder files to te_dir
Versions bundle companion files typed by the file, not the model;
'Text Encoder' had no TYPE_MAP entry so companions landed in the
checkpoint folder where the loader never scans.
2026-07-10 02:17:33 +01:00
CalamitousFelicitousness 24683dc608 feat(civitai): parse gguf quantType in file metadata
GGUF variants are distinguished by quantType, not fp; the model
endpoint carries it in file metadata.
2026-07-10 02:09:14 +01:00
CalamitousFelicitousness e615b6e22b feat(civitai): sweep abandoned download partials at startup
Interrupted downloads leave url-hash .tmp resume files that nothing
cleans up; the queue that knows about them is in-memory only.

- iter_type_roots lists every folder downloads resolve into
- partials older than 7 days by mtime are deleted when the download
  manager starts; active partials always have a fresh mtime
2026-07-10 01:54:27 +01:00
CalamitousFelicitousness ef6030b871 feat(civitai): expose file variant metadata and scan results
Multi-variant versions serve one canonical filename per file; the
precision, size class, format, and scan status that distinguish them
were dropped at the model layer.

- CivitFile gains metadata (format, size, fp), pickle and virus scan
  results, and scannedAt
2026-07-10 01:54:27 +01:00
Disty0 7578d9b6bc remove dynamic from sdnq atten 2026-07-10 03:22:14 +03:00
CalamitousFelicitousness 9b18aad1c1 feat(civitai): record search filters in history entries
History entries stored only the query or tag term, so restoring a
search dropped every filter, and filter-only browsing was never
recorded at all.

- SearchHistory.add takes an optional params dict stored on the entry
- get_search records non-default filters: type, sort, period, base
  models, nsfw, username, favorites
- filter-only searches are recorded as 'filter' entries labeled with
  the filter values
2026-07-10 00:50:01 +01:00
CalamitousFelicitousness 9f9a350e53 fix(civitai): restart download when server ignores range request
A 200 reply to a resumed download carries the full file, not the
remainder; appending it to the partial produced a corrupt file that
passed the size check and only failed at hash verification. Truncate
the temp file and restart from byte 0 when a Range request comes back
as 200 instead of 206.
2026-07-10 00:05:37 +01:00
CalamitousFelicitousness a274f57aab fix(civitai): tolerate null availability, expose early access fields
The /model-versions endpoint now serializes availability as null, which
failed str validation and turned every version lookup into a 404. Coerce
null to the default like the creator username validator already does.

Pass through earlyAccessEndsAt and earlyAccessConfig so clients can see
that a download requires a Buzz purchase before requesting the file.
2026-07-09 23:49:37 +01:00
Disty0 c35201de30 cleanup triton mm 2026-07-09 16:21:47 +03:00
Disty0 8cc5faa877 remove math import 2026-07-09 14:14:50 +03:00
Disty0 3641d12274 Inductor breaks down with math.log 2026-07-09 14:06:02 +03:00
Vladimir Mandic f4348bcb69 server info handle multi-gpu
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-07-09 11:18:04 +02:00