thu-ml/Causal-Forcing
Causal autoregressive diffusion distillation for low-step interactive video
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Causal Forcing is a staged distillation codebase for causal autoregressive video diffusion, with frame-wise and chunk-wise generation. Stage 1 trains a multi-step autoregressive diffusion model. Stage 2 initializes a few-step generator with Causal ODE distillation or Causal Consistency Distillation (CD). Stage 3 applies asymmetric Distribution Matching Distillation (DMD) to produce the final generator. Intermediate checkpoints let researchers enter the pipeline at a later stage.
train.py runs YAML-configured jobs under torchrun, while inference.py pairs a configuration with a checkpoint and inputs. The source tree separates trainer/, model/, pipeline/, and wan/. The Python stack includes PyTorch ≥2.4.0, Diffusers 0.31.0, Transformers ≥4.49.0, and a separate flash-attn installation. The ODE route adds scripts that generate paired latents and prepare LMDB datasets; causal CD removes that preprocessing path.
Key Capabilities & Differentiators
The GPU CLI supports text-to-video with chunk-wise or frame-wise checkpoints. The frame-wise path also supports image-to-video by using the conditioning image as the initial latent frame. The original frame-wise inference configuration uses four denoising steps; Causal Forcing++ publishes separate one- and two-step checkpoints with matching YAML files and --use_ema inference examples. The checkpoint setup includes Wan2.1-T2V-1.3B and Wan2.1-T2V-14B assets.
Base models are limited to 81 frames, roughly the five-second regime described for training. Minute-scale generation is a separate Rolling Forcing-based implementation under long_video/, not a longer output setting on the base checkpoints. Fewer denoising steps reduce that part of the workload, but do not establish end-to-end real-time throughput on a particular GPU.
Trade-offs & Limitations
Self Forcing is the closest named comparison and shares the documented inference environment. Causal Forcing changes the initialization before DMD; its quality and motion gains should be checked on matched prompts and hardware rather than treated as deployment guarantees. Causal Forcing++ avoids generating ODE trajectories, and the original ODE route offers prepared data at about 300 GB. The CD route still needs ground-truth training data and a multi-step autoregressive model, whether trained locally or downloaded.
Reduced precision such as BF16 can destabilize CD or DMD for some models. If samples deteriorate or stay blurry, test FP32 and budget for its higher memory cost. The supplied batch-size-64 DMD recipe also cautions that training past about 1,000 steps may hurt motion, while smaller batches may benefit from longer runs. The code is Apache-2.0; assess the terms for weights and datasets separately.
Hardware & Deployment Guide
The setup uses Python 3.10, the pinned and minimum-version requirements, OpenAI CLIP installed from Git, flash-attn installed with --no-build-isolation, and python setup.py develop. Validate that the GPU, PyTorch/CUDA stack, and FlashAttention build are compatible before provisioning the full environment. Download Wan assets and the matching checkpoint from Hugging Face, then run inference locally; the documented CLI path does not require a hosted inference API.
Use the released weights to validate inference before reserving a cluster for training. Full training examples use torchrun on eight nodes with eight processes per node and c10d rendezvous; this is an example scale, not a minimum. The supplied metadata lists no GitHub release. Checkpoints are distributed separately, and the ComfyUI node is maintained in a separate community repository.
long_video/.GPU-equipped research teams benchmarking short text- or image-conditioned video, comparing frame-wise and chunk-wise generation, or replacing ODE initialization with causal consistency distillation.
You need native minute-long generation from the base checkpoint, a production API with established latency and VRAM budgets, or a lightweight full-training workflow without distributed GPU setup.
Quick Start & Installation
conda create -n causal_forcing python=3.10 -y conda activate causal_forcing pip install -r requirements.txt pip install git+https://github.com/openai/CLIP.git pip install flash-attn --no-build-isolation python setup.py develop
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/thu-ml/Causal-Forcing.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about Causal-Forcing
How do I integrate frame-wise image-to-video generation?
inference.py. The documented frame-wise image-to-video path uses configs/causal_forcing_dmd_framewise.yaml, an image-to-video input directory, --i2v, and --use_ema. The source image is encoded as the initial latent frame, so this path uses the same frame-wise generator rather than a separate image-to-video model.How should I size a GPU for inference?
Does Apache-2.0 cover commercial self-hosting of the entire model stack?
When should I compare with Self Forcing, and when should I use a long-video implementation?
long_video/ or evaluate a dedicated long-video method; the base 81-frame checkpoints are not a like-for-like baseline.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy