mrfakename commited on
Commit
f39fc07
·
verified ·
1 Parent(s): c5582c0

Model card

Browse files
Files changed (1) hide show
  1. README.md +192 -0
README.md ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: diffusers
4
+ tags:
5
+ - video
6
+ - video-generation
7
+ - text-to-video
8
+ - image-to-video
9
+ - audio-generation
10
+ - kandinsky
11
+ - diffusers
12
+ ---
13
+
14
+ > Mirror of [kandinskylab/Kandinsky-6.0-Pro-5s-Diffusers](https://huggingface.co/kandinskylab/Kandinsky-6.0-Pro-5s-Diffusers). All credit to the original authors; license unchanged.
15
+
16
+
17
+ <div align="center">
18
+ <img src="https://huggingface.co/kandinskylab/Kandinsky-6.0-Pro-5s-Diffusers/resolve/main/assets/promo.webp" width="100%">
19
+ </div>
20
+
21
+ <br>
22
+
23
+ <div align="center">
24
+ <img src="https://huggingface.co/kandinskylab/Kandinsky-6.0-Pro-5s-Diffusers/resolve/main/assets/Kandinsky_LOGO_6_Horizontal_black.png" width="80%">
25
+ </div>
26
+
27
+
28
+ <div align="center">
29
+
30
+ <a href="https://kandinskylab.ai/models/video/"><img alt="KandinskyLab" src="https://img.shields.io/badge/KandinskyLab-76E0B7?style=for-the-badge"></a>
31
+ <a href="https://arxiv.org/pdf/2610.05608"><img alt="Report" src="https://img.shields.io/badge/Report-9C2731?style=for-the-badge"></a>
32
+ <a href="#"><img alt="PyPI" src="https://img.shields.io/badge/PyPI-3171B2?style=for-the-badge"></a>
33
+ <a href="https://huggingface.co/spaces/kandinskylab/Kandinsky-6.0-Pro-distill-5s"><img alt="HF Demo" src="https://img.shields.io/badge/HF%20Demo-D9622B?style=for-the-badge"></a>
34
+ <a href="https://huggingface.co/docs/diffusers/main/en/api/pipelines/kandinsky6"><img alt="Diffusers" src="https://img.shields.io/badge/Diffusers-F8D44E?style=for-the-badge"></a>
35
+ <a href="https://docs.vllm.ai/projects/vllm-omni/en/latest/api/vllm_omni/diffusion/models/kandinsky6/"><img alt="vLLM" src="https://img.shields.io/badge/vLLM-54A0F8?style=for-the-badge"></a>
36
+ <a href="https://docs.sglang.io/cookbook/diffusion/Kandinsky/Kandinsky6"><img alt="SGLang" src="https://img.shields.io/badge/SGLang-C6602D?style=for-the-badge"></a>
37
+ <a href="https://haoailab.com/FastVideo/inference/kandinsky6/"><img alt="FastVideo" src="https://img.shields.io/badge/FastVideo-436BF6?style=for-the-badge"></a>
38
+ <a href="https://registry.comfy.org/nodes/kandinsky6"><img alt="ComfyUI" src="https://img.shields.io/badge/ComfyUI-EBF764?style=for-the-badge"></a>
39
+
40
+ </div>
41
+
42
+ <h1>Kandinsky 6.0: A family of diffusion models for Video + Audio generation</h1>
43
+
44
+ We present Kandinsky 6.0 Video, a family of foundation diffusion models for synchronized text-to-audio-video generation, comprising Kandinsky 6.0 Video Lite (3B parameters) and Kandinsky 6.0 Video Pro (29B parameters). Both models generate 5-second video clips with synchronized 44 kHz audio, including lip-sync, in text-to-audio-video (T2AV) and image-to-audio-video (TI2AV) modes; a plug-in super-resolution model raises the output resolution to Full-HD (1920×1080).
45
+
46
+ ## Usage guide
47
+
48
+ This repository contains **Kandinsky 6.0 Pro**: the main Pro checkpoint, the strongest quality setting of the Pro line.
49
+
50
+ ### Text-to-audio-video (T2AV)
51
+
52
+ ```python
53
+ import torch
54
+ from diffusers import Kandinsky6TI2VAPipeline
55
+ from diffusers.utils import encode_video
56
+
57
+ DEFAULT_PROMPT = (
58
+ "cinematic shot: a giant stone samurai on a stormy cliff above a neon city opens glowing golden eyes and "
59
+ "raises a katana. Blue lightning strikes the blade, creating a massive shockwave through the clouds. The "
60
+ "camera rapidly pulls back from a low angle. Photorealistic, epic scale, dark blue and gold lighting, rain, "
61
+ "sparks, volumetric lightning, blockbuster quality. Audio: heavy rain, deep thunder, metallic sword hum, "
62
+ "rising brass and choir, electrical crackle, perfectly synchronized lightning impact, sub-bass shockwave. "
63
+ "No dialogue, text, or logos."
64
+ )
65
+
66
+ pipe = Kandinsky6TI2VAPipeline.from_pretrained(
67
+ "kandinskylab/Kandinsky-6.0-Pro-5s-Diffusers", torch_dtype=torch.bfloat16
68
+ )
69
+ pipe.enable_model_cpu_offload()
70
+
71
+ output = pipe(
72
+ prompt=DEFAULT_PROMPT,
73
+ height=480,
74
+ width=864,
75
+ num_frames=121,
76
+ num_inference_steps=50,
77
+ guidance_scale=5.0,
78
+ )
79
+ encode_video(
80
+ output.frames[0],
81
+ fps=24,
82
+ output_path="output.mp4",
83
+ audio=output.audio[0][None],
84
+ audio_sample_rate=pipe.audio_sample_rate,
85
+ )
86
+ ```
87
+
88
+ ### Image-to-audio-video (TI2AV)
89
+
90
+ Pass a reference image with `image=`. It conditions the first frame, and the pipeline resizes and center-crops it to `height` × `width`. The prompt should describe what happens next in that image, so the example uses its own prompt rather than `DEFAULT_PROMPT`. It reuses `pipe` from the T2AV example.
91
+
92
+ ```python
93
+ from diffusers.utils import load_image
94
+
95
+ IMAGE_PROMPT = (
96
+ "cinematic shot: a red dragon wakes on a mound of gold coins in a sunlit cave, slowly unfolds its wings "
97
+ "and lowers its head toward the glowing stream below. Coins slide and clink down the pile as the dragon "
98
+ "shifts its weight. The camera slowly pushes in toward the dragon's eyes. Photorealistic, fantasy, warm "
99
+ "golden light, drifting dust motes, lush cave flowers. Audio: deep rumbling breath, leathery wing flaps, "
100
+ "clinking coins, trickling water, distant echoing roar. No dialogue, text, or logos."
101
+ )
102
+
103
+ image = load_image(
104
+ "https://huggingface.co/kandinskylab/Kandinsky-6.0-Pro-5s-Diffusers/resolve/main/assets/i2va_input.jpg"
105
+ )
106
+
107
+ output = pipe(
108
+ prompt=IMAGE_PROMPT,
109
+ image=image,
110
+ height=480,
111
+ width=864,
112
+ num_frames=121,
113
+ num_inference_steps=50,
114
+ guidance_scale=5.0,
115
+ )
116
+ encode_video(
117
+ output.frames[0],
118
+ fps=24,
119
+ output_path="output_ti2av.mp4",
120
+ audio=output.audio[0][None],
121
+ audio_sample_rate=pipe.audio_sample_rate,
122
+ )
123
+ ```
124
+
125
+ ### Options
126
+
127
+ Pass `sample_audio=False` to generate video only, and `expand_prompts=True` to let the Qwen2.5-VL text encoder rewrite a short prompt into a detailed one before encoding. `expand_prompts` adds latency but no extra model weights.
128
+
129
+
130
+ ## Super Res guide
131
+
132
+ Kandinsky 6.0 video super-resolution is a separate pipeline, `Kandinsky6SRPipeline`. It takes the frames produced above and upscales them by ×2, ×2.25 or ×4 with tiled diffusion in K-VAE latent space, blending overlapping tiles back with Hann windows. The example uses the flow-matching checkpoint, which runs in 4 steps per tile.
133
+
134
+ ```python
135
+ import torch
136
+ from diffusers import Kandinsky6SRPipeline
137
+ from diffusers.utils import encode_video
138
+
139
+ torch._inductor.config.max_autotune = True # required: lets inductor pick flex-attention tiles that fit the SR block mask
140
+
141
+ sr_pipe = Kandinsky6SRPipeline.from_pretrained(
142
+ "kandinskylab/Kandinsky-6.0-VSR-5s-Diffusers", torch_dtype=torch.bfloat16
143
+ )
144
+ sr_pipe.transformer.set_attention_backend("flex")
145
+ sr_pipe.enable_model_cpu_offload()
146
+ sr_pipe.transformer.compile_repeated_blocks(fullgraph=True)
147
+
148
+ upscaled = sr_pipe(
149
+ video=output.frames[0],
150
+ resolution_scale=2.25, # 2, 2.25 or 4
151
+ num_inference_steps=4, # 2 with Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers
152
+ ).frames[0]
153
+ encode_video(
154
+ upscaled,
155
+ fps=24,
156
+ output_path="output_sr.mp4",
157
+ audio=output.audio[0][None],
158
+ audio_sample_rate=pipe.audio_sample_rate,
159
+ )
160
+ ```
161
+
162
+ The example continues from the Usage guide: `pipe` and `output` come from it. The SR pipeline works on frames only, so the audio is passed to `encode_video` from the generation step.
163
+
164
+ - `resolution_scale=2.25` (the default, and the route used after Kandinsky 6 generation) is a ×1.125 bilinear pre-upscale followed by the ×2 path. `2` and `4` are the other options.
165
+ - `min_overlap` (default `0.2`) sets the minimum tile overlap. `tiles_batch_size` (default `1`) sets how many tiles go through the model per call, trading VRAM for speed.
166
+
167
+ ## Components
168
+
169
+ | Folder | Class | Role |
170
+ |---|---|---|
171
+ | `transformer/` | `Kandinsky6Transformer3DModel` | Multimodal video+audio diffusion transformer (Pro) |
172
+ | `vae/` | `AutoencoderKLHunyuanVideo` | Video VAE: encodes the reference image, decodes the generated video |
173
+ | `text_encoder/` + `tokenizer/` | `Qwen2_5_VLForConditionalGeneration` + `Qwen2_5_VLProcessor` | Token-level text embeddings; also used for `expand_prompts=True` |
174
+ | `text_encoder_2/` + `tokenizer_2/` | `CLIPTextModel` + `CLIPTokenizer` | Pooled text embedding |
175
+ | `audio_vae/` | `MMAudioVAE` | Audio latents ↔ mel spectrogram |
176
+ | `vocoder/` | `MMAudioVocoder` (BigVGAN-style) | Mel spectrogram → waveform |
177
+ | `scheduler/` | `FlowMatchEulerDiscreteScheduler` | Flow matching, `shift = 5.0` |
178
+
179
+ `model_index.json` names the pipeline class `Kandinsky6TI2VAPipeline`.
180
+
181
+ ### Kandinsky 6.0 family
182
+
183
+ | Checkpoint | Repository | Use |
184
+ |---|---|---|
185
+ | Pro (this repository) | [kandinskylab/Kandinsky-6.0-Pro-5s-Diffusers](https://huggingface.co/kandinskylab/Kandinsky-6.0-Pro-5s-Diffusers) | generation |
186
+ | Pro, distilled, 10 steps | [kandinskylab/Kandinsky-6.0-Pro-distill-5s-Diffusers](https://huggingface.co/kandinskylab/Kandinsky-6.0-Pro-distill-5s-Diffusers) | generation |
187
+ | Pro, pretrained | [kandinskylab/Kandinsky-6.0-Pro-pretrain-5s-Diffusers](https://huggingface.co/kandinskylab/Kandinsky-6.0-Pro-pretrain-5s-Diffusers) | generation |
188
+ | Lite | [kandinskylab/Kandinsky-6.0-Lite-5s-Diffusers](https://huggingface.co/kandinskylab/Kandinsky-6.0-Lite-5s-Diffusers) | generation |
189
+ | Lite, distilled, 10 steps | [kandinskylab/Kandinsky-6.0-Lite-distill-5s-Diffusers](https://huggingface.co/kandinskylab/Kandinsky-6.0-Lite-distill-5s-Diffusers) | generation |
190
+ | Lite, pretrained | [kandinskylab/Kandinsky-6.0-Lite-pretrain-5s-Diffusers](https://huggingface.co/kandinskylab/Kandinsky-6.0-Lite-pretrain-5s-Diffusers) | generation |
191
+ | VSR, flow matching, 4 steps/tile | [kandinskylab/Kandinsky-6.0-VSR-5s-Diffusers](https://huggingface.co/kandinskylab/Kandinsky-6.0-VSR-5s-Diffusers) | upscale |
192
+ | VSR, distilled, 2 steps/tile | [kandinskylab/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers](https://huggingface.co/kandinskylab/Kandinsky-6.0-VSR-distilled2steps-5s-Diffusers) | upscale |