Repository navigation
Kandinsky6 - #54
Kandinsky6#54leffff wants to merge 6 commits into
Conversation
Add the Kandinsky6 network for Kandinsky 6.0 text- and image-to-video with synchronized 44.1 kHz audio. The official kandinsky-6 code is the numerical reference: BF16 transformer weights with FP32 time and modulation projections, the native shifted Euler sampler with CFG 5, Qwen2.5-VL and CLIP conditioning, the native memory-aware tiled Hunyuan video VAE (vendored, MIT) and the MMAudio codec with its native weight normalization. Image conditioning appends the clean reference latent as a tail frame, and the discriminators gain a temporal audio head. Add Pro SFT and DMD2 recipes for T2VA and I2VA and the Kandinsky negative-prompt preset, and pin diffusers 0.42.1. Make training-time evaluation safe for later autograd: sampling and preprocessing run under torch.no_grad, and under strict torch.inference_mode only with config.inference. Signed-off-by: leffff <levnovitskiy@gmail.com>
diffusers 0.42 and later declare Requires-Python >=3.11, so the pinned diffusers==0.42.1 cannot install on the previously advertised Python 3.10. Signed-off-by: leffff <levnovitskiy@gmail.com>
Reject the pi-Flow distilled checkpoints, whose heads predict ten times the latent channels, instead of failing later on mismatched shapes. Cast the native sampler's Euler update back to the state dtype: an unprepared network's high-precision prediction promoted the state and broke the next forward. Prepared BF16/FP32 updates are unchanged. The sampler no longer swallows unknown keyword arguments, so it now joins the ODE-only sampler contract. Signed-off-by: leffff <levnovitskiy@gmail.com>
The public 3B Lite checkpoint shares Pro's native canvas and sampler (121 frames, 480x864, 50 steps, CFG 5, shift 5), so its SFT and DMD2 recipes reuse the Pro ones with the Lite checkpoint and GAN heads sized for its 1792/896-wide tokens and 32 fused blocks. Cover the Kandinsky 6 recipes in the negative-prompt and native student-grid config checks. Signed-off-by: leffff <levnovitskiy@gmail.com>
Add Kandinsky6PDD, which widens the video and audio output projections for parallel decoding distillation. Video heads use the channel-major (C, p_t, p_h, p_w) patch layout and audio heads are per token; a video-only network widens only the video head. Under the unwarped RF schedule the teacher projections are copied without a fold, so step 0 reproduces the teacher. Test the wrapper end to end on a tiny Kandinsky 6 transformer for T2V and I2V, with and without audio. Signed-off-by: leffff <levnovitskiy@gmail.com>
Let consistency training, truncated consistency training and knowledge
distillation take per-modality dict states such as
{"video": ..., "audio": ...}, as SFT, DMD2 and PDD already do. Each
modality gets its own consistency target and loss under its own noise
schedule, the TCM stage blend and boundary split run per modality, and
KD gathers each modality's path state at the shared student timestep.
Losses are logged per modality and summed into total_loss.
Test joint Kandinsky 6 states for CT, CD, TCM and single- and multi-step
KD, and document the multimodal support.
Signed-off-by: leffff <levnovitskiy@gmail.com>
[Medium impact] The PR adds a new model and extends shared multimodal training and scoring paths. Add a compatibility path for existing CogVideoX and LTX-2 DMD2 checkpoints before merging. Findings
SummaryAdds Kandinsky 6 Lite and Pro support for video and joint audio/video generation.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Prompts and optional image] --> B[Qwen and CLIP text encoders]
A --> C[Video VAE reference frame]
B --> D[Kandinsky 6 transformer]
C --> D
E[Video and audio noise] --> D
D --> F[Video and audio latents]
F --> G[Video VAE and audio codec]
G --> H[Generated clip]
D --> I[Per-modality discriminator features]
Reviews (1) · Last reviewed commit: "Support joint video and audio states in ..." · Reviewed by Greptile |
| "audio": L(Discriminator_AudioDiT)( | ||
| inner_dim=2048, | ||
| hidden_channels=256, |
There was a problem hiding this comment.
Existing training runs cannot resume
These changes prevent existing CogVideoX and LTX-2 DMD2 runs from loading their saved discriminators. CogVideoX checkpoints have first-layer weights with 480/768 input channels, but the new heads require 1920/3072. LTX-2 checkpoints have 2D audio filters, but Discriminator_AudioDiT requires 1D filters with 2048 input channels.
DMD2 saves the discriminator, and normal resume loads it strictly without converting the old weights. Loading therefore fails before training resumes. Keep the old feature layouts and heads available for existing runs, and opt new runs into the new layouts.
There was a problem hiding this comment.
This is intentional. CogVideoX and LTX-2 now use the token-grid feature layout and the temporal audio discriminator by default, because they match what each token actually holds: no patch split of its channels, and no mel axis in audio tokens. I discussed this with the maintainers and the break is accepted. Wan keeps its old default behind token_grid_features, because many existing Wan runs use it. CogVideoX and LTX-2 DMD2 runs started before this change need a fresh discriminator to resume.
There was a problem hiding this comment.
Got it — thanks for clarifying. If the maintainers accepted the break and existing runs can start fresh discriminators, that resolves it.
Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.
No description provided.