Kandinsky Image Super-Resolution 2.0 as a Diffusers bundle. A single set of transformer
weights serves both x2 and x4. The release uses pre-baked zero-text conditioning: the
text tower and all 50 cross-attention layers are replaced by small per-timestep Safetensors
tables.
This repository contains all components needed for inference with from_pretrained.
# install torch built for your CUDA first; replace cu128 with the index URL for your driver
pip install torch --index-url https://download.pytorch.org/whl/cu128
pip install git+https://github.com/kandinskylab/kandinsky-image-sr.git
The pipeline uses the Kandinsky 5 transformer included in Diffusers 0.41 or newer.
import torch
from kandinsky_image_sr import KandinskyImageSRPipeline
pipe = KandinskyImageSRPipeline.from_pretrained(
"kandinskylab/Kandinsky-ImageSR-2.0",
dtype=torch.bfloat16,
).to("cuda")
result = pipe(
"input.png",
upscale_factor=4,
# Optional. Defaults: x2=0.15, x4=0.244.
one_step_t=0.244,
)
result.images[0].save("output.png")
For calibrated UI controls, creativity accepts levels 0..8 at x2 and x4; level 4
corresponds to the default t. The release accepts the defaults and the 18 creativity
values listed in its config; other raw one_step_t values are not supported.
| Factor | Default t |
Calibrated creativity range |
|---|---|---|
| x2 | 0.15 | 0.07–0.30 |
| x4 | 0.244 | 0.17–0.38 |
The model processes 1024-pixel output tiles and blends overlaps with boundary-aware Hanning windows. Small inputs are replicate-padded and cropped back to the exact requested size.
Measured on an NVIDIA H100 80GB (SXM) with square images: bfloat16, torch 2.13.0 (CUDA 12.9),
default settings (tile_batch_size=1). Each time is the median of 5 full pipe(...) calls
after 2 warm-up calls.
| Input resolution | Upscale | Output resolution | Tile grid | Time per image |
|---|---|---|---|---|
| 1K (1024 × 1024) | ×2 | 2K (2048 × 2048) | 3 × 3 | 2.78 s |
| 1K (1024 × 1024) | ×4 | 4K (4096 × 4096) | 5 × 5 | 7.80 s |
| 2K (2048 × 2048) | ×2 | 4K (4096 × 4096) | 5 × 5 | 7.84 s |
| 2K (2048 × 2048) | ×4 | 8K (8192 × 8192) | 11 × 11 | 37.5 s |
| 4K (4096 × 4096) | ×2 | 8K (8192 × 8192) | 11 × 11 | 37.7 s |
Reproduce with scripts/test.py from the GitHub repository:
CUDA_VISIBLE_DEVICES=0 python scripts/test.py --image photo.jpg --backend native
The transformer and pipeline code are released under the MIT License, consistently with
Kandinsky 5. The bundled VAE is sourced from the Apache-2.0-licensed
black-forest-labs/FLUX.1-schnell release.
transformer/diffusion_pytorch_model-00002-of-00003.safetensors 5.0 GBtransformer/diffusion_pytorch_model-00001-of-00003.safetensors 5.0 GBtransformer/diffusion_pytorch_model-00003-of-00003.safetensors 268 MBvae/diffusion_pytorch_model.safetensors 168 MB