Commit Graph

14426 Commits

Author SHA1 Message Date
CalamitousFelicitousness b0f004bf83 test(attention): cover the sdpa escape hatches
bypass_sdpa_hijacks and llm_context restore the pinned original over the
router and put the router back, including when the body raises. Captioners
and detailers run inside them, so the router must be removable.
2026-08-23 08:21:28 +01: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
CalamitousFelicitousness b57b8c6a64 perf(attention): capture backend options once per chain
The sdnq backend read six settings on every call; it now captures them
when the chain is built. Each backend declares the settings its call
captures, and webui registers one onchange over those names plus the
override set and the torch kernel flags, so a change rebuilds the chain
between jobs. When a compiled model is resident the rebuild also resets
dynamo, since its graphs hold the previous router.
2026-08-23 08:21:28 +01:00
CalamitousFelicitousness 125ae8e2bf feat(attention): route tracing and chain telemetry
SD_ATTN_DEBUG logs each distinct route once: backend, component role,
step, shapes, dtype and mask presence. The router takes an optional
observer for it, so the clean path carries one pointer check. report()
returns the active chain and generation context, and torch_info records
the whole chain as one string instead of the last prepared backend.
2026-08-23 08:20:46 +01:00
CalamitousFelicitousness 4509b145cd feat(attention): generation context
A module-level context tells attention consumers what is running: the
component role (transformer, text encoder, vae), the index of the
denoiser forward about to run, the pass length, and the model. It is
opened and closed around process_images, reset per denoising pass beside
the callback setup, and advanced by both step sources: the classic
callback passes the completed step plus one, the modular pre-forward
hook counts forwards. Roles come from the existing text encoder and vae
hijacks and the modular phase hooks. The step also lives in a device
scalar updated in place, so a compiled reader keeps its graph across
steps.
2026-08-23 08:20:46 +01:00
CalamitousFelicitousness 9d1d7c839a fix(processing): re-apply attention when the overrides change
The generate-time gate compared the stored processor name against the
sdp_overrides list, which can never be equal, so the check reduced to
the processor name alone and a changed override set was never applied
until the next model load. set_diffusers_attention now stamps the
override set it applied beside the processor name, the gate compares
both, and pipe switches carry the new attribute with the old one.
2026-08-23 08:20:46 +01:00
CalamitousFelicitousness bb0cc5328e fix(attention): flex joins the chain instead of ending it
The flex backend never called the sdpa it replaced, so any backend
stacked before it was unreachable and every call it could not serve,
cpu or 3d inputs included, failed inside flex_attention. It is now an
ordinary entry gated on what flex_attention accepts: 4d tensors on one
non-cpu device. The mask path drops the 2d special case, which indexed
attn_mask.size and reshaped the mask onto the wrong axis; expanding to
(batch, heads, q, kv) already follows sdpa broadcast semantics.
2026-08-23 08:20:46 +01:00
CalamitousFelicitousness 3302e78af6 refactor(attention): backend registry and a single sdpa router
Replace the six closure hijacks stacked in devices.set_sdpa_params with
a registry of declarative backends and one router installed in their
place. Each backend declares the constraints its closure carried as a
predicate, a priority matching its old stacking position, and a prepare
step that imports and configures the implementation; the router walks
the prepared entries by priority and hands declined calls to the
terminal backend (dynamic, flex) or the original sdpa, so fallback is
the router's job rather than each closure's.

- parity held: gates transcribed literally, the same kernel kwargs,
  enable_gqa passed to the original only when set, torch_info keeps the
  last prepared backend, the dynamic pin still set
- a backend enabled on a platform without it warns instead of silently
  doing nothing
- the legacy set_* entry points are gone; devices.py installs the router
- test/test-attention-router.py checks every override subset against the
  old stacking order, gate parity over 16,000 shape cases, dispatch,
  terminal handoff and prepare isolation, offline
2026-08-23 08:20:45 +01:00
CalamitousFelicitousness 6ed1b99aaa refactor(attention): move into a package
modules/attention.py becomes modules/attention/: hijacks.py keeps the six
sdpa monkeypatch setters, dispatcher.py the diffusers-side processor and
dispatcher setup with the kernels hub hijack, and the package facade
re-exports every public name so call sites are unchanged. The devices
import moves inside set_diffusers_attention, which removes the
devices <-> attention import cycle.
2026-08-23 08:20:45 +01:00
Vladimir Mandic b21fb577c9 Merge branch 'master' into dev 2026-08-22 20:10:45 +02:00
Vladimir Mandic e17efc19f7 update upscaler workflow
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 20:10:02 +02:00
Vladimir Mandic 2cafc60e92 Merge pull request #5048 from vladmandic/dev
refresh master
2026-08-22 18:12:10 +02:00
Vladimir Mandic 9b5cf7a73b Merge branch 'master' into dev 2026-08-22 18:11:58 +02:00
Vladimir Mandic 9920004dec update file logger and requirements
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 17:52:49 +02:00
Vladimir Mandic 2fe5049c04 Merge pull request #5047 from vladmandic/dev
refresh master
2026-08-22 16:15:42 +02:00
Vladimir Mandic a6b6a472c9 Merge branch 'master' into dev 2026-08-22 16:15:32 +02:00
Vladimir Mandic 69d8f4f7c4 handle torchsde
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 16:08:58 +02:00
Vladimir Mandic 5c91f58c24 update todo/changelog
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 11:45:06 +02:00
Vladimir Mandic f66650f913 Merge pull request #5046 from vladmandic/dev
fix missing export
2026-08-22 11:39:46 +02:00
Vladimir Mandic 25edd3387f Merge branch 'master' into dev 2026-08-22 11:39:38 +02:00
Vladimir Mandic 87cb999713 fix missing export
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 11:38:51 +02:00
Vladimir Mandic 9053a3d8b9 Downgrade pre-commit CI action version to v1.1.0 2026-08-22 11:36:04 +02:00
Vladimir Mandic 100a4da109 Merge pull request #5045 from vladmandic/master
refresh dev
2026-08-22 11:30:32 +02:00
Vladimir Mandic 864e9a497f Merge branch 'dev' into master 2026-08-22 11:30:18 +02:00
Vladimir Mandic 63a5722429 prepare queue mgmt
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 11:24:41 +02:00
Vladimir Mandic 367f863661 Update GitHub Actions to use latest action versions 2026-08-22 11:24:19 +02:00
Vladimir Mandic dfc399c7af Rename lint workflow to 'Lint Project' 2026-08-22 11:20:56 +02:00
Vladimir Mandic c68d993b75 Rename workflow to 'Build GitHub Pages' 2026-08-22 11:20:31 +02:00
Vladimir Mandic dcdfa5534f Rename workflow to 'Edit Readme Sponsors' 2026-08-22 11:20:07 +02:00
Vladimir Mandic 2ba7f9d1c8 update js deps and submodules
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-22 09:30:49 +02:00
Vladimir Mandic 8cc52889a3 lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 20:35:15 +02:00
Vladimir Mandic 84c1ed66b3 video upscaling
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 20:28:44 +02:00
Vladimir Mandic 9dd1d73f6d video upscaling using spandrel
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 16:21:12 +02:00
Vladimir Mandic d239bfcde1 placeholder video upscale
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 10:26:17 +02:00
Vladimir Mandic 52f5c17435 update spandrel integation
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-21 09:35:15 +02:00
CalamitousFelicitousness 25b7961e4e fix(lora): refuse a network whose deltas do not fit the model
A delta that does not fit its target module cannot apply, and applying only
the layers that do fit leaves the model in a state nothing was trained for,
so try_load_chain drops the whole file when any family reports a mismatch.
Bias deltas were never checked against the target bias and could only surface
at apply time; a module with no bias stays a non-mismatch, since whole
architectures are built bias=False.

- check bias deltas against the module bias in the lora, norm and full loaders
- carry the mismatch count on the network so the chain can refuse the file
- record refused writes in the infotext so a partial apply is not read as clean
- point the krea2 full-diff test at a module that has a bias
2026-08-21 02:12:16 +01:00
CalamitousFelicitousness 6a354cdbc6 fix(lora): apply bias deltas onto the bias, not the weight
network_add_weights defaulted its base tensor to self.weight for the bias
delta as well, so in fuse mode a diff_b was added to the weight matrix and
the result written into the bias. Layers where in and out differ threw a
shape error and had the weight matrix installed as their bias, square layers
broadcast silently, and either way the summary still counted the delta as
applied.

- pick the base tensor from the bias flag
- name the layer, target and both shapes in the mismatch error
- return which of (weight, bias) took a write, count the rest as refused
- report refused= on partially applied and partially removed networks
- cover both apply paths in test/test-lora-apply.py
2026-08-21 01:42:25 +01:00
Dity0 43b739066d Add tensor-wise quantization support with group_size=-2 2026-08-21 00:04:33 +03: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 1b13e732e0 add cookie-based auth for remote-ip
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-19 16:28:07 +02:00
Vladimir Mandic a393373b3a Merge pull request #5039 from resonantsky/dev
Added ROCm Multi-Arch installation support
2026-08-19 16:24:04 +02:00
Vladimir Mandic 85235a8bcd Merge pull request #5041 from vladmandic/feat/ltx-keyword-core
feat(ltx): add a keyword core to the ltx runner
2026-08-19 08:35:08 +02:00
Vladimir Mandic 9117698a62 Merge pull request #5040 from vladmandic/fix/framepack-tiny-normalize
fix(framepack): decode tiny video without a second normalize
2026-08-19 08:34:30 +02:00
CalamitousFelicitousness 94877de073 fix(sdnq): keep the autotune progress bar off the benchmark display
The triton autotune hijack draws its own rich progress bar on the
logger console during sweeps; a second live display on the same
terminal tramples the benchmark's live tables and leaves stale panel
border lines in scrollback. Disarm the bar in the benchmark process
and keep the hijack's bookkeeping.
2026-08-19 02:46:23 +01:00
CalamitousFelicitousness 7ca026ee4f feat(sdnq): auto-name and default-save benchmark outputs
Write the text and json reports by default, named to the archive
convention <gpu>-t<torch>-<date> with a collision suffix for the pair,
into $SDNQ_BENCH_DIR, --outdir, or benchmarks/ under the sdnext root.
'none' disables either output and explicit paths behave as before.
2026-08-19 01:49:57 +01:00
CalamitousFelicitousness 9c11929780 fix(ltx): place the 0.9 latent upsampler on the compute device
Its 2.x sibling always did, so only the 0.9 path hit a cpu weight against cuda
latents. Also logs why a run is refused, which until now travelled only in the
raised error.
2026-08-19 01:45:46 +01:00
CalamitousFelicitousness 5deeeebbdc fix(framepack): decode tiny video without a second normalize
TAEHV.decode_video already returns [-1,1] and framepack applied its own x2-1 on
top, landing near [-3,1] where the worker documents [-1,1]. The path was
unreachable until the taesd loader began honoring an explicit variant.
2026-08-19 01:45:46 +01:00
CalamitousFelicitousness 8d69b011e1 feat(ltx): add a keyword core to the ltx runner
run_ltx reported failure by yielding a string, which is why LTX had no API.
run() is the core underneath: keyword arguments named as video_run.run names
them, a VideoResult back, VideoError out with 499 for an interrupt. The lock,
progress and summary stay in the adapter, whose signature is unchanged since
callers bind to it by keyword. Failure now closes the processing object and
deactivates networks, which abort never did.
2026-08-19 01:45:46 +01:00
CalamitousFelicitousness bd0ea5ee1b fix(ltx): resolve every conditioning source the same way
The gallery branch took an upload handle or a PIL image, so an encoded string
fell through to .convert and was logged as a failed condition. Strings now go
to the api decoder, which reads base64 and upload refs rather than paths.
2026-08-19 01:45:46 +01:00