Instructions to use kandinskylab/Kandinsky-ImageSR-2.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use kandinskylab/Kandinsky-ImageSR-2.0 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("kandinskylab/Kandinsky-ImageSR-2.0", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Kandinsky ImageSR 2.0
A Diffusers bundle for native-resolution enhancement (×1) and ×2/×4 upscaling. The BF16 transformer includes precomputed zero-text conditioning and visual modulation for 26 timesteps. The transformer takes 7.39 GiB on disk.
Run the demo · GGUF Q8_0 · ComfyUI node
For video upscaling, see Kandinsky 6.0 Video Super-Resolution. Demo · Model · GitHub
Use with ComfyUI
Search for Kandinsky ImageSR 2.0 in ComfyUI Manager or run
comfy node registry-install kandinsky-imagesr. Restart ComfyUI and open the
example workflow from the ComfyUI setup guide. The loader
downloads this BF16 model on first use.
Inference
Install PyTorch for your CUDA version, then install the ImageSR runtime with support for baked visual modulation.
pip install "kandinsky-image-sr @ https://huggingface.co/kandinskylab/Kandinsky-ImageSR-2.0-GGUF/resolve/main/python/kandinsky_image_sr-1.1.1-py3-none-any.whl"
import torch
from kandinsky_image_sr import KandinskyImageSRPipeline
pipe = KandinskyImageSRPipeline.from_pretrained(
"kandinskylab/Kandinsky-ImageSR-2.0",
dtype=torch.bfloat16,
).to("cuda")
image = pipe("input.png", upscale_factor=1, creativity=4).images[0]
image.save("output.png")
Creativity ranges from 0 to 8 at each scale. Level 4 is the default.
| Scale | Default t |
Range |
|---|---|---|
| ×1 | 0.05 | 0.005–0.118 |
| ×2 | 0.15 | 0.07–0.30 |
| ×4 | 0.244 | 0.17–0.38 |
H100 inference time
Median of three warmed runs on H100 80 GB with a 1024 × 1024 input,
25% overlap, and one tile per call. Measurements used t = 0.025 at ×1 and
Creativity 4 at ×2 and ×4. The compiled column uses compiled DiT blocks, a
compiled VAE decoder, and FlashAttention-3. Timing excludes PNG export.
| Scale | Eager | Compiled |
|---|---|---|
| ×1 | 0.327 s | 0.172 s |
| ×2 | 2.86 s | 1.46 s |
| ×4 | 7.96 s | 4.04 s |
The compiled ×4 run peaked at 9.35 GiB of PyTorch VRAM. For ×4 from 2048 × 2048 to 8192 × 8192, a paired compiled BF16 run took 19.56 s on one H100 and 11.88 s on two H100s.
License
The transformer and pipeline use the MIT License. The bundled VAE comes
from the Apache-2.0-licensed black-forest-labs/FLUX.1-schnell release.
- Downloads last month
- 2,958