DDMD-V (Discrete Distribution Matching Distillation for Video) distills the uniform discrete video diffusion model URSA into a comparable one-step generator Mei. It trains the one-step student with two complementary signals: On-policy categorical distribution matching, and Spatiotemporal adversarial supervision.
conda create -n ddmdv python=3.14 -y
conda activate ddmdv
pip install -r requirements.txt
pip install -e .The released one-step model Mei is a complete URSA pipeline (transformer, tokenizer, scheduler, VAE) and is downloaded on first use:
python inference.py --prompt "A sleek spacecraft flies past a vast ringed planet, cinematic tracking shot."The default generates 49 frames at 320×512 in one step, saved to samples/.
Use --prompts_file prompts.txt for one prompt per line, --out_dir to change the output and
--model <dir> for a local copy of the weights.
To sample a training checkpoint, load its student.pt into the URSA teacher pipeline:
python inference.py --model BAAI/URSA-1.7B-FSQ320 \
--checkpoint experiments/ddmd_v/checkpoints/checkpoint-2000 --prompt "..."Requires CUDA GPUs and a CUDA toolkit with nvcc under CUDA_HOME. Download the URSA teacher:
hf download BAAI/URSA-1.7B-FSQ320 --local-dir checkpoints/URSA-1.7BThen download the Koala-36M caption CSVs
to data/Koala-36M-v1/, then prepare the prompt pool and teacher cache:
python scripts/build_prompt_pool.py --csv_dir data/Koala-36M-v1 --out data/koala_prompt_pool
bash scripts/gen_teacher_cache.shgen_teacher_cache.sh defaults to 8 GPUs × 1,200 pairs, written to
data/teacher_cache_49f_9600/.
Launch distillation with the default 8-GPU recipe (8 GPUs × 1 video × 10 accumulated micro-batches = 80 videos per update, the layout of the released model):
bash scripts/train.sh configs/ddmd_v.yamlOverride configuration values on the command line, e.g. training.max_train_steps=4000.
The critic's input masking (the same random token replacement on real and student fields, rate ρ ~ U(0, 0.5)) is optional and off by default; enable it with adversarial.token_replacement=true.
Checkpoints are saved to experiments/ddmd_v/checkpoints/checkpoint-<step>/.
Resume with experiment.resume_iter=<step> using the same number of GPUs.
TODO
The teacher model and the diffnext library come from
URSA. The distillation builds on
DMD/DMD2 and Di[M]O.
Apache License 2.0. See LICENSE.