Commit Graph

38 Commits

Author SHA1 Message Date
CalamitousFelicitousness 65e59e7224 feat(lora): z-image native lokr, loha and oft loaders
Add three adapter families to the z-image native loader and chain them
with the existing lora path through load_safetensors. Mixed-family
files (for example gta6_amateur_photography_zimagebase_v2.safetensors,
which carries lora and lokr groups in the same file) now load
completely instead of having one family silently dropped.

Shared helpers in pipelines/z_image/zimage_lora.py parse keys by
suffix list, rename legacy attention.out and attention.wo to
attention.to_out.0, and split fused attention.qkv into to_q/k/v. For
lora the split chunks the up weight along dim 0. For lokr the split
emits three NetworkModuleLokrChunk entries that share the tensors and
slice the kronecker product at apply time.

Fused attention.qkv for loha and oft is skipped with a warning. No
NetworkModuleHadaChunk exists, oft rotations are tied to out_features
and cannot be cleanly split across q/k/v, and no real z-image adapter
in that layout exists today.

load_safetensors for zimage chains try_load_lora, try_load_lokr,
try_load_loha and try_load_oft and merges their module dicts into a
single Network so mixed files load every module.
2026-04-14 21:48:19 +01:00
CalamitousFelicitousness c35adc4d0d feat(lora): native z-image lora loader
Add zimage to allow_native so lora_force_diffusers picks between
native and diffusers. Before this, zimage always took the diffusers
path regardless of the setting.

pipelines/z_image/zimage_lora.py reads the safetensors and writes
directly into network_layer_mapping, so Z-Image LoRAs no longer go
through the diffusers PEFT converter that raised KeyError on
state dicts with partial alpha keys.

Key formats handled: ai-toolkit, kohya lora_unet_, bare transformer.
and no-prefix. Pre-refactor fused attention.qkv is split into
to_q/k/v; attention.out and attention.wo are renamed to
attention.to_out.0. Alpha and dora_scale are preserved.
2026-04-14 21:13:23 +01:00
CalamitousFelicitousness 18568db41c Add native LoRA loading for Flux2/Klein models
Load Flux2/Klein LoRAs as native NetworkModuleLora objects, bypassing
diffusers PEFT. Handles kohya (lora_unet_), AI toolkit (diffusion_model.),
diffusers PEFT (transformer.), and bare BFL key formats with automatic
QKV splitting for double block fused attention weights.

Includes shape validation to reject architecture-mismatched LoRAs early.
Respects lora_force_diffusers setting to fall back to PEFT when needed.
2026-03-25 04:24:49 +00:00
vladmandic 57990fd8c0 add FireRed-Image-Edit-1.1
Signed-off-by: vladmandic <mandic00@live.com>
2026-03-23 06:41:46 +01:00
CalamitousFelicitousness 091f31d4bf add Flux2/Klein LoRA support
- detect f2 model type for LoRAs via metadata, architecture, and filename/folder
- preprocess bare BFL-format keys with diffusion_model prefix for Flux2LoraLoaderMixin
- handle LoKR format via native NetworkModuleLokr with on-the-fly kron(w1, w2)
- add NetworkModuleLokrChunk for fused QKV split into separate Q/K/V modules
- activate native modules loaded via diffusers path
- improve error message for Flux1/Flux2 architecture mismatch
2026-03-23 02:14:07 +00:00
vladmandic f83e9e7943 deregister rembg submodule
Signed-off-by: vladmandic <mandic00@live.com>
2026-03-20 08:14:01 +01:00
vladmandic 121c51289b patch lora
Signed-off-by: vladmandic <mandic00@live.com>
2026-03-13 12:02:27 +01:00
Vladimir Mandic e5c494f999 cleanup logger 2026-02-19 11:09:13 +01:00
Vladimir Mandic a3074baf8b unified logger 2026-02-19 09:46:42 +01:00
Vladimir Mandic bfe014f5da modernize typing 2026-02-19 09:15:37 +01:00
vladmandic 947dd7b2b3 support lora inside prompt selector
Signed-off-by: vladmandic <mandic00@live.com>
2026-01-25 09:49:36 +01:00
vladmandic bfbe4af598 fix lora load
Signed-off-by: vladmandic <mandic00@live.com>
2026-01-21 08:45:45 +01:00
Vladimir Mandic e7809b11cd reapply offload hooks on diffusers lora load
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-01-13 10:07:30 +00:00
Vladimir Mandic ff772003e3 lora: restore pipeline type if reload/recompile needed
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-11-13 09:56:36 -05:00
Vladimir Mandic ba270db6ad separate settings for lora fuse
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-11-08 11:08:06 -05:00
Vladimir Mandic 526472a921 add chronoedit prequants and lora loading
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-10-31 11:08:27 -04:00
Vladimir Mandic d71d540a62 allow lora specifier to select model component. see changelog/wiki for docs on how to.
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-09-23 15:25:13 -04:00
Vladimir Mandic 16670636d7 fix lora with nested pipeline
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-09-11 09:03:02 -04:00
Disty0 afbc2d2a72 Fix OpenVINO loras 2025-09-03 21:10:45 +03:00
Vladimir Mandic fc547a3ccd sdnq with diffusers lora loader
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-08-18 10:29:01 -04:00
Vladimir Mandic e8b5ea3847 major refactor: remove backend original
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-07-05 13:16:46 -04:00
Enes Sadık Özbek e91208bea9 Merge branch 'dev' into feature/chroma-support 2025-06-26 17:02:00 +03:00
Vladimir Mandic 7380c08f8e lint fix
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-06-26 06:51:59 -04:00
Enes Sadık Özbek 21bdde12d3 Merge branch 'dev' into feature/chroma-support 2025-06-26 01:56:34 +03:00
Enes Sadık Özbek 4b3ce06916 Initial support for Chroma 2025-06-18 00:38:17 +00:00
Enes Sadık Özbek 3868a9184b Fix incorrectly reported lycoris load error 2025-06-07 00:36:08 +03:00
Vladimir Mandic ff649291b5 lint fixes
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-28 10:55:21 -04:00
AI-Casanova d14b54efa3 Preliminary support for sd1.5/sdxl OMI lora 2025-04-27 16:53:22 -05:00
Vladimir Mandic f00824e7b5 add SD_LORA_DUMP
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-25 09:54:43 -04:00
Vladimir Mandic bcb7b24bf2 cleanup video tab
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-23 13:46:50 -04:00
Vladimir Mandic a9969491ff fix hidream loader
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-22 11:04:35 -04:00
Vladimir Mandic 8d6c7510c2 fix lora
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-18 07:34:12 -04:00
Vladimir Mandic eaf37055ba nunchaku lora support
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-17 11:45:37 -04:00
Vladimir Mandic 984aa8ec55 lint fixes
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-08 16:31:51 -04:00
Vladimir Mandic 84a24fb681 lora restore weights to orig device on apply
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-07 07:49:18 -04:00
Vladimir Mandic 8725cfc488 lora obey device
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-03 14:31:39 -04:00
Vladimir Mandic 6430f7006f add monitor cli option and finish lora refactor
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-01 13:39:47 -04:00
Vladimir Mandic b5031a5eba lora modularize code
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2025-04-01 13:39:47 -04:00