mirror of
https://github.com/vladmandic/automatic
synced 2026-09-02 02:50:47 +02:00
48fad8524e
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.
9 lines
460 B
Python
9 lines
460 B
Python
from pipelines.krea2.transformer_krea2 import Krea2Transformer2DModel
|
|
from pipelines.native_transformer import TransformerSpec
|
|
|
|
|
|
# Checkpoint keys are bare (`first.`, `blocks.N.`, `txtfusion.`, ...) and the transformer's
|
|
# module tree mirrors them exactly, so no state-dict conversion is needed. The model has no
|
|
# rope/pos buffers, so the default acceptable-missing set is sufficient.
|
|
KREA2_SPEC = TransformerSpec(cls=Krea2Transformer2DModel, converter=None)
|