12 Commits

Author SHA1 Message Date
CalamitousFelicitousness 783b66c3be refactor(lora): offer unknown bare keys to the resolver
A bare key that matches no known prefix is parsed with the
bare-diffusers sentinel and handed to the resolver instead of being
dropped at parse time. The per-arch lists of bare diffusers prefixes are
gone, and a path that names no live module counts as unmapped.
2026-09-06 04:25:44 +01:00
CalamitousFelicitousness a2e6535b93 feat(krea2): publish the packed token layout
The transformer is the only site that knows every segment length, since the
pad to a multiple of 256 happens there and the text stream is padded to a
fixed 512 whatever the prompt. It now publishes the live runs of the mask, so
the selector pins the conditioning dense and drops the padding instead of
sparsifying the whole sequence. At 2048x2048 with a short prompt that is 6 of
264 key blocks per query row moved from pinned to dropped.
2026-08-28 12:40:23 +01:00
Vladimir Mandic aa8cd9980e lint
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-17 14:35:52 +02:00
Vladimir Mandic f75e38c4ef krea2 optional dense masking
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-17 10:18:32 +02:00
Vladimir Mandic c26149b80e krea2 add inpaint and detailer support
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-08-05 13:07:24 +02:00
CalamitousFelicitousness 1b8c94850f fix(lora): load official diffusers-format Krea 2 LoRAs
The Krea 2 transformer keeps checkpoint-style module names while the
official krea/Krea-2-LoRA releases are saved with upstream-diffusers
names, so all 264 modules failed to bind and the LoRAs silently did
nothing. Krea 2 is the only native-LoRA arch with an sdnext-owned
transformer, so its module names diverge from the diffusers ecosystem.

- native_adapter.resolve_group_targets consults the arch resolver first
  for passthrough prefixes, falling back to verbatim binding; a no-op
  for arches that load the diffusers class
- krea2_lora maps diffusers attn/ff/text_fusion/embedder names onto the
  checkpoint module tree; checkpoint-named LoRAs still bind verbatim
- add test/test-krea2-native-adapters.py
2026-07-16 01:30:55 +01:00
CalamitousFelicitousness b8cf912e4e feat(lora): run the full adapter family chain on every native arch
zimage, chroma, ernie and krea2 chained only lora/lokr/loha/oft while
flux2 and anima ran all eight families, so ia3/glora/norm/full files
(e.g. full-diff extractions with diff/diff_b keys) reported not loaded
on the short-chain arches. The generic family loaders are arch-agnostic;
wire the missing four into each chain.

- add ia3/glora/norm/full wrappers and chain entries to the four arch
  modules, with matching suffix/marker re-exports
- add a chain-level full-diff test per suite: zimage covers the legacy
  attention.out alias and the fused-qkv skip, chroma the proj rename,
  ernie the passthrough
2026-07-14 08:06:45 +01:00
CalamitousFelicitousness 6ac4c0e1a9 fix(krea2): resolve default guidance per variant instead of static 1.0
cfg=-1 means use the pipeline's own default. Krea2Pipeline serves both Base
and Turbo under one class, so a static signature default cannot fit both: Base
needs real guidance while the distilled Turbo runs guidance-free. Resolve the
unset default from is_distilled (Base 4.5, Turbo 1.0). Explicit cfg is passed
through unchanged.
2026-07-06 01:03:09 +01:00
CalamitousFelicitousness f9d2bbe080 fix(krea2): zero-fill dormant last.up/last.down residual branch
Base ships last.up all-zeros so the branch is a no-op; pre-branch
finetunes omit both keys. A zero_init_missing spec field zero-fills
them on load instead of falling back to the base transformer.
2026-07-05 18:05:13 +01:00
CalamitousFelicitousness e0b975810c fix(krea2): align cfg with standard convention
Switch to neg-anchored guidance gated on > 1 so cfg 1.0 means no CFG, matching SD3/SDXL/Flux. Default guidance_scale 1.0; reference cfg Turbo 1.0, Base 4.5.
2026-06-27 22:25:54 +01:00
Vladimir Mandic b0a887d3b8 lint/changelog/requirements
Signed-off-by: Vladimir Mandic <mandic00@live.com>
2026-06-26 09:35:33 +02:00
CalamitousFelicitousness 48fad8524e feat(krea2): add Krea 2 (K2) image model support
Krea 2 is a 12.9B single-stream flow-matching DiT trained from scratch, using a Qwen3-VL-4B text encoder and the Qwen-Image VAE. The transformer is vendored as a diffusers ModelMixin whose module tree mirrors the checkpoint, so weights load with no key conversion; the pipeline ports the reference encode, flow-matching denoise, and VAE decode. The text encoder is shared at runtime via the existing dedup registry, so Base and Turbo reuse one Qwen3-VL-4B copy.

Covers text-to-image, image-to-image, native LoRA, and the single-file UNET override. Also completes SD.Next's partial Qwen-Image VAE support (5D decode input and TAESD preview mapping) that K2 shares.
2026-06-23 04:41:54 +01:00