Views
No views yet

1import torch
2from diffusers import Kandinsky5T2VPipeline
3from diffusers.utils import export_to_video
4
5# Load the pipeline
6model_id = "kandinskylab/Kandinsky-5.0-T2V-Pro-sft-5s-Diffusers"
7pipe = Kandinsky5T2VPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16)
8
9pipe = pipe.to("cuda")
10pipe.transformer.set_attention_backend("flex") # <--- Set attention bakend to Flex
11pipe.enable_model_cpu_offload() # <--- Enable cpu offloading for single GPU inference
12pipe.transformer.compile(mode="max-autotune-no-cudagraphs", dynamic=True) # <--- Compile with max-autotune-no-cudagraphs
13
14# Generate video
15prompt = "A cat and a dog baking a cake together in a kitchen."
16negative_prompt = "Static, 2D cartoon, cartoon, 2d animation, paintings, images, worst quality, low quality, ugly, deformed, walking backwards"
17
18output = pipe(
19 prompt=prompt,
20 negative_prompt=negative_prompt,
21 height=768,
22 width=1024,
23 num_frames=121, # ~5 seconds at 24fps
24 num_inference_steps=50,
25 guidance_scale=5.0,
26).frames[0]
27
28export_to_video(output, "output.mp4", fps=24, quality=9)@misc{kandinsky2025,
author = {Alexander Belykh and Alexander Varlamov and Alexey Letunovskiy and Anastasia Aliaskina and Anastasia Maltseva and Anastasiia Kargapoltseva and Andrey Shutkin and Anna Averchenkova and Anna Dmitrienko and Bulat Akhmatov and Denis Dimitrov and Denis Koposov and Denis Parkhomenko and Dmitrii and Ilya Vasiliev and Ivan Kirillov and Julia Agafonova and Kirill Chernyshev and Kormilitsyn Semen and Lev Novitskiy and Maria Kovaleva and Mikhail Mamaev and Mikhailov and Nikita Kiselev and Nikita Osterov and Nikolai Gerasimenko and Nikolai Vaulin and Olga Kim and Olga Vdovchenko and Polina Gavrilova and Polina Mikhailova and Tatiana Nikulina and Viacheslav Vasilev and Vladimir Arkhipkin and Vladimir Korviakov and Vladimir Polovnikov and Yury Kolabushin},
title = {Kandinsky 5.0: A family of diffusion models for Video & Image generation},
howpublished = {\url{https://github.com/kandinskylab/Kandinsky-5}},
year = 2025
}
@misc{mikhailov2025nablanablaneighborhoodadaptiveblocklevel,
title={$\nabla$NABLA: Neighborhood Adaptive Block-Level Attention},
author={Dmitrii Mikhailov and Aleksey Letunovskiy and Maria Kovaleva and Vladimir Arkhipkin
and Vladimir Korviakov and Vladimir Polovnikov and Viacheslav Vasilev
and Evelina Sidorova and Denis Dimitrov},
year={2025},
eprint={2507.13546},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2507.13546},
}