ComfyUI-FL-KandinskySR
Kandinsky ImageSR 2.0 one-step x2/x4 image super-resolution for ComfyUI, with automatic model download
FL Kandinsky SR
One-step x2 and x4 image super-resolution for ComfyUI, powered by Kandinsky ImageSR 2.0. A single 4.5B Kandinsky 5 transformer serves both factors; its text tower and cross-attention are pre-baked into small per-timestep tables, so there is no prompt and no text encoder. Each 1024 px output tile is encoded with the FLUX VAE, corrected in one step and decoded.


Features
- x2 and x4 upscaling - Any
IMAGEin, any size; batches are upscaled image by image - Automatic model download - The loader fetches the pinned checkpoint from Hugging Face on first run
- No extra dependencies - The transformer is reimplemented on ComfyUI's own torch and attention; Diffusers is not needed
- ComfyUI memory management - The model loads and offloads through ComfyUI's model manager
- Seamless tiling - 1024 px output tiles blended with boundary-aware Hanning windows, as in the reference pipeline
- Creativity control - The model's nine calibrated strengths per factor
- Optional torch.compile - About 30% faster transformer after a short one-time compile
Nodes
| Node | Description | |------|-------------| | FL Kandinsky SR Model Loader | Downloads (if needed) and loads the transformer and FLUX VAE | | FL Kandinsky SR Upscale | Upscales images x2 or x4 |
Installation
cd ComfyUI/custom_nodes
git clone https://github.com/filliptm/ComfyUI-FL-KandinskySR.git
cd ComfyUI-FL-KandinskySR
pip install -r requirements.txt
Or search for ComfyUI-FL-KandinskySR in ComfyUI Manager.
Models
On first execution, FL Kandinsky SR Model Loader downloads kandinskylab/Kandinsky-ImageSR-2.0 into ComfyUI/models/kandinsky_sr/Kandinsky-ImageSR-2.0:
| Folder | Size |
|------|------|
| transformer/ (3 shards) | 10.3 GB |
| vae/ (FLUX.1-schnell VAE) | 168 MB |
Disable download_if_missing to require files you placed there yourself. The folder can also be set with a kandinsky_sr: entry in extra_model_paths.yaml.
Quick Start
- Load the example workflow
examples/kandinsky_sr_upscale.json. - Pick an image in Load Image and choose
upscale_factor4 or 2. - Queue.
Settings
upscale_factor: 4 or 2. The model was trained for both.creativity(0 to 8, default 4): calibrated one-step strength. Lower stays closer to the input; higher invents more texture.overlap(default 0.25): tile overlap. More is smoother at the seams and slower.tile_batch_size(default 1): tiles processed together. The model is compute-bound, so larger batches only add VRAM.precision:bf16matches the reference;fp32doubles memory.attention:autofollows ComfyUI's attention setting;sdpaandsageforce one.torch_compile: needs Triton (triton-windowson Windows).
The model is deterministic: there is no noise, so there is no seed.
Performance
Measured on an RTX PRO 6000 Blackwell Max-Q (bf16, torch_compile on, model loaded):
| Input | Output | Tiles | Time | |---|---|---|---| | 256x256 | x4, 1024x1024 | 1 | 0.6 s | | 512x512 | x2, 1024x1024 | 1 | 0.7 s | | 512x512 | x4, 2048x2048 | 9 | 4.6 s | | 600x400 | x4, 2400x1600 | 6 | 3.4 s | | 1024x1024 | x2, 2048x2048 | 9 | 4.9 s | | 1024x1024 | x4, 4096x4096 | 25 | 10 s | | 2048x2048 | x2, 4096x4096 | 25 | 12 s |
- About 0.2 s of transformer time per tile, plus 0.25 s of VAE encode and decode. Without
torch_compilethe transformer takes about 0.28 s per tile. - Peak VRAM is about 13 GB at
tile_batch_size1 (9.8 GB of weights). Each extra tile in a batch adds about 2.5 GB.
Requirements
- NVIDIA GPU with bf16 support (RTX 30 series or newer), 16 GB VRAM recommended
- Python 3.10+
Credits
- Kandinsky ImageSR 2.0 by Kandinsky Lab
- The transformer in
modules/transformer.pyis reimplemented from the upstream code and the Diffusers Kandinsky 5 layers; seeTHIRD_PARTY_NOTICES.md - Demo images from the scikit-image sample data (public domain / CC0)
License
MIT, matching the upstream Kandinsky ImageSR 2.0 code and weights. The bundled VAE is from FLUX.1-schnell (Apache-2.0).