Commit Graph

8777 Commits

Author SHA1 Message Date
Disty0 440aa0d105 typing 2026-06-19 03:28:09 +03:00
Disty0 bd3eac047f SDNQ fix NPU accuracy 2026-06-19 02:59:21 +03:00
Disty0 7d14e814bd SDNQ revert NPU default 2026-06-19 01:55:06 +03:00
Disty0 38820cbbd9 SDNQ add NPU support and default to NPU on CPUs with OpenVINO 2026-06-19 00:12:22 +03:00
Disty0 8a9f5c0761 sdnq fix use_contiguous_mm check with openvino 2026-06-18 20:03:47 +03:00
Disty0 5244f63554 SDNQ add OpenVINO MM for CPUs 2026-06-18 18:15:57 +03:00
Vladimir Mandic 8d4ebcd5ef processors multiple fixes
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-18 11:45:34 +02:00
Vladimir Mandic 7c81bc2d50 lint fixes
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-18 11:45:34 +02:00
Vladimir Mandic b60c67ecd4 fix preview mapping
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-18 11:45:34 +02:00
Disty0 4b89d65639 Remove CPU from use_contiguous_mm 2026-06-17 22:10:50 +03:00
Disty0 8214b044e3 SDNQ show a warining for no Triton instead and stop overriding matmul to false 2026-06-17 02:17:21 +03:00
Vladimir Mandic b0dd94ab8a fix tinyvae with anima
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-16 11:58:36 +02:00
CalamitousFelicitousness 0769d423a7 fix(upscale): make SeedVR2 generation_step patch idempotent
UpscalerSeedVR.load_model() rebinds the module-global
generation.generation_step (called by name inside generation_loop) to
the instance's model_step wrapper, keeping the previous value to call
back into. That global was never restored, so the second pass through
load_model() saved the wrapper itself as the "original", making
model_step() call itself -> RecursionError.

The second pass is reached on any model (re)load: with upscaler_unload
enabled (self.model reset to None after each run) every subsequent run
recurses, and switching SeedVR variants (self.model_loaded != model_name)
triggers it even without unload.

Stash the pristine generation_step on the module once and have the
wrapper call that, so repeated loads never wrap the wrapper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 10:18:21 +01:00
Vladimir Mandic 25262146fb lint fix
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-16 10:16:17 +02:00
Vladimir Mandic 6cc2a9582f Merge pull request #4935 from QualiaRain/fix/lora-network-shape-guard
fix(lora): guard self.shape for modules without a weight attribute
2026-06-16 09:01:24 +02:00
Vladimir Mandic 8f5759ac01 fix video prompt
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-16 08:47:19 +02:00
Vladimir Mandic d989bac108 Merge pull request #4932 from QualiaRain/fix/hypertile-hires-dimensions
fix(hypertile): correct width/height mapping in hires set_resolution
2026-06-16 08:37:43 +02:00
Vladimir Mandic 524c059b79 Merge pull request #4931 from QualiaRain/fix/controlnet-unit-guards
fix(control-units): list zimage controlnets under 'all'; fix LLLite output-block fall-through
2026-06-16 08:37:12 +02:00
Vladimir Mandic 9b3687ca55 Merge pull request #4930 from QualiaRain/fix/runtime-and-detect-guards
fix(runtime): capture bias dtype cast, coerce env seq-len to int, init pipeline before use
2026-06-16 08:36:11 +02:00
Vladimir Mandic b4079881ec Merge pull request #4929 from QualiaRain/fix/api-input-guards
fix(api): IP-adapter mask accumulation, null params, colon-in-password, raw allowed path
2026-06-16 08:35:35 +02:00
Vladimir Mandic d131606153 Merge pull request #4928 from QualiaRain/fix/lora-extract-component-selection
fix(lora-extract): stop overwriting the module selection list; fix dead no-LoRA guard
2026-06-16 08:33:09 +02:00
Vladimir Mandic cf64578f48 Merge pull request #4927 from QualiaRain/fix/control-video-frame-advance
fix(control): advance video frames via cap, not the always-None video var
2026-06-16 08:28:09 +02:00
Disty0 78243b70a4 sharpfin don't use antialias with area mode 2026-06-15 23:41:58 +03:00
QualiaRain 42a4b82c8e fix(lora): guard self.shape for modules without a weight attribute
NetworkModule.__init__ set self.shape only inside 'if hasattr(sd_module, weight)' but then used len(self.shape) unconditionally, raising AttributeError when a LoRA targets a weightless module. Default shape to None and skip the dora_norm_dims computation when absent.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-15 15:20:08 -04:00
QualiaRain 14a8eebbb8 fix(hypertile): correct width/height mapping in hires set_resolution
hr_upscale_to_x is the width dimension and hr_upscale_to_y the height (see processing_class.py); set_resolution assigned them transposed, producing swapped HyperTile geometry on non-square hires passes.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-15 15:20:07 -04:00
QualiaRain bbbb450884 fix(control-units): list zimage controlnets under 'all'; fix LLLite output-block fall-through
api_list_models omitted the 'or model_type == all' clause for zimage, so ZImage ControlNets never appeared in the all listing - added it to match every other family. lite_model used pass for the unimplemented root==output branch, which fell through to b = getattr(b, attn_name) with b unbound or stale from a prior iteration (UnboundLocalError or wrong-block patch); use continue to skip it.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-15 15:20:07 -04:00
QualiaRain a68da643f1 fix(runtime): capture bias dtype cast, coerce env seq-len to int, init pipeline before use
sd_hijack_accelerate.py: bias.to(weight.dtype) discarded its result (Tensor.to is not in-place), so the conv still received the mismatched bias. sd_hijack_te.py: os.environ.get returns a str when MAX_SEQUENCE_LENGTH is set, so max(int, str) raised TypeError (uncaught, before the try); coerce with int(). sd_detect.py: pipeline was referenced in 'if callable(pipeline)' but only assigned when cls is not None, raising UnboundLocalError for a model_index.json without _class_name.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-15 15:20:07 -04:00
QualiaRain 711d6018bf fix(api): IP-adapter mask accumulation, null params, colon-in-password, raw allowed path
generate.py: p.ip_adapter_masks was reinitialized inside the per-adapter loop, discarding all but the last adapter's masks; move it beside the other accumulators. process.py: req.params is dict|None, so a null params body crashed .items() in post_preprocess/post_mask. api.py: split(':') without maxsplit broke auth/auth-file entries whose password contains a colon. gallery.py: allowed_paths stored quote(path) but the membership check and path guards use the raw path, causing duplicate accumulation and an ineffective whitelist; also drop the unused FastAPI import (pylint W0611 surfaced when this file is linted).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-15 15:20:07 -04:00
QualiaRain ca730fa3e6 fix(lora-extract): stop overwriting the module selection list; fix dead no-LoRA guard
make_lora reassigned the 'modules' selection arg to a named_modules() generator, so the subsequent 'te'/'unet' in modules checks tested an exhausted generator and silently skipped TE2 + UNet extraction. Also 'loaded_lora() == ""' never matched a loaded model (returns a list), so the no-LoRA-detected guard never fired.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-15 15:20:06 -04:00
QualiaRain a6b4614e25 fix(control): advance video frames via cap, not the always-None video var
The VideoCapture is stored in cap, but the per-frame read and skip/yield guards referenced video, which is set to None at function entry and never reassigned. As a result only the first frame of a video input was processed.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-15 15:20:06 -04:00
Disty0 d227a46406 SDNQ handle hf_quantizer and modules_to_not_use_matmul in loader 2026-06-15 22:04:43 +03:00
Disty0 e5a15ab6e1 Update SDNQConfig docstring 2026-06-15 19:39:03 +03:00
Vladimir Mandic f69ce0d845 update requirements
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-15 14:55:14 +02:00
Vladimir Mandic 1a59647b12 cleanup
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-15 13:03:09 +02:00
Vladimir Mandic 5aea60ab71 lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-15 12:06:43 +02:00
Vladimir Mandic 8e04473ac4 rebuild ui
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-15 11:57:53 +02:00
Vladimir Mandic fd210da39f lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-15 08:45:58 +02:00
CalamitousFelicitousness 1be0867d1e refactor(lora): centralize universal passthrough prefixes in the shared resolver
transformer., bare-diffusers, and lora_transformer_ bases are already in
network-key form for every arch, yet each per-arch resolve_targets repeated the
same passthrough branch for them. Move that into a shared
PASSTHROUGH_PREFIXES_DEFAULT set consulted by resolve_group_targets, leaving each
arch's resolve_targets to only the prefixes it actually rewrites (kohya / BFL).
lycoris_ stays in flux2, the one arch that recognizes it.

Pure refactor: the same keys resolve to the same modules.
2026-06-14 18:22:41 +01:00
CalamitousFelicitousness 31c07dbaf9 fix(lora): load OneTrainer diffusers-format LoRAs via lora_transformer_ prefix
OneTrainer saves LoRAs against the diffusers layout, keying each module as
'lora_transformer_' + the underscore-flattened module path with QKV pre-split.
That is sdnext's own network_layer_mapping namespace, but the native loader did
not list it as a known prefix, so parse_key dropped every key and the network
loaded zero modules ("not loaded").

Add lora_transformer_ to KNOWN_PREFIXES_DEFAULT and resolve it in a shared
resolve_group_targets helper that passes the base through unchanged, with no
rename or chunking. Routing every family loader through the helper gives all
diffusers arches (chroma, flux2, zimage, ernie) OneTrainer support without
per-arch wiring.

Fixes #4877
2026-06-14 18:22:41 +01:00
Disty0 c8458ae0af SDNQ fix conv1d 2026-06-14 19:25:22 +03:00
CalamitousFelicitousness 4a64ec428b feat(samplers): add DPM++ 3M SDE preset
DPMSolverMultistepScheduler implements 3rd-order sde-dpmsolver++, but the preset grid stopped at order 2 on the SDE row. Add the order-3 variant next to DPM++ SDE and DPM++ 2M SDE to complete it.
2026-06-14 01:42:26 +01:00
CalamitousFelicitousness e804d6df21 feat(samplers): group sampler dropdown into labeled sections
Reorder samplers_data_diffusers into recognizable solver-family groups (Euler, DPM/DPM++, UniPC/DEIS, Heun/KDPM2, ER-SDE, Classic, Distilled, Misc), each ending with its FlowMatch variants, and Res4Lyf as a fenced experimental section, so the dropdown is scannable.

Dividers are SamplerData sentinels with U+2500 names: create_sampler keeps the current scheduler when one is selected, get_sampler_name falls back to Default, set_samplers and validate_sampler_name exclude them, and a visible_samplers() helper drops them from the xyz axes, detailer, and folder pickers. The main and refine dropdowns render them as section labels. No sampler is removed or renamed, so saved infotexts, styles, and API calls keep resolving.
2026-06-14 01:41:05 +01:00
Disty0 099b4e4214 SDNQ fix Diffusers API change breaking Transformers 2026-06-13 03:03:14 +03:00
Disty0 55f811e837 SDNQ add N4 Hadamard and set Hadamard Group Size to 256 2026-06-13 00:56:50 +03:00
Vladimir Mandic 25b6030d2b Merge pull request #4920 from QualiaRain/fix/assorted-logic-bugs
Fix dead ControlNet-union path, double video-VAE normalization, and four more logic bugs
2026-06-12 19:31:24 +02:00
Vladimir Mandic 698003b590 Merge pull request #4918 from QualiaRain/fix/ui-misc-guards
Fix parse_metadtaa typo, None-desc crash, and malformed-input crashes in UI/misc
2026-06-12 19:30:35 +02:00
Vladimir Mandic 8f4ea879b9 Merge pull request #4917 from QualiaRain/fix/model-vae-fixes
Fix wrong-variable checks in TE/quant loading and remote-VAE response handling
2026-06-12 19:28:33 +02:00
Vladimir Mandic dfc1fc70ab Merge pull request #4916 from QualiaRain/fix/processing-crash-guards
Fix dead init_images branch, dead timer profile mode, and empty-list crashes in processing
2026-06-12 19:26:13 +02:00
QualiaRain 8a8d99019a fix: dead hasattr-on-dict path, double video-vae normalization, undefined self.device, hyimage if/elif, attention-mask attr typo, wrong face logged
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 13:00:57 -04:00
QualiaRain 9f2374f5ff fix ui/misc: None desc crash, ratio/tile/lora split guards, parse_metadtaa typo, moondream type guard
Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-12 13:00:50 -04:00