Kandinsky-ImageSR-2.0-Prune-2.7B
Kandinsky-ImageSR-2.0-Prune-2.7B: kandinskylab's upscaler, pruned and healed. 44% less GPU memory for the weights (4.45 vs 8.01 GB), a 32% faster transformer (16% faster per picture), slightly more fine detail at ×2 and ×4 at the same fidelity (within 0.3 dB), with ComfyUI nodes for PyTorch and Apple MLX. New: an int8 version for GPUs with 8 to 12 GB of VRAM: half the file size (2.17 GB), about 2 GB less VRAM, and pictures that look the same as the full file's.
Kandinsky ImageSR 2.0 by kandinskylab is an outstanding image upscaler. A one-step diffusion model, it enhances a picture at its own size (×1) or upscales it ×2 and ×4, and redraws what a small or soft picture has lost (skin, hair, fur, foliage, brick, fabric) convincingly, in a single transformer pass per tile, deterministic and openly licensed (MIT). All the credit for what this model can do goes to kandinskylab: the architecture, the training, the data and the pipeline are theirs, and everything that follows is built on their work.
This repository only makes it lighter. Kandinsky-ImageSR-2.0-Prune-2.7B is the same model, pruned and healed: every one of its 50 transformer blocks keeps 12 of its 20 attention heads and half of its feed-forward layer, and the smaller model was then trained to reproduce the original until it looked as good. It runs the original's own pipeline with less memory and faster, and draws about as much fine detail at ×1 and more at ×2 and ×4. It is built on the latest official release (28 Nov 2026) and has its three modes: ×1, ×2 and ×4. This is the second upscaler I have pruned and healed, after SeedVR2-1.4B: ByteDance's SeedVR2-7B cut from 36 transformer blocks to 6 and healed by distillation, 2.69 GB instead of 15.35 GB.
Examples
Kandinsky-ImageSR-2.0-Prune-2.7B at ×4, 1:1 crops of its output: the portrait upscaled from 1440 × 1280 to 5760 × 5120, the other scenes from 2048 × 2048 to 8192 × 8192. One NVIDIA H200, bfloat16, the default creativity; nothing retouched. Click a picture to open it. Side by side with the official model: Results, and every scene in the detailed card.
At a glance
A pruned model is not a standard checkpoint. Its narrower blocks do not fit loaders made for the official model's shapes, so in ComfyUI it needs custom nodes, and they are provided in this repository for both runtimes: PyTorch (NVIDIA, Apple MPS, CPU) and Apple MLX, each with a ready-made workflow, in comfyui/ and also part of LVNodes. See Using it in ComfyUI.
| this model | official | ||
|---|---|---|---|
| transformer weights in GPU memory | 4.45 GB | 8.01 GB | 0.56× |
| the transformer, one 1024 px tile | 0.098 s | 0.144 s | 0.68× |
| a 2048 × 2048 picture → 8192 × 8192 (×4, 121 tiles) | 28.6 s | 34.1 s | 0.84× |
| fine detail, ×1 / ×2 / ×4 (official = 1.00) | 0.97 / 1.05 / 1.09 | 1.00 | the same at ×1, more at ×2 and ×4 |
| PSNR to the original, ×1 / ×2 / ×4 | 32.8 / 28.4 / 25.3 dB | 32.8 / 28.5 / 25.6 dB | within 0.3 dB |
One NVIDIA H200, PyTorch, bfloat16, as the ComfyUI nodes run it; the FLUX.1 VAE is the same in both. Fine detail: the finest luminance detail as a ratio to the official model's, on 16 test scenes from 512 px. PSNR: the 16 originals shrunk by 2 or 4 and upscaled back. Parameters: 2.7 B as kandinskylab's first release stores the model, 2.1 B as their latest does (how they are counted). Every measurement is in the detailed card.
In short: what was pruned, and how it was healed
- What was cut. In all 50 transformer blocks: 8 of the 20 attention heads (128 channels each) and half of the feed-forward units (10,240 → 5,120). Nothing else: the patch embedding, the output layer, the per-timestep tables and the FLUX.1 VAE are the original's, unchanged. The blocks' attention and feed-forward go from 3.93 B to 2.10 B weights.
- How the cut was chosen. By measurement on real input tiles: how much removing each head and each feed-forward unit changes the model's prediction (second-order importance), keeping those that matter most and refitting the weights right after them to carry what the removed ones did. Narrowing every block kept far more of the model than removing whole blocks.
- How it was healed. By distillation from the original: the pruned model learned to match the original's prediction, the states inside its blocks, and the amount of fine texture in every 64 px patch, on 11,498 tiles (10,000 FLUX.1 renders and the 800 DIV2K photos) at ×2 and ×4. 2,381 steps of 12 tiles (28,572 tiles), about five hours on one NVIDIA H200. The texture term is what keeps the pruned model from going soft.
- The result. On 16 test scenes it matches the original's fidelity to real pictures (within 0.3 dB PSNR at ×4) and draws at least as much of their fine detail as the official model, at ×1, ×2 and ×4, with 0.56× the transformer's memory and 0.68× its time.
Details: How it was pruned, How it was healed.
Files
| file | size | what it is |
|---|---|---|
kandinsky_imagesr_2.0_2.7B.safetensors | 4.26 GB | the transformer: every tensor under the official release's names, at the pruned shapes |
kandinsky_imagesr_2.0_2.7B_int8_convrot.safetensors | 2.17 GB | the same transformer with its block layers in int8, for GPUs with less VRAM: The int8 version |
config.json | 1 KB | its config: the official one (28 Nov 2026) with ff_dim 5120 and attention_heads 12 |
comfyui/ComfyUI-Kandinsky-ImageSR/ | 74 KB | ComfyUI nodes, PyTorch (CUDA, Apple MPS, CPU) |
comfyui/ComfyUI-Kandinsky-ImageSR-MLX/ | 83 KB | ComfyUI nodes, Apple MLX (Apple Silicon Macs) |
comfyui/kandinsky_imagesr_2.7B_upscale_image.json | 6 KB | ready-made workflow, PyTorch nodes |
comfyui/kandinsky_imagesr_2.7B_upscale_image_int8.json | 6 KB | ready-made workflow, PyTorch nodes, the int8 file |
comfyui/kandinsky_imagesr_2.7B_upscale_image_mlx.json | 5 KB | ready-made workflow, MLX nodes |
training/ | the heal trainer and the export to this file | |
LICENSE, NOTICE | MIT, with the original's copyright notice; what this derives from | |
assets/ | the 16 test inputs, both models' upscales, comparison sheets | |
DETAILED-README.md | the detailed card |
The VAE is not in this repository. The model works in FLUX.1's latent space with FLUX.1's own VAE, unmodified: the
ae.safetensors of black-forest-labs/FLUX.1-schnell
(Apache-2.0), the same weights the official release bundles as vae/. ComfyUI users who run FLUX.1 already have it in
models/vae/. Black Forest Labs' repository is gated (a login and their terms first); Comfy-Org hosts the same file,
byte for byte, without the gate — Comfy-Org/z_image_turbo — and the workflows download it from there.
Using it in ComfyUI
Two node sets, one for each runtime, both made for this release and also part of LVNodes:
| PyTorch | Apple MLX | |
|---|---|---|
| node set | comfyui/ComfyUI-Kandinsky-ImageSR/ | comfyui/ComfyUI-Kandinsky-ImageSR-MLX/ |
| runs on | NVIDIA (CUDA), Apple MPS, CPU | Apple Silicon Macs |
| nodes | Kandinsky ImageSR Model → Kandinsky ImageSR Upscale | Kandinsky ImageSR Model (MLX) → Kandinsky ImageSR Upscale (MLX) |
| VAE | ComfyUI's Load VAE with ae.safetensors | ae.safetensors, picked in the model node |
| extra Python packages | none (ComfyUI's own torch, numpy, safetensors) | LVNodes' MLX environment, set up by the first run (about 1.3 GB, once) |
| workflow | comfyui/kandinsky_imagesr_2.7B_upscale_image.json | comfyui/kandinsky_imagesr_2.7B_upscale_image_mlx.json |
1. The files. kandinsky_imagesr_2.0_2.7B.safetensors into ComfyUI/models/diffusion_models/, and FLUX.1's VAE
ae.safetensors into
ComfyUI/models/vae/ if you don't have it already. Both workflows offer the two downloads in ComfyUI's
missing-models dialog when the files are missing: the model from this repository, the VAE from Comfy-Org's copy.
2. The nodes. PyTorch: copy comfyui/ComfyUI-Kandinsky-ImageSR/ into ComfyUI/custom_nodes/ (already using
LVNodes: into custom_nodes/LVNodes/). MLX: the node set runs inside LVNodes, in its MLX environment; install
LVNodes, or copy
comfyui/ComfyUI-Kandinsky-ImageSR-MLX/ into the custom_nodes/LVNodes/ you already have. Restart ComfyUI.
3. The workflow. Drag the workflow onto ComfyUI, pick your picture in Load Image, set upscale_by to 1, 2 or 4, run.
The MLX workflow in ComfyUI on a Mac, set to ×4: the freckled test portrait, 576 × 512, upscaled to 2304 × 2048. Click for full size.
| setting | what it does |
|---|---|
upscale_by | 1 (enhance at the same size), 2 or 4. For ×8, chain two Upscale nodes (×4, then ×2). |
creativity | 0–8, how much the model redraws (its timestep). 4 is the release's default: t 0.05 at ×1, 0.15 at ×2, 0.244 at ×4; lower stays closer to the input, higher draws more new detail. |
overlap | how much neighbouring tiles share, 0.25 as the release. |
precision | PyTorch: bfloat16 (default, the release's own), float16 for GPUs without bfloat16, float32. MLX: float16 (default, the fastest on Apple GPUs), bfloat16, float32. |
There is no seed and no noise: the same picture and settings give the same result. The official 4.5B model runs in
both node sets too: download kandinskylab/Kandinsky-ImageSR-2.0
into ComfyUI/models/diffusion_models/Kandinsky-ImageSR-2.0/ and pick that folder as the model (with the MLX nodes, its
VAE can come "from the model folder"). Each block's width is read from the weights, so both models load the same way.
Installed the nodes before 30 Nov 2026? Copy the folder again. On ComfyUI v0.16 or later the PyTorch nodes now run up to twice as fast: that version's dynamic VRAM loaded the whole transformer again for every tile. Now the transformer is loaded once and kept on the GPU when it fits beside a tile's VAE work (an RTX 4090, ×2 from 1920 × 1080: 0.97 → 0.48 s a tile), and ComfyUI streams it when it does not (an RTX 3090 with ComfyUI planning for about 8.6 GB: 1.61 → 1.19 s). The pictures are the same either way. The node makes this choice once, when the model first loads, from what ComfyUI reports then, and keeps it while the model stays loaded; if another program takes GPU memory later, restart ComfyUI so it can choose again. The nodes also run on ComfyUI releases older than v0.18 now, and they read the int8 file.
The int8 version
kandinsky_imagesr_2.0_2.7B_int8_convrot.safetensors (2.17 GB) is the same model for GPUs with less VRAM:
the 300 layers of its blocks (attention and feed-forward) stored in int8, in Comfy-Org's int8_convrot format, everything
else as in the full file. Put it in ComfyUI/models/diffusion_models/ and run the PyTorch nodes with
comfyui/kandinsky_imagesr_2.7B_upscale_image_int8.json, which offers the download.
Which file?
| your GPU | the file to use |
|---|---|
| 8 GB of VRAM (e.g. RTX 3060 Ti, 3070, 4060; RX 6600, 7600) | int8. The full file and FLUX.1's VAE don't fit together there, so ComfyUI has to stream the full file (or, before v0.16, move part of it out and back for every tile); the int8 file needs about 2 GB less |
| 10–12 GB (e.g. RTX 3080, 3060 12 GB, 4070; RX 6700 XT, 7700 XT) | int8, above all beside other models in the same workflow; the full file fits on its own |
| 16 GB or more | either: int8 is a little faster (1.2× per tile on an RTX 4090) and leaves 2 GB free |
| Apple Silicon Mac | the full file: Macs have no int8 product, so the int8 file runs at the full file's speed and memory |
The memory saving is the file's own, so it holds on any GPU the PyTorch nodes run on, AMD included. The speed figures are from an NVIDIA RTX 4090; I have not tested an AMD card.
| full file | int8 | |
|---|---|---|
| 1920 × 1080 → 3840 × 2160 (×2, 15 tiles) | 0.48 s a tile | 0.41 s a tile |
| GPU memory in use | 7.4 GiB | 5.5 GiB |
| PSNR to the full file's pictures, ×1 / ×2 / ×4 | 55.6–60.4 / 51.9–58.4 / 48.4–56.3 dB | |
| fine detail (the full file = 1.00) | 1.00 |
One RTX 4090, ComfyUI v0.46.4, the PyTorch nodes in bfloat16, the default creativity, three of the test scenes. GPU memory: everything in use on the card (nvidia-smi).
With less memory, ComfyUI streams the transformer: on an RTX 3090 with ComfyUI planning for about 8.6 GB
(--reserve-vram 16), 1.04 s a tile for the int8 file against 1.19 s for the full file.
Its speed comes from ComfyUI's own int8 kernels, in ComfyUI v0.27 or later. The node checks at load that they reproduce the stored weights; otherwise (an older ComfyUI, another GPU) it runs the int8 layers itself, with the memory saving and about the full file's speed. Side by side at 1:1 its pictures cannot be told from the full file's. On a Mac, use the full file: the MLX nodes load the int8 file, but at the full file's speed and memory. Details: The int8 version.
Using it in your own code
The comfyui/ node sets hold two complete implementations of the official pipeline, PyTorch (ksr_torch.py) and MLX
(ksr_mlx/), with no dependency beyond torch / MLX, numpy and safetensors. ksr_torch.py works on its own, with any
FLUX.1 VAE; for instance diffusers' (pip install diffusers):
import sys, numpy as np, torch
from PIL import Image
from diffusers import AutoencoderKL
sys.path.insert(0, "comfyui/ComfyUI-Kandinsky-ImageSR")
import ksr_torch as K
dev = "cuda" # or "mps", "cpu"
model = K.load_transformer("kandinsky_imagesr_2.0_2.7B.safetensors", "bfloat16").to(dev).eval()
vae = AutoencoderKL.from_pretrained("kandinskylab/Kandinsky-ImageSR-2.0", subfolder="vae",
torch_dtype=torch.bfloat16).to(dev).eval()
f = 4 # 1, 2 or 4
t = K.resolve_t(f, creativity=4) # 0.244 at x4, 0.15 at x2, 0.05 at x1
ti = torch.tensor([K.t_index(t, model.baked)], device=dev)
def encode(px): # (1, 1024, 1024, 3) in 0..1 -> the pipeline's latent
x = px.permute(0, 3, 1, 2).to(dev, torch.bfloat16) * 2 - 1
return vae.encode(x).latent_dist.mean.float() * K.VAE_SCALE
def step(z): # one transformer pass: the velocity
return model(z.to(dev), ti).float()
def decode(z): # the corrected latent -> (1, 1024, 1024, 3) in 0..1
px = vae.decode((z / K.VAE_SCALE).to(dev, torch.bfloat16)).sample.float()
return ((px.clamp(-1, 1) + 1) / 2).permute(0, 2, 3, 1)
img = torch.from_numpy(np.asarray(Image.open("photo.png").convert("RGB"), np.float32) / 255)
with torch.inference_mode():
out = K.upscale_image(img, f, t, step, encode, decode) # tiles, blending, crop: the whole pipeline
Image.fromarray((out.clamp(0, 1) * 255 + 0.5).byte().numpy()).save("photo_x4.png")
K.load_transformer also takes the official release's folder, for the 4.5B model. The architecture and the pipeline step by step: Using it in your own code.
Results
Every sheet: left the 2.7B, middle the official model, right a plain bicubic enlargement (the ground-truth sheet puts the original first). All from one NVIDIA H200 in bfloat16, at the default creativity. Click a picture for the full-resolution sheet.
512 → 2048 (×4), the whole picture:
512 → 2048 (×4), the spider on its dewy web at 1:1:
512 → 2048 (×4), swirling oil paint at 1:1:
512 → 2048 (×4), a brick wall at 1:1:
1440 × 1280 → 5760 × 5120 (×4), freckles at 1:1:
Against the original: the fox shrunk to 512 px and upscaled ×4 back to 2048:
All 30 sheets — ×1, ×2 and ×4, from 512 px and from 2048 px, and against the originals — are in Results.
Known limitations
- Its own texture, not the official model's. Both models invent the fine detail an upscale needs, and the 2.7B draws it its own way: more of it, but not the same pixels. If you need the official model's exact output, use the official model.
- Barely resolved features are drawn each model's own way. Where the input hardly shows a feature, the two models can draw different amounts of it, as the freckles of the portrait at 576 × 512 show (crop).
- ×1, ×2 and ×4, as the official model: for ×8, run ×4 and then ×2.
More in Known limitations.
Credits and licence
Base model: kandinskylab/Kandinsky-ImageSR-2.0, its
transformer and pipeline code released under the MIT License. This is a derivative of it (pruned and further trained),
released under the same MIT License; LICENSE carries the original copyright notice. The FLUX.1 VAE it uses is
black-forest-labs/FLUX.1-schnell's (Apache-2.0) and is not
redistributed here. The training data: jackyhate/text-to-image-2M
and DIV2K.
All the credit for the model itself, what it sees and what it draws, goes to kandinskylab.
Detailed card
DETAILED-README.md holds the details:
- 2.7 B or 2.1 B? How the parameters are counted — the two counts, and why the name says 2.7B
- Files — what is in the file, and how it is built on kandinskylab's latest release
- Using it in ComfyUI — both node sets, every setting, the official model in them, how closely the ports follow the reference
- Using it in your own code — the architecture's shapes and the pipeline step by step
- How it was pruned — the measured cut and the shapes it was chosen against
- How it was healed — the data, the three-term loss, the training run, the checkpoints, and ×1
- Quality — against the original pictures and against the official model, every set
- Memory and time — the H200 measurements, tile by tile and picture by picture
- The int8 version — its format, how the nodes run it, the RTX 4090 measurements, and why not fp8
- Known limitations
- Results — all 30 comparison sheets
- Reproducing the evaluation images — the 16 scenes, their prompts and seeds
- Repository layout