xKandinskySR
Fully local Kandinsky ImageSR 2.0 nodes for ComfyUI (BF16 and GGUF, no Hub access).
ComfyUI-xKandinskySR
Fully local ComfyUI nodes for Kandinsky-ImageSR-2.0 — BF16 and GGUF, single image or whole folder, zero network access.
No Hugging Face Hub lookup, no repo-id resolution, no model_info request. Everything is read from disk.
The node pack is self-contained and does not depend on the official kandinsky-imagesr nodes; both can be installed side by side.
Features
- 100% offline — model paths are plain local directories, never remote repo ids.
- BF16 and GGUF — model type is auto-detected from the bundle contents, no extra switch.
- Single image or folder batch — the folder loader emits a true list, so every image keeps its native resolution.
- Exact scaling —
x2on a 768×512 image gives exactly 1536×1024. No aspect-ratio mangling. - Interruptible — safe to cancel mid-run, including during the tile loops inside the pipeline.
- Isolated runtime — vendored inference code lives in its own package namespace, so it does not shadow
diffusers,transformersor any other installed module.
Nodes
| Node | Purpose |
|---|---|
| xKandinskySR · 加载图像 | Load a single image from ComfyUI's input folder (native upload widget). |
| xKandinskySR · 加载文件夹 | Load every image in a folder as a list; each item keeps its original size. |
| xKandinskySR · 加载模型(本地) | Load a local BF16 or GGUF bundle from models/xkandinsky_sr/. |
| xKandinskySR · Upscale | Upscale an image with scale, creativity and alpha_mode. |
Category in the node menu: xKandinskySR.
Installation
Option A — ComfyUI Manager. Search for xkandinsky-sr in the Manager and install it, or run:
comfy node install xkandinsky-sr
Option B — manual clone.
cd ComfyUI/custom_nodes
git clone https://github.com/zpmljzzc/ComfyUI-xKandinskySR.git
Install the dependencies into the same Python environment ComfyUI uses:
python -m pip install -r ComfyUI-xKandinskySR/requirements.txt
On the Windows portable build
pythonis not onPATH; usepython_embeded\python.exe -m pip install -r ...from the ComfyUI root instead.
torch,diffusers,transformers,accelerate,numpyandPillowalready ship with ComfyUI, so pip will usually report them as satisfied. The ones most likely to be missing aregguf(required for GGUF bundles) andomegaconf.
Restart ComfyUI. The four nodes appear under the xKandinskySR category.
Then place your model bundles in ComfyUI/models/xkandinsky_sr/ — see Model Installation below.
Model Installation
Create the model folder inside ComfyUI's models directory:
ComfyUI/models/xkandinsky_sr/
Put one complete Diffusers bundle per sub-folder. The loader scans this directory and lists every child folder that contains a model_index.json.
Required layout
ComfyUI/models/xkandinsky_sr/
├── Kandinsky-ImageSR-2.0-BF16/
│ ├── model_index.json
│ ├── transformer/
│ │ ├── config.json
│ │ └── diffusion_pytorch_model.safetensors
│ └── vae/
│ ├── config.json
│ └── diffusion_pytorch_model.safetensors
└── Kandinsky-ImageSR-2.0-GGUF/
├── model_index.json
├── Kandinsky-ImageSR-2.0-x1-Q8_0.gguf ← .gguf at bundle root
├── transformer/
│ └── config.json
└── vae/
├── config.json
└── diffusion_pytorch_model.safetensors
Rules that actually matter
model_index.jsonmust exist in the bundle root. Without it the folder is not listed in the dropdown.- A
.gguffile alone is not enough. The GGUF file only contains transformer weights; the VAE and all configs still come frommodel_index.json,transformer/config.jsonandvae/. Copy the whole bundle, never just the.gguf. - Put the
.ggufat the bundle root, not insidetransformer/. That is how the loader detects GGUF. - The
vae/weights are always required, for both BF16 and GGUF. - Restart ComfyUI after copying. The
model_namedropdown is populated at startup, so a new bundle will not appear until reload.
Where to copy from
If the models were downloaded through the Hugging Face cache, copy the snapshot folder itself (it already has the correct layout):
GGUF: %USERPROFILE%\.cache\huggingface\hub\models--kandinskylab--Kandinsky-ImageSR-2.0-GGUF\snapshots\<hash>\
BF16: %USERPROFILE%\.cache\huggingface\hub\models--kandinskylab--Kandinsky-ImageSR-2.0\snapshots\<hash>\
Copy the contents of the snapshot folder into models/xkandinsky_sr/Kandinsky-ImageSR-2.0-GGUF/ (or -BF16/). Do not nest one snapshot folder inside another.
Basic Usage
Ready-made workflows are in examples/ — drag either file onto the ComfyUI canvas:
examples/basic_single_image.json— single image. Pick your own file in the upload widget.examples/batch_folder.json— folder batch. Changedirectoryto your own path.
Single image
xKandinskySR · 加载图像
│ IMAGE
▼
xKandinskySR · Upscale ──► Save Image
▲
│ XKANDINSKY_IMAGE_SR_MODEL
xKandinskySR · 加载模型(本地)
- Pick an image in the
加载图像node's upload widget. - In
加载模型(本地), choose the bundle frommodel_nameand leavedeviceoncuda. - In
Upscale, setscale(x2orx4) andcreativity(default4). - Connect the result to Save Image.
Folder batch
xKandinskySR · 加载文件夹 ──► xKandinskySR · Upscale ──► Save Image
▲
xKandinskySR · 加载模型(本地)
Point directory at any folder. Images are queued one by one, each at its own native resolution, so mixed sizes in one folder are fine. Save Image appends an index suffix to keep filenames unique.
Useful options on the folder loader:
image_load_cap—0means all images; setNto process only the firstN.start_index— skip the first N sorted files.load_always— force a reload even when the folder contents are unchanged (by default the loader re-runs only when the file list changes).
Node Parameters
xKandinskySR · 加载模型(本地)
| Parameter | Description |
|---|---|
| model_name | Bundle folder under models/xkandinsky_sr/. BF16 vs GGUF is detected automatically. |
| device | cuda or cpu. cpu works but is extremely slow; use it only for testing. |
xKandinskySR · Upscale
| Parameter | Description |
|---|---|
| scale | x1, x2, x4 — exact output size is height × factor and width × factor. |
| creativity | 0–8, default 4. Lower values stay closer to the source pixels; higher values let the model invent more detail. Raise it when the result looks too smooth, lower it when it drifts from the original. |
| alpha_mode | Only relevant when the input actually has 4 channels. discard (default) drops alpha, white / black composite onto that background. The bundled loaders convert to RGB on the way in, so this option has no effect in the built-in chain — it exists so 4-channel input from other nodes does not crash the run. |
Notes
- Dependencies:
torch,diffusers,transformers,accelerate,numpyandPillowship with ComfyUI;ggufandomegaconfmay need installing. Do not install the upstreamkandinsky-image-srwheel — it pinshuggingface-hub<2and would silently downgrade an existing 2.x install. This pack sets a lower bound only, and 2.5.0 is verified working. The inference core is already vendored underxk_runtime/. - bf16 support is required for the BF16 bundle. On GPUs without native bf16, use the GGUF bundle instead.
- VRAM:
x2is comfortable on 8 GB.x4on large inputs allocates considerably more; if you hit an OOM, drop tox2, process in smaller batches, or switch to the Q8_0 GGUF. - Cached runs: ComfyUI caches execution results in memory. Re-running with identical inputs finishes in a fraction of a second and produces no new output — that is a cache hit, not a failure. Change any input, or restart ComfyUI, to force real work.
- Cancelling is supported at node level and inside the pipeline's tile loops, so a cancel takes effect promptly even on large batches.
Compatibility
Verified on Windows 11 with ComfyUI portable (Python 3.11.9, torch 2.14.1+cu126, diffusers 0.43.0): single image and folder batch, exact x1/x2 output size on mixed resolutions, 4-channel input from another node, cancelling mid-batch, fully local model loading, and running side by side with the official kandinsky-imagesr nodes.
Not yet verified: Linux, CPU-only mode, multi-GPU, and x4 stability on an 8 GB card.
Isolation guarantees: no sys.path or sys.modules mutation, no writes to Diffusers' global LOADABLE_CLASSES registry, and local_files_only=True on every load. The vendored core uses the private package name xk_runtime, so it cannot collide with an installed kandinsky_image_sr.
Credits
- Kandinsky-ImageSR-2.0 model weights — developed and released by Kandinsky Lab. This repository ships no weights; you supply your own copy, and the weights remain under Kandinsky Lab's own license.
kandinsky-image-srinference core (MIT) — the tiled diffusion pipeline underxk_runtime/is derived from Kandinsky Lab'skandinsky-image-srv1.1.1, Copyright (c) 2026 gen-ai-team. Modifications: repackaged into an isolated package namespace, manual pipeline assembly that never resolves remote repo ids, and interrupt checks injected into the tile loops. The original copyright notice is retained in LICENSE.- ComfyUI — node API, model folder registration and interrupt handling.
Author
Built by zpmljzzc (@zpmljzzc) — ComfyUI node layer, fully local model loading, list-based folder batching, and interrupt handling.
Issues and pull requests are welcome.
License
MIT — see LICENSE. The vendored inference core keeps its original copyright notice alongside this project's.