Skip to content

JIA-Lab-research/CoDMD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoDMD: Copula-Aware Distribution Matching Distillation for Video Generation

arXiv Project Page Hugging Face License

CoDMD distills Wan2.1 video diffusion models into 4-step generators while preserving the joint dependency structure across frames and samples via a novel copula-aware distillation loss.

🎬 Demo Videos

CoDMD performs strongly on fast actions, camera motion, prompt alignment, and vivid color rendering.

Prompt Alignment — faithful response to detailed instructions.

prompt.mp4

Color Rendering — rich colors and visually pleasing appearance.

color.mp4

Fast Action — stable motion under rapid dynamics.

action.mp4

Camera Motion — smooth camera movement with coherent structure.

camera.mp4

Overview

Standard Distribution Matching Distillation (DMD) treats each output element independently, losing the joint dependency structure (copula) across video frames and batch samples. CoDMD introduces a copula-aware distillation loss that explicitly preserves these relational structures during distillation.

Key Features

  • Copula-aware loss — preserves the joint dependency structure (copula) across frames and samples during distillation, going beyond independent per-element matching
  • Motion preservation — alleviate the motion degradation commonly seen in few-step distilled models
  • Instruction alignment — ensure the distilled generator faithfully distinguishes diverse prompts

📦 Installation

# Clone the repository
git clone https://github.com/PLACEHOLDER/CoDMD.git
cd CoDMD

# Create conda environment
conda create -n codmd python=3.10 -y
conda activate codmd

# Install dependencies
pip install -r requirements.txt

# Install the package
pip install -e .

📥 Checkpoint Download

Model Backbone Steps Download
CoDMD-1.3B Wan2.1-T2V-1.3B 4 CoDMD_wan2.1_T2V_1.3B.pt
CoDMD-14B Wan2.1-T2V-14B 4 CoDMD_wan2.1_T2V_14B.pt

Download and place the checkpoint folder (containing model.pt) to your local directory.

🚀 Inference

Single GPU

python inference.py \
    --config_path configs/wan_dmd_tar.yaml \
    --checkpoint_folder <PATH_TO_CHECKPOINT> \
    --output_folder ./results \
    --prompt_file_path prompts.txt \
    --num_seeds 5

Multi-GPU (DDP)

torchrun --nproc_per_node=8 --master_port=29600 \
    inference.py \
    --config_path configs/wan_dmd_tar.yaml \
    --checkpoint_folder <PATH_TO_CHECKPOINT> \
    --output_folder ./results \
    --prompt_file_path prompts.txt \
    --num_seeds 5

🏋️ Training

Training Wan2.1-T2V-1.3B (32 GPUs)

export PYTHONPATH=$(pwd):$PYTHONPATH
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True

torchrun --nnodes 4 --nproc_per_node=8 --rdzv_id=5235 \
    copula_dmd/train_dmd.py -- \
    --config_path configs/wan_dmd_tar.yaml

Training Wan2.1-T2V-14B (32 GPUs)

torchrun --nnodes 4 --nproc_per_node=8 --rdzv_id=5235 \
    copula_dmd/train_dmd.py -- \
    --config_path configs/wan_dmd_tar_14b.yaml

🙏 Acknowledgement

This project builds upon the following excellent works:

We thank the authors for their outstanding contributions to the community.

📝 Citation

If you find this work useful, please cite:

@misc{zhang2026codmdcopulaawaredistributionmatching,
      title={CoDMD: Copula-aware Distribution Matching Distillation for Fast Video Generation}, 
      author={Wenhu Zhang and Kun Cheng and Changyuan Wang and Shiyao Li and Yuechen Zhang and Wenbo Li and Jiajun Zha and Jingyi Zhang and Kang Zhao and Jiaya Jia},
      year={2026},
      eprint={2606.21982},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2606.21982}, 
}

About

Resources

License

Stars

15 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors