kandinsky-5

kandinskylabMIT活跃维护

Kandinsky 5.0 是一套文生视频与文生图的扩散模型家族,支持视频和图像生成,并带有蒸馏加速能力。

Kandinsky 5.0: A family of diffusion models for Video & Image generation

暂无版本844star77fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/kandinskylab/kandinsky-5.git
cd kandinsky-5
pip install -r requirements.txt
python download_models.py
硬件要求按 README 说明

README 提到 12GB 显存 GPU 可跑 5 秒生成,整条管线在 24GB 显存下配合 offloading 可运行;推荐在 NVIDIA Hopper GPU 上装 Flash Attention 3 提升性能。

需要 CUDA多卡 / 张量并行
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

Kandinsky 5.0 是开源扩散模型家族,用文本或图片生成视频与图像

Kandinsky 5.0 是一套文生视频与文生图的扩散模型家族,支持视频和图像生成,并带有蒸馏加速能力。

核心能力

  • 提供 Video Pro 19B 与 Video Lite 2B 两档视频模型
  • 支持 T2V、I2V、T2I、I2I 多种生成与编辑管线
  • 用 Qwen2.5-VL 与 CLIP 提供文本嵌入,HunyuanVideo 3D VAE 编解码
  • 支持 offload、Magcache、NF4 量化与多种注意力后端加速
  • 可多卡分布式推理,并已接入 diffusers 与 ComfyUI

容易踩的坑

需先运行 download_models.py 下载权重,否则无法推理;默认会下载全部模型,建议用 --models 指定;Flash Attention 3 需按官方说明单独安装,否则用 SDPA 等后端。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    In this repository, we provide a family of diffusion models to generate a video or an image given a textual prompt and/or image.

    https://github.com/user-attachments/assets/b06f56de-1b05-4def-a611-1a3159ed71b0

    Project Updates

    • 🔥 2025/12/12: Kandinsky 5.0 Video Pro is ranked as Top-1 open-source Text-to-Video model at LMArena.
    • 🔥 2025/12/03: our Kandinsky 5.0 Video Pro and Image Lite models are accepted to diffusers
    • 🔥 2025/11/26: our simplified LoRa training is available on kandinsky-5-lora-train
    • 🔥 2025/11/24: LoRas for Camera control is open-sourced: Lite LoRAs and Pro LoRAs. Inference code is avaibale in examples/inference_examples_i2v_lora.ipynb and examples/inference_examples_t2v_lora.ipynb
    • 🔥 2025/11/20: Kandinsky 5.0 Video Pro is open-sourced. T2V & I2V models are available.
    • 🔥 2025/11/15: Kandinsky 5.0 Lite I2V & Kandinsky 5.0 Lite T2I models are open-sourced.
    • 🔥 2025/10/19: Further VAE tiling optimization. NF4 version of Qwen2.5-VL from Bitsandbytes is supported. Flash Attention 2, Flash Attention 2, Sage Attention or SDPA can be selected for 5-seconds generation using option --attention_engine. Now generation should work on the GPUS with 12 GB of memory. Kandinsky 5 Video Lite is accepted to diffusers.
    • 🔥 2025/10/7: The ComfyUI README file has been updated. SDPA support has been added, allowing you to run our code without Flash attention. Magcache support for nocfg checkpoints has been added, allowing Magcache support for sft and nocfg checkpoints. Memory consumption in the VAE has been reduced, with the entire pipeline now running at 24 GB with offloading.
    • 🔥 2025/09/29: We have open-sourced Kandinsky 5.0 T2V Lite a lite (2B parameters) version of Kandinsky 5.0 Video text-to-video generation model. Released checkpoints: kandinsky5lite_t2v_pretrain_5s, kandinsky5lite_t2v_pretrain_10s, kandinsky5lite_t2v_sft_5s, kandinsky5lite_t2v_sft_10s, kandinsky5lite_t2v_nocfg_5s, kandinsky5lite_t2v_nocfg_10s, kandinsky5lite_t2v_distilled16steps_5s, kandinsky5lite_t2v_distilled16steps_10s contains weight from pretrain, supervised finetuning, cfg distillation and diffusion distillation into 16 steps. 5s checkpoints are capable of generating videos up to 5 seconds long. 10s checkpoints is faster models checkpoints trained with NABLA algorithm and capable to generate videos up to 10 seconds long.

    Community Works

    If your research or project builds upon Kandinsky 5, and you would like more people to see it, please inform us.

    • bghira/SimpleTuner now supports Kandinsky 5.0 LoRA and even full-rank training.
    • CacheDiT offers Fully Cache Acceleration support for Kandinsky-5 with DBCache, TaylorSeer and Cache CFG. Visit their example for more details.

    Table of Contents

    1. Kandinsky 5.0 Video Pro
    2. Kandinsky 5.0 Video Lite
    3. Kandinsky 5.0 Image Lite
    4. Kandinsky 5.0 Image Editing
    5. Quickstart & Run examples

    Kandinsky 5.0 Video Pro

    Kandinsky 5.0 Video Pro is a line-up of 19B models that generates high-quality HD videos from English and Russian prompts with controllable camera motion.

    We provide several Text-to-Video model variants, each optimized for different use cases:

    • SFT model — delivers the highest generation quality;

    • Pretrain model — designed for fine-tuning by researchers and enthusiasts.

    All models are available in two versions: for generating 5-second and 10-second videos.

    Additionally, we provide Image-to-Video model capable to generate video given input image and text prompt.

    Pipeline

    Latent diffusion pipeline with Flow Matching.

    Diffusion Transformer (DiT) as the main generative backbone with cross-attention to text embeddings.

    • Qwen2.5-VL and CLIP provides text embeddings.

    • HunyuanVideo 3D VAE encodes/decodes video into a latent space.

    • DiT is the main generative module using cross-attention to condition on text.

    Model Zoo

    Modelconfigvideo durationNFECheckpointLatency*
    Kandinsky 5.0 T2V Pro SFT 5s HDconfigs/k5_pro_t2v_5s_sft_hd.yaml5s100🤗 HF1241
    Kandinsky 5.0 T2V Pro SFT 10s HDconfigs/k5_pro_t2v_10s_sft_hd.yaml10s100🤗 HF-
    Kandinsky 5.0 T2V Pro SFT 5s SDconfigs/k5_pro_t2v_5s_sft_sd.yaml5s100🤗 HF560
    Kandinsky 5.0 T2V Pro SFT 10s SDconfigs/k5_pro_t2v_10s_sft_sd.yaml10s100🤗 HF1158
    Kandinsky 5.0 T2V Pro pretrain 5s HD-5s100🤗 HF1241
    Kandinsky 5.0 T2V Pro pretrain 10s HD-10s100🤗 HF-
    Kandinsky 5.0 T2V Pro pretrain 5s SD-5s100🤗 HF560
    Kandinsky 5.0 T2V Pro pretrain 10s SD-10s100🤗 HF1158
    Kandinsky 5.0 I2V Pro HD 5sconfigs/k5_pro_i2v_5s_sft_hd.yaml5s100🤗 HF-
    Kandinsky 5.0 I2V Pro SD 5sconfigs/k5_pro_i2v_5s_sft_sd.yaml5s100🤗 HF-

    *Latency was measured after the second inference run. The first run of the model can be slower due to the compilation process. Inference was measured on an NVIDIA H100 GPU with 80 GB of memory, using CUDA 12.8.1 and PyTorch 2.8. For 5-second models Flash Attention 3 was used.

    Examples:

    Results:

    Side-by-Side evaluation

    Kandinsky 5.0 Video Lite

    Kandinsky 5.0 T2V Lite is a lightweight video generation model (2B parameters) that ranks #1 among open-source models in its class. It outperforms larger Wan models (5B and 14B) and offers the best understanding of Russian concepts in the open-source ecosystem.

    We provide 8 model variants, each optimized for different use cases:

    • SFT model — delivers the highest generation quality;

    • CFG-distilled — runs 2× faster;

    • Diffusion-distilled — enables low-latency generation with minimal quality loss (6× faster);

    • Pretrain model — designed for fine-tuning by researchers and enthusiasts.

    All models are available in two versions: for generating 5-second and 10-second videos.

    Additionally, we provide Image-to-Video model capable to generate video given input image and text prompt.

    Model Zoo

    Modelconfigvideo durationNFECheckpointLatency*
    Kandinsky 5.0 T2V Lite SFT 5sconfigs/k5_lite_t2v_5s_sft_sd.yaml5s100🤗 HF139 s
    Kandinsky 5.0 T2V Lite SFT 10sconfigs/k5_lite_t2v_10s_sft_sd.yaml10s100🤗 HF224 s
    Kandinsky 5.0 T2V Lite pretrain 5sconfigs/k5_lite_t2v_5s_pretrain_sd.yaml5s100🤗 HF139 s
    Kandinsky 5.0 T2V Lite pretrain 10sconfigs/k5_lite_t2v_10s_pretrain_sd.yaml10s100🤗 HF224 s
    Kandinsky 5.0 T2V Lite no-CFG 5sconfigs/k5_lite_t2v_5s_nocfg_sd.yaml5s50🤗 HF77 s
    Kandinsky 5.0 T2V Lite no-CFG 10sconfigs/k5_lite_t2v_10s_nocfg_sd.yaml10s50🤗 HF124 s
    Kandinsky 5.0 T2V Lite distill 5sconfigs/k5_lite_t2v_5s_distil_sd.yaml5s16🤗 HF35 s
    Kandinsky 5.0 T2V Lite distill 10sconfigs/k5_lite_t2v_10s_distil_sd.yaml10s16🤗 HF61 s
    Kandinsky 5.0 I2V Lite 5sconfigs/k5_lite_i2v_5s_sft_sd.yaml5s100🤗 HF139 s

    *Latency was measured after the second inference run. The first run of the model can be slower due to the compilation process. Inference was measured on an NVIDIA H100 GPU with 80 GB of memory, using CUDA 12.8.1 and PyTorch 2.8. For 5-second models Flash Attention 3 was used.

    Examples:

    Kandinsky 5.0 T2V Lite SFT
    Kandinsky 5.0 T2V Lite Distill

    Results:

    Side-by-Side evaluation

    The evaluation is based on the expanded prompts from the Movie Gen benchmark, which are available in the expanded_prompt column of the benchmark/moviegen_bench.csv file.

    Distill Side-by-Side evaluation

    Kandinsky 5.0 Image Lite

    Kandinsky 5.0 Image Lite is a line-up of 6B image generation models with the following capabilities:

    • 1K resulution (1280x768, 1024x1024 and others).

    • High visual quality

    • Strong text-writing

    • Russian concepts understanding

    Model Zoo

    ModelconfigNFECheckpointLatency*
    Kandinsky 5.0 T2I Liteconfigs/k5_lite_t2i_sft_hd.yaml100🤗 HF13 s
    Kandinsky 5.0 T2I Lite pretrain-100🤗 HF13 s

    *Latency was measured after the second inference run. The first run of the model can be slower due to the compilation process. Inference was measured on an NVIDIA H100 GPU with 80 GB of memory, using CUDA 12.8.1 and PyTorch 2.8. For 5-second models Flash Attention 3 was used.

    Examples:

    Results

    Results:

    Side-by-Side evaluation

    Kandinsky 5.0 Image Editing

    Kandinsky 5.0 Image Editing is a line-up of 6B image editing models with the following capabilities:

    • 1K resulution (1280x768, 1024x1024 and others).

    • High visual quality

    • Strong text-writing

    • Russian concepts understanding

    Model Zoo

    ModelconfigNFECheckpointLatency*
    Kandinsky 5.0 T2I Editingconfigs/k5_lite_i2i_sft_hd.yaml100🤗 HF-
    Kandinsky 5.0 T2I Editing pretrain-100🤗 HF-

    *Latency was measured after the second inference run. The first run of the model can be slower due to the compilation process. Inference was measured on an NVIDIA H100 GPU with 80 GB of memory, using CUDA 12.8.1 and PyTorch 2.8. For 5-second models Flash Attention 3 was used.

    Examples:

    Results:

    Side-by-Side evaluation

    Quickstart

    Installation

    Clone the repo:

    git clone https://github.com/kandinskylab/kandinsky-5.git
    cd kandinsky-5
    

    Install dependencies:

    pip install -r requirements.txt
    

    To improve inference performance on NVidia Hopper GPUs, we recommend installing Flash Attention 3.

    Model Download
    python download_models.py
    

    use models argument to download some specific models, otherwise all models will be downloaded

    example to download only kandinskylab/Kandinsky-5.0-T2V-Lite-sft-5s and kandinskylab/Kandinsky-5.0-T2V-Pro-sft-5s:

    python download_models.py --models kandinskylab/Kandinsky-5.0-T2V-Lite-sft-5s,kandinskylab/Kandinsky-5.0-T2V-Pro-sft-5s
    
    Run Kandinsky 5.0 T2V Lite SFT 5s
    python test.py --prompt "A dog in red hat"
    
    Run Kandinsky 5.0 T2V Lite SFT 10s
    python test.py --config ./configs/k5_lite_t2v_10s_sft_sd.yaml --prompt "A dog in red hat" --video_duration 10 
    
    Run Kandinsky 5.0 I2V Lite 5s
    python test.py --config ./configs/k5_lite_i2v_5s_sft_sd.yaml --prompt "The bear plays balalaika." --image "./assets/test_image.jpg" --video_duration 5
    
    Run Kandinsky 5.0 T2I Lite
    python test.py --config ./configs/k5_lite_t2i_sft_hd.yaml --prompt "A dog in a red hat" --width=1280 --height=768
    

    T2V Inference

    import torch
    from kandinsky import get_T2V_pipeline
    
    device_map = {
        "dit": torch.device('cuda:0'), 
        "vae": torch.device('cuda:0'), 
        "text_embedder": torch.device('cuda:0')
    }
    
    pipe = get_T2V_pipeline(device_map, conf_path="configs/k5_lite_t2v_5s_sft_sd.yaml")
    
    images = pipe(
        seed=42,
        time_length=5,
        width=768,
        height=512,
        save_path="./test.mp4",
        text="A cat in a red hat",
    )
    

    I2V Inference

    import torch
    from kandinsky import get_I2V_pipeline
    
    device_map = {
        "dit": torch.device('cuda:0'), 
        "vae": torch.device('cuda:0'), 
        "text_embedder": torch.device('cuda:0')
    }
    
    pipe = get_I2V_pipeline(device_map, conf_path="configs/k5_lite_i2v_5s_sft_sd.yaml")
    
    images = pipe(
        seed=42,
        time_length=5,
        save_path='./test.mp4',
        text="The bear plays balalaika.",
        image = "assets/test_image.jpg",
    )
    

    T2I Inference

    import torch
    from kandinsky import get_T2I_pipeline
    
    device_map = {
        "dit": torch.device('cuda:0'), 
        "vae": torch.device('cuda:0'), 
        "text_embedder": torch.device('cuda:0')
    }
    
    pipe = get_T2I_pipeline(device_map, conf_path="configs/k5_lite_t2i_sft_hd.yaml")
    
    images = pipe(
        seed=42,
        save_path='./test.png',
        text="A cat in a red hat with a label 'HELLO'"
    )
    

    I2I Inference

    import torch
    from kandinsky import get_I2I_pipeline
    
    device_map = {
        "dit": torch.device('cuda:0'), 
        "vae": torch.device('cuda:0'), 
        "text_embedder": torch.device('cuda:0')
    }
    
    pipe = get_I2I_pipeline(
        resolution=1024, offload=True,
        device_map=device_map,
    )
    out = pipe(
        "Replace the cat with a husky, leave the rest unchanged",
        image='./assets/cat_in_hat.png'
    )
    
    

    Please, refer to examples folder for more examples in various notebooks.

    Distributed Inference

    For a faster inference, we also provide the capability to perform inference in a distributed way:

    NUMBER_OF_NODES=1
    NUMBER_OF_DEVICES_PER_NODE=1 / 2 / 4
    python -m torch.distributed.launch --nnodes $NUMBER_OF_NODES --nproc-per-node $NUMBER_OF_DEVICES_PER_NODE test.py
    

    Optimized Inference

    Offloading

    For less memory consumption you can use offloading of the models.

    python test.py --prompt "A dog in red hat" --offload
    
    Magcache

    Also we provide Magcache inference for faster generations (now available for sft 5s and sft 10s checkpoints).

    python test.py --prompt "A dog in red hat" --magcache
    
    Qwen encoder quantization

    To reduce GPU memory needed for Qwen encoder we provide option to use NF4-quantized version from bitsandbytes.

    python test.py --prompt "A dog in red hat" --qwen_quantization
    
    Attention engine selection

    Depending on your hardware you can use the follwing full attention algorithm implementation:

    The attention algorithm can be selected using an option "--attention_engine" of test.py script for 5 second (and less) video generation. For 10-second generation we use sparse attention algorithm NABLA.

    Note that currently (19 Oct. 2025) version build from source contains a bug and produces noisy output. A temporary workaround to fix it is decribed here.

    python test.py --prompt "A dog in red hat" --attention_engine=flash_attention_3
    
    python test.py --prompt "A dog in red hat" --attention_engine=flash_attention_2
    
    python test.py --prompt "A dog in red hat" --attention_engine=sdpa
    
    python test.py --prompt "A dog in red hat" --attention_engine=sage
    

    By default we use option --attention_engine=auto which enables automatic selection of the most optimal algorithm installed in your system.

    ComfyUI

    See the instruction here

    Beta testing

    You can apply to participate in the beta testing of the Kandinsky Video Lite via the telegram bot.

    📑 Todo List

    • Kandinsky 5.0 Video Pro
      • Checkpoints
        • sft
        • pretrain
        • rl
        • distil 16 steps
        • I2V
      • ComfyUI integration
      • Diffusers integration
      • Caching acceleration support
      • Multi-GPU Inference code of the models
    • Kandinsky 5.0 Video Lite
      • Checkpoints
        • sft
        • pretrain
        • rl
        • cfg distil
        • distil 16 steps
        • autoregressive generation
        • I2V
      • ComfyUI integration
      • Diffusers integration
      • Caching acceleration support
      • Multi-GPU Inference code of the models
    • Kandinsky 5.0 Image Lite
      • Checkpoints
        • rl
        • pretrain
      • ComfyUI integration
      • Diffusers integration
      • Caching acceleration support
      • Multi-GPU Inference code of the models
    • Kandinsky 5.0 Image Editing
      • Checkpoints
        • sft
        • pretrain
      • ComfyUI integration
      • Diffusers integration
      • Multi-GPU Inference code of the models
    • Technical report

    Authors

    Core Contributors:

    • Video: Alexey Letunovskiy, Maria Kovaleva, Lev Novitskiy, Denis Koposov, Dmitrii Mikhailov, Anastasiia Kargapoltseva, Anna Dmitrienko, Anastasia Maltseva
    • Image & Editing: Nikolai Vaulin, Nikita Kiselev, Alexander Varlamov
    • Pre-training Data: Ivan Kirillov, Andrey Shutkin, Nikolai Vaulin, Ilya Vasiliev
    • Post-training Data: Julia Agafonova, Anna Averchenkova, Olga Kim
    • Research Consolidation & Paper: Viacheslav Vasilev, Vladimir Polovnikov

    Contributors: Yury Kolabushin, Kirill Chernyshev, Alexander Belykh, Mikhail Mamaev, Anastasia Aliaskina, Kormilitsyn Semen, Tatiana Nikulina, Olga Vdovchenko, Polina Mikhailova, Polina Gavrilova, Nikita Osterov, Bulat Akhmatov

    Track Leaders: Vladimir Arkhipkin, Vladimir Korviakov, Nikolai Gerasimenko, Denis Parkhomenko

    Project Supervisor: Denis Dimitrov

    Citation

    @misc{arkhipkin2025kandinsky50familyfoundation,
          title={Kandinsky 5.0: A Family of Foundation Models for Image and Video Generation}, 
          author={Vladimir Arkhipkin and Vladimir Korviakov and Nikolai Gerasimenko and Denis Parkhomenko and Viacheslav Vasilev and Alexey Letunovskiy and Nikolai Vaulin and Maria Kovaleva and Ivan Kirillov and Lev Novitskiy and Denis Koposov and Nikita Kiselev and Alexander Varlamov and Dmitrii Mikhailov and Vladimir Polovnikov and Andrey Shutkin and Julia Agafonova and Ilya Vasiliev and Anastasiia Kargapoltseva and Anna Dmitrienko and Anastasia Maltseva and Anna Averchenkova and Olga Kim and Tatiana Nikulina and Denis Dimitrov},
          year={2025},
          eprint={2511.14993},
          archivePrefix={arXiv},
          primaryClass={cs.CV},
          url={https://arxiv.org/abs/2511.14993}, 
    }
    
    @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}, 
    }
    

    Acknowledgements

    We gratefully acknowledge the open-source projects and research that made Kandinsky 5.0 possible:

    • PyTorch — for model training and inference.
    • FlashAttention 3 — for efficient attention and faster inference.
    • Qwen2.5-VL — for providing high-quality text embeddings.
    • CLIP — for robust text–image alignment.
    • HunyuanVideo — for video latent encoding and decoding.
    • MagCache — for accelerated inference.
    • ComfyUI — for integration into node-based workflows.

    We deeply appreciate the contributions of these communities and researchers to the open-source ecosystem.