Skip to content

Kandinsky 2.1

Model Source Revision Weight license Parity (CPU, fp32)
kandinsky-2-1 kandinsky-community/kandinsky-2-1 04b3666 Apache-2.0 Verified

Catalog: kandinsky-2 · Models: kandinsky-2-1 · Task: t2i

Architecture. A CLIP text model and PriorTransformer produce a CLIP-image embedding. The decoder separately encodes the prompt with a multilingual XLM-RoBERTa CLIP model, then combines its token states and pooled text embedding with the image embedding in a text-image-conditioned U-Net. An UnCLIP scheduler drives the prior, DDIM drives the decoder, and MoVQ decodes the latents.

Usage.

python -m imagehub.pretrained kandinsky-2-1 checkpoints/kandinsky-2-1
from imagehub import pipeline
with pipeline("t2i", backend="kandinsky-2-1", model="checkpoints/kandinsky-2-1", device="mps") as pipe:
    result = pipe("a cat, oil painting", seed=42)
    result.images[0].save("cat.png")

Settings. The prior defaults to 25 steps and guidance 4.0; the decoder defaults to 100 steps, guidance 4.0 and 512×512 output. Supported options are steps, guidance, prior_steps, prior_guidance, width, height, seed, negative_prompt and prior latents. Unrecognized settings raise an error before weights are loaded.

Seed compatibility. The tiny CPU float32 pipeline is bit-identical to diffusers for guidance on and off, an explicit negative prompt, non-square output and two seeds, and so is the real-checkpoint pipeline (all 4 real-checkpoint tests; validation). MPS and CUDA runs are smoke tests only.

Out of scope. Image-to-image, inpainting, interpolation, ControlNet, safety checking, watermarking and fp16/bfloat16 parity are not supported.

License. The decoder and prior weights use the Apache-2.0 license. imagehub does not distribute weights.