152 Commits

Author SHA1 Message Date
Vladimir Mandic 059ccbaf0b Merge pull request #5091 from CalamitousFelicitousness/feat/lora-pdd
feat(lora): parallel decoding heads and minimax schedule controls
2026-09-16 07:45:57 +02:00
CalamitousFelicitousness c3fc8560cb docs(offload): describe the group offload blocks setting
The blocks count is clamped to one under streams and leaf level never
reads it; the hint says so, and the type hint names the setting it
refers to.
2026-09-16 02:13:28 +01:00
CalamitousFelicitousness 726907dd5b fix(video): count minimax steps as transformer evaluations
MiniMaxH3Scheduler counts the terminal sigma in num_inference_steps, so
Steps N ran N-1 evaluations while every other model runs N. The shim
hands the scheduler p.steps + 1, the slider starts at 1, and the PDD
pin records the evaluation count while passing the scheduler its grid
argument. Metadata written before this change counted grid points.
2026-09-16 00:47:46 +01:00
CalamitousFelicitousness 29fe895c0b feat(video): absolute per-request minimax shift on every path
Shift is a property of the trained schedule, not of the step count, so
the tab sliders take absolute values, defaulting to the shipped 12 and
3. video_minimax resolves each request from the request value or the
scheduler config inside apply_overrides, which the tab, the api and
the still path all call, so a request without values lands on the
shipped schedule. The api maps sampler_shift onto the video schedule
and gains audio_shift. Applied values are recorded as Video shift and
Audio shift; the PDD pin records what it enforces.
2026-09-15 23:01:41 +01:00
Vladimir Mandic 28c20f6aa0 refactor theme loading
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-15 08:17:27 +02:00
Vladimir Mandic 8691654bef cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-14 13:57:08 +02:00
CalamitousFelicitousness eb3a062339 feat(civitai): list every file of a version in the gradio model details
The versions table showed only files[0], so precision variants of one
version could not be downloaded. Each file gets its own row under
rowspan version cells, sorted by precision then size, with a variant
column and a star on the primary; rows download by fileId URL and All
variants queues each version's primary from the fetched model. Companion
files pass their own type, and save names carry the precision, then
full/pruned and the file id only when needed to stay unique.
2026-09-13 23:19:56 +01:00
Vladimir Mandic 5ffc71bd39 increase progress timeout
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-13 13:59:24 +02:00
Vladimir Mandic da5d934f1f Merge branch 'dev' into feat/filter-sampler-upscaler-choices 2026-09-13 07:41:53 +02:00
Vladimir Mandic e6d5efa97f autocomplete dont fetch disabled networks
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-13 07:40:53 +02:00
Vladimir Mandic 07b4cbbd3d ui restyling
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-12 13:43:37 +02:00
Vladimir Mandic 799f10f49d fix list vs str
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-10 12:29:46 +02:00
Vladimir Mandic b0c21c5448 dlss xyz grid
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-10 10:50:52 +02:00
Vladimir Mandic df163f3f35 fix prompt enhance api with vision
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-10 09:03:07 +02:00
Vladimir Mandic d23faa1f32 dlss batch processing and setup logging
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-09 19:22:38 +02:00
Vladimir Mandic e2051bdf28 add ui loading diag
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-09-09 14:29:41 +02:00
Yifan Chen a174e94183 feat(ui): filter generated sampler and upscaler lists 2026-09-07 08:29:37 -07:00
Vladimir Mandic bed6bfc530 minimax preview
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-31 17:13:11 +02:00
Vladimir Mandic 34d9d304db modular guiders and other stuff
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-30 11:51:19 +02:00
Vladimir Mandic 62bedf8834 update attention handlers and settings
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-29 13:05:20 +02:00
Vladimir Mandic da856522a8 Merge branch 'dev' into feat/lora-sdnq-stack 2026-08-29 09:46:42 +02:00
CalamitousFelicitousness 455a6d0e8f feat(lora): default the select-mode ramp to 0
At 1.5 the ramp hands nearly every layer to the style network mid-generation,
which on few-step models overwrites the forming subject before identity sets.
Alpha 0 freezes the schedule into a static per-layer split: the subject keeps
its layers for the whole generation and style keeps the layers where it is
more salient. Nonzero values remain the scheduled handover toward the second
network.

- locale hints describe both regimes; the mode hint no longer implies the
  shift is always on
2026-08-28 13:09:26 +01:00
CalamitousFelicitousness f156026150 feat(lora): balance estlora layer scores by network magnitude
EST-LoRA scores each layer by squared Frobenius energy, so a magnitude gap
between the two networks enters squared and the louder network wins nearly
every layer, starving the quieter one. The style side is now scaled by the
total-energy ratio (mirroring klora's gamma), making selection scale-invariant
so a network cannot take layers on magnitude alone. On the krea2 subject+style
pair this lifts the style network from 18% to 65% of the layer-step budget.

- lora_stack: accumulate per-mode energy totals, apply the balance in the est ramp
- test: content-louder est pair now hands over mid-schedule where raw scoring never would
- locale: note the est magnitude balance, and that a select mode gives each layer
  to one network so both can be under-applied, while dense modes blend more fully
2026-08-28 13:09:26 +01:00
CalamitousFelicitousness 55c3eb1325 refactor(lora): remove the lora_apply_te setting
Text encoder networks now apply unconditionally in the native path.

- remove the option, the per-request parameter and the control threading
- collapse activate_filtered into plain activate at all call sites
- drop the toggle from the prompt embed cache key
- register the retired key so existing configs load without warnings
2026-08-28 13:09:26 +01:00
CalamitousFelicitousness c42adcf680 docs(i18n): rework lora hosting and stack mode hints
Restructure the seven hints to the settings pattern: lead definition,
tradeoff, scope, special values and stated default, with value and
cross-setting markup. Mode bullets and special values match loader
behavior: sub-8-bit hosting gate, rank 0 fallback, ramp 0 freezing
the balance.
2026-08-28 13:09:26 +01:00
CalamitousFelicitousness 2396185393 feat(lora): dense stack modes for multi-network sets
Add lora_stack_mode with ties, dare_ties, dare_linear and
magnitude_prune combination of per-network deltas when several loaded
networks target one layer; sum stays the default and the exact factor
path. Combined deltas ride the existing tail: hosted svd on sub-8-bit
SDNQ, requantize at int8 and above, direct add elsewhere. Text-encoder
layers and single-network sets keep plain summation. DARE masks draw
from per-layer sha256 seeds so re-applies and cache entries stay
deterministic; the stack settings join the activation and factor-cache
signatures so settings changes re-apply without a reload.
2026-08-28 13:09:00 +01:00
CalamitousFelicitousness 0fa987e350 docs(settings): record the head sharing finding in the sparse hints
Per-head selection is what breaks head-consistency sensitive models, measured on Anima across fourteen arms: the only clean sparse selections are the ones every head shares. The head sharing hint names itself as the first resort for banded output, and the exclusion hint carries why Cosmos stays listed.
2026-08-28 12:40:23 +01:00
CalamitousFelicitousness 0b56e36a2a feat(attention): exclude known bad models from sparse attention
sparse_attention_exclude is a comma separated denylist matched case insensitively against the architecture, the pipeline class and the denoiser class, so one entry works whichever name is to hand. It resolves once per model rather than per call and declines with a log line. Seeded with CosmosTransformer3DModel, the transformer Anima runs, which returns banded noise at every budget tested against a sound dense baseline; listing the class rather than the architecture covers the other models built on it, none of which have been checked.
2026-08-28 12:40:23 +01:00
CalamitousFelicitousness 8138424bbe docs(settings): cross-reference sparse attention from the sdp hints
The SDP overrides and SDNQ Attention hints describe the block mask capability
without naming what consumes it, so the two backends that can drive sparse
attention now say so where the reader is choosing between them.
2026-08-28 12:40:23 +01:00
CalamitousFelicitousness f0531e1c88 docs(settings): expand the sparse attention hints
Each hint now carries its default, the tradeoff in both directions, and the
setting it depends on. The two schedule settings do nothing unless both are
above zero, which nothing said before. The sequence floor is given in
resolution as well as tokens, since the setting is read in pixels.
2026-08-28 12:40:23 +01:00
CalamitousFelicitousness 97b5112cf8 refactor(settings): make the sparse sequence floor a plain value
The option defaulted to 0 and a property turned that into 8192, which hid
the real default behind a sentinel and left no way to sparsify every
sequence. The default is now 8192 in the settings registry, 0 means no
floor, and the slider tops out at 32768 rather than a length nothing
reaches. A negative value is left unclaimed for a derived floor.
2026-08-28 12:40:23 +01:00
CalamitousFelicitousness 7bc11ff470 docs(settings): name the sparse attention sequence floor
The hint deferred to an unnamed built in threshold where every comparable
hint in the file gives the value. It is a single static constant.
2026-08-28 12:40:23 +01:00
CalamitousFelicitousness b2de8f53c4 feat(attention): sdnq backend consumes the block selection
The sdnq Triton kernel gains a block mask input (on the submodule's feat/block-mask branch; the pointer here is unchanged), so the backend advertises the block_mask cap and passes the router's selection as block_mask plus its block sizes. Prepare probes the installed kernel's signature and narrows the cap when the input is missing, warning when sparse attention is on, so an older submodule stays dense instead of failing. PlanEntry carries the narrowed caps, and the router, the sparse stage and the report read those rather than the declaration.

- benchmark: int8-sparse100/50/30/15 and int8-radial30 rows feed the same producer as the flex rows into the quantized kernel, skipped on builds without block_mask; a --configs filter selects attention rows the way --block-configs selects block rows; sparse rows of either backend are held out of the settings advice
- test/test-attention-sdnq-sparse.py: the kernel contract against the token-expanded mask, the nesting filter, the public entry on the quantized paths, the backward against the same selection and against fp32 autograd, and the flex consumer on one selection, pinned to one tile per run with a --tiles sweep
- locale: the sparse attention hint names both capable backends
2026-08-28 12:40:22 +01:00
CalamitousFelicitousness d75abce642 feat(attention): sparse attention settings and router stage
Sparse attention is a stage over the chain rather than a member of it:
one switch, and the router hands the selection to whichever active
backend advertises that it consumes a block mask, currently flex. A
backend declares that through a capability set, so the quantized kernel
joins later without touching the router.

The stage gates on the component role, self attention, a minimum
sequence length defaulting to the measured 8192 token crossover, and the
absence of a token mask or causal flag, which flex cannot combine with a
block only mask. Budgets follow a precomputed per step schedule with at
most two distinct values. Enabling the feature with no capable backend
in the chain warns and leaves attention dense rather than doing nothing
quietly.

The modular pre-forward hook now receives kwargs and publishes whatever
token layout the pipeline passes by name, so a packed sequence gets its
conditioning pinned without any model specific code. Without a layout
the whole sequence is sparsified and that is logged once per length.
2026-08-28 12:40:22 +01:00
CalamitousFelicitousness a2daf9027c feat(lora): disk cache for hosted svd factors
Hosting a non-factorable set costs one truncated svd per layer on every
fresh apply. The factors are deterministic in the checkpoint, the loaded
set, the host rank and the calibration statistics, so they persist under
data/lora-factor-cache keyed by that identity and replay bit-identically
on later applies. lora_sdnq_host_cache sets the disk budget in GB
(0 disables), least-recently-used entries are evicted past it. With the
cost paid once per configuration, svd subspace iterations rise from 2 to
4: about two thirds of the captured-energy gap to an exact decomposition
for +45% one-time compute; an exact svd measures 200-400x slower at
these shapes and is not viable.

- modules/lora/lora_factor_cache.py: signature, store, flush, eviction
- lora_sdnq.apply_hosted: fetch before computing, store after, hits in
  the load summary
- cli/lora-quant-fidelity.py: matching niter for the hosted mirror
- test/test-sdnq-lora-factors.py: factor-cache category, 3 tests
2026-08-26 23:47:44 +01:00
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
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
CalamitousFelicitousness fcadb4fa9b docs(settings): hint the attention settings
Everything under Cross Attention, SDNQ Attention and Attention Dispatcher
shipped with no hint, which left the layering invisible: the SDP kernel boxes
are candidates torch chooses from per call rather than a selection, and the
Flash box is torch's own build of the kernel rather than the flash-attn package
that the Flash attention override installs.

- cover attention method, sdp kernels, sdp overrides and attention slicing
- give the dynamic attention rates their unit and the estimate they compare against
- cover the sdnq attention kernel settings, including the head dimension clamp
  that the hadamard group size resolves through
- cover the diffusers attention dispatcher and the backend names it takes
- record the constraints each override serves, leaving the throughput comparison
  to the workload rather than naming a winner
2026-08-24 21:59:58 +01:00
CalamitousFelicitousness 4d6f2b65c8 chore(settings): remove the bmm attention methods
Batch matrix-matrix and Dynamic Attention BMM applied a legacy Attention
processor to pipe.unet, which a diffusion transformer does not have, so
they served unet models alone and said nothing elsewhere. The choices, the
processor and its slice helper are removed, an unrecognized method now
warns rather than selecting nothing, and a stored value is rewritten to
Scaled-Dot-Product on load.
2026-08-24 19:59:41 +01:00
Vladimir Mandic 3d7c138a83 lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-19 19:02:39 +02:00
Vladimir Mandic c66342e2e6 fallback unpack-latents, log client auth, update login page
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-19 18:03:39 +02:00
Vladimir Mandic 9f650367cb multiple cleanups
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-17 09:35:07 +02:00
Vladimir Mandic 7172fd3eb2 api auth for ws and api validate allowed paths
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-16 18:57:26 +02:00
Vladimir Mandic f30e6baa67 codespell
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-16 12:45:50 +02:00