Instructions to use kandinskylab/Kandinsky-ImageSR-2.0-W4A8-ConvRot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use kandinskylab/Kandinsky-ImageSR-2.0-W4A8-ConvRot 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-W4A8-ConvRot", 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 W4A8 ConvRot
Official W4A8 transformer for Kandinsky ImageSR 2.0. It restores images at their input resolution (×1) and upscales ×2 or ×4, with Creativity levels 0–8. The Safetensors file is 2.28 GB (2.13 GiB).
The attention and feed-forward projections use 4-bit ConvRot weights and dynamic INT8 activations on the accelerated backends in Comfy Kitchen. The release keeps the original baked modulation tables, zero-text conditioning and BF16 FLUX.1 VAE.
Original model · INT8 ConvRot · GGUF Q8_0 · GitHub · Demo
Python
Use a CUDA-enabled PyTorch build for your GPU. Install the ImageSR runtime with the ConvRot extra.
pip install "kandinsky-image-sr[convrot] @ https://huggingface.co/kandinskylab/Kandinsky-ImageSR-2.0-W4A8-ConvRot/resolve/main/python/kandinsky_image_sr-1.1.3-py3-none-any.whl"
from huggingface_hub import hf_hub_download
from PIL import Image
from kandinsky_image_sr.quantization import load_quantized_pipeline
weights = hf_hub_download(
"kandinskylab/Kandinsky-ImageSR-2.0-W4A8-ConvRot",
"Kandinsky-ImageSR-2.0-W4A8-ConvRot.safetensors",
)
pipe = load_quantized_pipeline("kandinskylab/Kandinsky-ImageSR-2.0", weights, "cuda")
image = Image.open("input.png").convert("RGB")
pipe(image, upscale_factor=4, creativity=4).images[0].save("output.png")
The loader fetches the matching configuration and VAE from the original model and uses the local W4A8 transformer.
ComfyUI
Install the Kandinsky ImageSR node from source and install the convrot extra in ComfyUI's Python environment. Open the W4A8 workflow. Set model to kandinskylab/Kandinsky-ImageSR-2.0 and transformer_weights to the absolute path to the downloaded Safetensors file.
Performance
H100 80 GB HBM3, PyTorch 2.10.0+cu128, Comfy Kitchen 0.2.42, native PyTorch attention and the Triton ConvRot backend for W4A8. Input 1024 × 1024, Creativity 4, 25% tile overlap. Times are the median of three eager pipeline calls after a warm-up, excluding image export and model load.
| Scale | BF16 | W4A8 ConvRot | BF16 peak allocated | W4A8 peak allocated |
|---|---|---|---|---|
| ×1 | 0.34 s | 0.44 s | 10.97 GiB | 5.71 GiB |
| ×2 | 2.91 s | 3.78 s | 11.04 GiB | 5.77 GiB |
| ×4 | 8.13 s | 10.52 s | 11.22 GiB | 5.96 GiB |
Peak allocated VRAM is measured by PyTorch. The W4A8 run at ×4 reserved 7.06 GiB in the PyTorch allocator. Results on consumer GPUs depend on the backend, output size and available VRAM.
Output examples
Full-resolution crops at ×4 and Creativity 4. We checked six photos at ×1, ×2 and ×4. Fine textures can differ, especially on lettering and fur.
Source photos used for the displayed crops, all under CC BY 2.0. The images were resized, upscaled and cropped.
- Smiling Laughing Woman IMG 5086 by Steven Depolo.
- Shinjuku Kabukicho Tokyo by Marco Togni.
- Dog (2836856812) by Razvan Antonescu.
License
The transformer and the ImageSR pipeline are MIT-licensed. The separately loaded FLUX.1-schnell VAE is Apache-2.0.
- Downloads last month
- 192
Model tree for kandinskylab/Kandinsky-ImageSR-2.0-W4A8-ConvRot
Base model
kandinskylab/Kandinsky-ImageSR-2.0