Causal-Forcing

论文方法总览:Causal-Forcing 的视频生成架构。

清华 thu-ml 从 Wan2.1 蒸馏的因果视频学生,以 WorldFoundry 原生 recipe 提供。默认 chunk-wise 文生视频:832×480、81 帧、4 步;frame-wise 学生也接受图像。在注入官方噪声的条件下与官方推理脚本逐位一致。

Causal-Forcing 把双向 Wan2.1 教师蒸馏成因果自回归学生,让视频可以按 chunk或按帧生成,而不是一次性以双向方式生成完整视频。Causal-Forcing++ 是同一模型卡中的少步采样版本(别名 Causal Forcing++、causal-forcing-plus-plus)。WorldFoundry 通过 NativeCausalForcingPipeline 以原生扩散 recipe 运行全部已发布的学生,支持离线生成与实时流式。这不是 Self-Forcing,也不是 Rolling-Forcing。

论文官方 Teaser:Causal-Forcing 的视频生成论文配图。
论文官方 Teaser:Causal-Forcing 的视频生成论文配图。
论文方法总览:Causal-Forcing 的视频生成架构。
论文方法总览:Causal-Forcing 的视频生成架构。

官方论文是 Causal Forcing: Autoregressive Diffusion Distillation Done Right for High-Quality Real-Time Interactive Video Generation(ICML 2026,arXiv 2602.02214)。++ 文稿是 arXiv 2605.15141。项目页:thu-ml.github.io/CausalForcing.github.io。代码:thu-ml/Causal-Forcing。发布方:清华大学(thu-ml)。权重:zhuhz22/Causal-Forcing。

构建运行命令

推理 Pipeline
NativeCausalForcingPipelineworldfoundry.pipelines.forcing.pipeline_native_forcing
任务World model rollout interactive-video
环境worldfoundry-unified-cu128
设备CUDA 12.8
Runnerworldfoundry.pipeline
加载方式from_pretrained
调用方式native_or_standard_invocation
wf run \
  causal-forcing \
  --pipeline.task-profile interactive-video \
  --json

用来做什么

从 chunk-wise 学生做文生视频:wf run causal-forcing。产物是 causal-forcing.mp4。

图生视频只支持 frame-wise。 用 variant: causal-forcing-framewise 加载 frame-wise 学生并传入一张图像;chunk-wise 与 ++ 学生会拒绝图像输入。

仅在明确需要 1 或 2 步采样时使用 ++。这两个学生对第一帧仍走 4 步([1000, 750, 500, 250],即 ++ 发布记录的首帧步数表)。

使用 VBench 评估视频质量。通过 --pipeline.prompt 提供提示词。

变体

NativeCausalForcingPipeline(worldfoundry.pipelines.forcing.pipeline_native_forcing)为每个发布文件加载一个 recipe。公开 ID causal-forcing 加载 chunk-wise 学生;variant(或 model_id)选择其他学生:

变体Checkpoint(zhuhz22/Causal-Forcing)权重每块 latent 帧数每块步数图像输入
causal-forcing-chunkwise(默认)chunkwise/causal_forcing.ptgenerator34:[1000, 750, 500, 250]否
causal-forcing-framewiseframewise/causal_forcing.ptgenerator_ema14:[1000, 750, 500, 250]可选首帧
causal-forcing-framewise-1stepcausal-forcing++/framewise-1step.ptgenerator_ema1首帧 4 步,之后 1 步:[1000]否
causal-forcing-framewise-2stepcausal-forcing++/framewise-2step.ptgenerator_ema1首帧 4 步,之后 2 步:[1000, 500]否

四个变体共用原生 Self-Forcing 的部件:带 21 个 latent 帧全局 KV cache 的因果 Wan2.1 1.3B 网络,在 shift 5 时间表上做蒸馏 x0 预测的 autoregressive-window runner,Wan2.1 umT5 文本编码器,以及 bf16 的 Wan2.1 VAE。每个发布文件只含一份 generator state dict。加载时去掉 model. 与 FSDP 前缀并严格加载。

运行时契约

旋钮默认说明
尺寸832×480height: 480、width: 832
帧数8121 个 latent 帧,即 cache 大小;latent 帧数须是块大小的整数倍
FPS16
步数4,++ 为 1 / 2取该变体发布的步数表;其他步数会被拒绝
Guidance1.0蒸馏学生不使用 classifier-free guidance
Seed0
精度bfloat16

图生视频沿用官方 --i2v 路线。图像用 torchvision Resize((height, width)) 缩放(不保持宽高比、不裁剪),归一化到 [-1, 1],再由 bf16 的 Wan2.1 VAE 编码。其 latent 作为第 0 个 latent 帧、在时间步 0 写入 KV cache,rollout 生成其余 20 个 latent 帧。

frame-wise 学生在步间重加噪时用 bf16 计算,与官方调度器对单样本单帧块的做法一致;chunk-wise 块用 float32 重加噪。

实时。 pipeline 常驻一个 rollout(prepare_realtime、configure_realtime、stream_realtime、reset_realtime)。每次 stream_realtime 提交并解码一个 latent 块,16 fps,advance="continuous";提交新提示词会重开 rollout:

变体首块之后每块81 帧时的块数
chunk-wise9 帧12 帧7
frame-wise 与 Causal Forcing++,纯文本1 帧4 帧21
frame-wise 带图像5 帧(图像帧加第一块)4 帧20

在 WorldFoundry 中运行

wf run causal-forcing 在 worldfoundry-unified-cu128(Python 3.11,CUDA 12.8)中运行,与 Self-Forcing 相同。用 --pipeline.load.variant causal-forcing-framewise 选择变体。generator 从 zhuhz22/Causal-Forcing 解析,可就位在 $WORLDFOUNDRY_CKPT_DIR/zhuhz22--Causal-Forcing(或 Causal-Forcing)或 Hugging Face 缓存中;文本编码器、tokenizer 与 VAE 来自 Wan-AI/Wan2.1-T2V-1.3B。Studio 传入已就位的发布目录,每个变体从中读取自己的文件。本地未就位的 checkpoint 会按固定 revision 获取。未声明许可证——生产使用前请核对 GitHub / Hugging Face 卡片。

需要固定各个文件的路径时,传入 checkpoint_overrides:

from worldfoundry.pipelines.forcing.pipeline_native_forcing import NativeCausalForcingPipeline

wan = "<ckpts>/Wan-AI--Wan2.1-T2V-1.3B"
pipeline = NativeCausalForcingPipeline.from_pretrained(
    variant="causal-forcing-framewise",
    device="cuda",
    torch_dtype="bf16",
    offload_mode="none",
    checkpoint_overrides={
        "dit": "<ckpts>/zhuhz22--Causal-Forcing/framewise/causal_forcing.pt",
        "text-encoder": wan,
        "tokenizer": wan,
        "vae": wan,
    },
)
t2v = pipeline(prompt="A red fox walks through a sunlit forest.", seed=42, return_dict=True)
i2v = pipeline(prompt="An abandoned room.", images="testcase/012_abandoned-room.png", seed=42, return_dict=True)

验证

tests/manual/self_forcing_parity.py --model-id <variant> 在 MovieGenVideoBench 第一条提示词上(seed 42、480×832、21 个 latent 帧、bf16)把一个变体与官方推理脚本对比,并注入官方的初始噪声与重加噪采样。四个文生视频变体和 frame-wise 图生视频在每一环节都与官方逐位一致,从 checkpoint 加载、提示词嵌入到最终 latent 和解码视频,整段解码与分块流式解码皆然。

最小评测

对 chunk-wise 文生视频结果运行 VBench 的 custom_input / aesthetic_quality。