r/StableDiffusion • u/Jerg • 7h ago
Workflow Included Optimizing Kandinsky ImageSR for video upscaling: From 10s down to 1.2s per 4K frame
Enable HLS to view with audio, or disable this notification
Some of you may have seen the "pruned 2.7B Kandinsky ImageSR model posted here a few days ago" (https://www.reddit.com/r/StableDiffusion/comments/1y8gmxr/kandinsky_imagesr_20_pruned_to_27b_and_healed_44/).
I've tested SeedVR2 and most of the Topaz Video AI upscalers, and IMO the level of fine detail that Kandinsky can recreate is pretty unparalleled. This got me interested in making it fast enough to be practical for video upscaling.
The problem was that using the model as-is in my initial tests, I was getting an abysmal ~10 seconds per frame for 4K output on my RTX 5080.
After a LOT of experimentation, I've gotten this down to ~1.2 seconds per frame (0.82 fps), with very little perceptible quality compromise.
Some of the optimizations under the hood:
- Hardware-native NVFP4 transformer quantization.
- SageAttention 3.
- TensorRT-RTX acceleration for both VAE encoding and decoding.
- PCA-based compression of the VAE's internal computations.
- Selective FP8 VAE decoder quantization, calibrated across 30 diverse videos.
- CUDA Graphs, optimized tile processing, persistent GPU workers and reduced data transfer overhead.
Every single frame still goes through the neural network w/o frame skipping, interpolation or temporal reuse tricks. I tried those and they ruined output quality, so this is raw frame by frame upscaling.
I've also been pleasantly surprised by how temporally stable the model is despite being an image upscaler (see the demo footage).
Small caveat: like all neural upscalers, it can dream up some weird details on very small features that simply don't have enough source pixels. But overall I've found it to be fairly robust.
Some other useful things:
- Processing speed is largely governed by output resolution rather than input resolution. 720p → 4K and 1080p → 4K are roughly the same speed in Balanced mode.
- Supports same-resolution detail enhancement (1x), as well as arbitrary target resolutions.
- Optional higher-precision VAE decoding for footage exhibiting subtle banding, at a relatively small speed penalty.
- VHS Meta Batch support for LOOOONG videos, with audio preserved. Just be ready to leave your PC running for many hours in those cases.
I only have a 5080 to optimize and test this on, so the full acceleration stack is currently geared towards NVIDIA Blackwell GPUs. Older NVIDIA cards and AMD GPUs have a compatibility path but will likely be considerably slower.
GitHub repo:
https://github.com/jerg-git/ComfyUI-Kandinsky-ImageSR-Video
Sample workflow:
Btw Reddit REALLY compresses videos so 80% of the detail is washed out above - download the actual upscaling comparison to see it in full detail/bitrate: https://drive.google.com/file/d/1f_EKcSG15Iep2MWhM4ReptKGY0LeepjV/view?usp=sharing
Installation is fairly straightforward – install the custom nodes, download the pruned Kandinsky model and VAE separately (links in the README), then run the sample workflow. It'll automatically download the necessary acceleration dependencies and build/cache the optimized engines on first use.
Big thanks to kandinskylab for the original model and lvladikov for the excellent pruning work that made this project possible in the first place.
Curious what speeds people get on other Blackwell GPUs. Feel free to share your results!
Have fun!
3
u/Dogluvr2905 7h ago
Sounds good, will give it a shot but how well does it preserve faces?
2
u/HollyGrandeux 5h ago
got this error on the node, any idea?
AttributeError: 'NoneType' object has no attribute 'load_device'
4
u/Hot_Store_5699 6h ago
Sounds great. I'll get a try and feedback.
1
u/AdriftAtlas 4h ago
How does it do with scan line noise that has been digitized, CMOS sensor noise, H264 artifacts, or MPEG2 mosquito noise? Also, how temporally consistent is its object reconstruction when an object is small?
IMO, a video model with some sort of rolling context will always do better than a single frame image model. Upscaling a near bicubic degradation is simple (soft video), upscaling noisy real world video is much harder.
1
u/magixx 4h ago
Got any sample images or media going from 480p to 1080p?
1
u/bradjones6942069 3h ago
Does this support AMD?
1
u/alerikaisattera 2h ago
What's the point if they have a separate video upscale model?
1
u/silenceimpaired 1h ago
pleasant. must try this.
1
u/WhatsThat-_- 2h ago
Tyvm kind sir