Instructions to use kandinskylab/Kandinsky-ImageSR-2.0-Diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use kandinskylab/Kandinsky-ImageSR-2.0-Diffusers 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-Diffusers", 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 (Diffusers)
Kandinsky ImageSR 2.0 in the native Diffusers format. One transformer enhances an image at its original resolution (Γ1) or upscales it Γ2 or Γ4 in a single flow step. Creativity levels 0β8 trade fidelity for synthesized detail; level 4 is the default.
The weights are the same as in kandinskylab/Kandinsky-ImageSR-2.0; only the configs differ.
import torch
from diffusers import KandinskyImageSRPipeline
from diffusers.utils import load_image
pipe = KandinskyImageSRPipeline.from_pretrained(
"kandinskylab/Kandinsky-ImageSR-2.0-Diffusers", dtype=torch.bfloat16
).to("cuda")
image = load_image("input.png")
pipe(image, upscale_factor=4, creativity=4).images[0].save("output.png")
| Scale | Creativity range (t) |
Default (level 4) |
|---|---|---|
| Γ1 | 0.005β0.118 | 0.05 |
| Γ2 | 0.07β0.30 | 0.15 |
| Γ4 | 0.17β0.38 | 0.244 |
Choose lower levels for fine text and details you want to preserve. Inputs are treated as sRGB.
Quantized transformer: GGUF Q8_0 β load it with
KandinskyImageSRTransformer3DModel.from_single_file and pass the transformer to this pipeline.
The code and model use the MIT License. The bundled VAE comes from the Apache-2.0-licensed
black-forest-labs/FLUX.1-schnell release.
- Downloads last month
- 33
Model tree for kandinskylab/Kandinsky-ImageSR-2.0-Diffusers
Base model
kandinskylab/Kandinsky-ImageSR-2.0