mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user