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.
This commit is contained in:
CalamitousFelicitousness
2026-06-23 01:03:06 +01:00
parent 3e1df229ba
commit 48fad8524e
21 changed files with 882 additions and 4 deletions
+2 -2
View File
@@ -130,8 +130,8 @@ def full_vae_decode(latents, model):
latents = latents + shift_factor
# check dims
if model.vae.__class__.__name__ in ['AutoencoderKLWan'] and latents.ndim == 4:
latents = latents.unsqueeze(2) # wan is __nhw
if model.vae.__class__.__name__ in ['AutoencoderKLWan', 'AutoencoderKLQwenImage'] and latents.ndim == 4:
latents = latents.unsqueeze(2) # video VAEs (wan, qwen-image) expect a frame axis
# handle quants
if getattr(model.vae, "post_quant_conv", None) is not None: