Motif Technologies 推出的低成本文本到视频扩散Transformer
📑 技术报告 | 🤗 Hugging Face | 🌐 项目页面
训练高性能视频生成模型通常需要海量数据集、大规模参数以及充足的计算资源。Motif-Video 2B 旨在探索:是否能以更低的成本(训练样本少于1000万段,H200 GPU计算时长低于10万小时)实现具有竞争力的文本到视频生成质量?研究表明,答案是肯定的——前提是模型设计需明确分离那些在规模扩展时容易相互纠缠的目标。
我们的核心发现是:当通过同一路径处理提示对齐、时间一致性和细节恢复这三个目标时,它们会相互干扰。Motif-Video 2B 并非仅依赖规模,而是从架构层面解决这种目标干扰问题,具体包括两项创新:
这些创新与低成本训练方案相结合,包括TREAD标记路由和早期阶段的REPA,并辅以冻结的V-JEPA教师模型——据我们所知,这是首次将该组合应用于文本到视频训练。
在VBench评测中,Motif-Video 2B的总得分为83.76%,在我们评估的开源模型中位居榜首,以7倍 fewer parameters和大约一个数量级更少的训练数据超越了Wan2.1-14B。
Motif-Video 2B是一个流匹配扩散Transformer,其设计围绕一个核心原则:每个组件被赋予明确的职责,具有冲突目标的组件不会被要求共享容量。
| 组件 | 选择 |
|---|---|
| 文本编码器 | T5Gemma2(编码器-解码器,UL2适配的Gemma 3) |
| 视频令牌器 | Wan2.1 VAE(8×8空间、4×时间压缩),2×2×1分块 |
| 骨干网络 | 12个双流 + 16个单流 + 8个DDT解码器层 |
| 隐藏维度/头数 | 1536 / 12头 × 128 |
| 归一化 | 全程采用QK归一化 |
| 位置编码 | RoPE |
| 交叉注意力 | 单流阶段采用共享交叉注意力 |
| 目标函数 | 整流流匹配(速度预测) |
| I2V条件 | 首帧潜变量 + SigLIP图像嵌入,带时间步感知模糊 |
职责分离的高层概述:
关于共享交叉注意力为何共享K/V而非Q,以及为何除了W_O的标准零初始化外这一点仍有必要的完整推导,请参见技术报告的3.3节。
pip install "diffusers>=0.35.2" "transformers>=5.5.4" torch accelerate ftfy einops sentencepiece regex Pillow imageio imageio-ffmpegimport torch
from diffusers import AdaptiveProjectedGuidance, DiffusionPipeline
from diffusers.utils import export_to_video
guider = AdaptiveProjectedGuidance(
guidance_scale=8.0,
adaptive_projected_guidance_rescale=12.0,
adaptive_projected_guidance_momentum=0.1,
use_original_formulation=True,
)
pipe = DiffusionPipeline.from_pretrained(
"Motif-Technologies/Motif-Video-2B",
custom_pipeline="pipeline_motif_video",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
guider=guider,
)
pipe = pipe.to("cuda")
output = pipe(
prompt="A category-five hurricane, viewed from inside the eye, reveals a circular stadium of cloud walls rising to fifty thousand feet with an eerie disk of blue sky directly overhead. Shot from a NOAA reconnaissance aircraft mounted camera, the perspective looks outward toward the eyewall — a near-vertical curtain of rotating cloud and lightning that is simultaneously terrifying and transcendent. The inner surface of the eyewall catches the setting sun, painting it in improbable shades of peach and rose. The camera slowly pans 360 degrees to complete one full revolution, capturing the entire coliseum of the storm. Below, the ocean surface is a white blur of foam and spray. The documentary-style cinematography strips away all artifice to present the storm as an entity of pure elemental power.",
height=736,
width=1280,
num_frames=121,
num_inference_steps=50,
)
export_to_video(output.frames[0], "output.mp4", fps=24)import torch
from diffusers import AdaptiveProjectedGuidance, DiffusionPipeline
from diffusers.utils import export_to_video, load_image
guider = AdaptiveProjectedGuidance(
guidance_scale=8.0,
adaptive_projected_guidance_rescale=12.0,
adaptive_projected_guidance_momentum=0.1,
use_original_formulation=True,
)
pipe = DiffusionPipeline.from_pretrained(
"Motif-Technologies/Motif-Video-2B",
custom_pipeline="pipeline_motif_video",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
guider=guider,
)
pipe = pipe.to("cuda")
image = load_image("https://huggingface.co/Motif-Technologies/Motif-Video-2B/resolve/main/assets/i2v_sample.jpg")
output = pipe(
prompt="Three friends stride through a sun-bleached meadow as a warm breeze ripples the tall dry grass around their legs. The woman on the left turns her head to share a quiet laugh, the woman in the center pushes a loose curl behind her ear, and the man on the right tilts his face toward the sky. The camera drifts gently alongside them at walking pace, handheld, with soft overcast light.",
image=image,
height=736,
width=1280,
num_frames=121,
num_inference_steps=50,
)
export_to_video(output.frames[0], "output.mp4", fps=24)# Text-to-Video
python inference.py \
--prompt "A time-lapse of a flower blooming in a dark room, dramatic lighting" \
--output t2v_output.mp4
# Image-to-Video
python inference.py \
--image assets/i2v_sample.jpg \
--prompt "Three friends stride through a meadow as a warm breeze ripples the tall grass" \
--output i2v_output.mp4有关所有可用选项,请参见 inference.py(使用 --help)。
| 参数 | 默认值 | 说明 |
|---|---|---|
| Resolution | 1280x736 | 720p,最佳质量 |
| Frames | 121 | 24fps 下约 5 秒 |
| Guidance scale | 8.0 | |
| Inference steps | 50 | |
| dtype | bfloat16 | 推荐用于 H100/A100 |
默认情况下,pipe.to("cuda") 会将所有组件同时加载到 GPU 上,需要 ~30 GB 显存。
对于显存为 24 GB 或更少的 GPU(例如 RTX 4090、RTX 3090),请结合 expandable_segments 分配器设置使用 enable_model_cpu_offload():
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:Truepipe = DiffusionPipeline.from_pretrained(
"Motif-Technologies/Motif-Video-2B",
custom_pipeline="pipeline_motif_video",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
guider=guider, # see T2V example above
)
pipe.enable_model_cpu_offload() # replaces pipe.to("cuda")
output = pipe(prompt="...", height=736, width=1280, num_frames=121, num_inference_steps=50)
export_to_video(output.frames[0], "output.mp4", fps=24)这会在需要时才将每个组件(文本编码器→Transformer→VAE)移至GPU。expandable_segments设置使CUDA内存分配器能够高效重用早期组件释放的内存,避免因内存碎片导致的OOM错误。
| 模式 | 峰值显存 | 速度 | 推荐GPU |
|---|---|---|---|
pipe.to("cuda") | ~30 GB | 最快 | A100, H100, H200 |
enable_model_cpu_offload() | ~19 GB | 相近 | RTX 4090, RTX 3090 |
如需进一步减少显存占用,可使用torchao将Transformer权重量化为FP8:
pip install torchaofrom torchao.quantization import quantize_, Float8WeightOnlyConfig
pipe = DiffusionPipeline.from_pretrained(
"Motif-Technologies/Motif-Video-2B",
custom_pipeline="pipeline_motif_video",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
guider=guider, # see T2V example above
)
quantize_(pipe.transformer, Float8WeightOnlyConfig())
pipe.enable_model_cpu_offload()
output = pipe(prompt="...", height=736, width=1280, num_frames=121, num_inference_steps=50)
export_to_video(output.frames[0], "output.mp4", fps=24)这会将Transformer权重以FP8(8位)而非BF16(16位)格式存储,在保持所有计算均为BF16精度的同时,将峰值VRAM从约19 GB降至约15 GB。
| 模式 | 峰值VRAM | 说明 |
|---|---|---|
enable_model_cpu_offload() | ~19 GB | BF16基准线 |
+ Float8WeightOnlyConfig | ~15 GB | FP8权重,BF16计算 |
Motif-Video 2B的官方ComfyUI自定义节点目前正在开发中。敬请关注更新。
在我们评估的开源模型中,Motif-Video 2B取得了最高的总分。
| 模型 | 参数规模 | 总分 | 质量 | 语义 |
|---|---|---|---|---|
| Wan2.2-T2V(提示优化) | A14B | 84.23 | 85.42 | 79.50 |
| Motif-Video 2B(我们的模型) | 2B | 83.76 | 84.59 | 80.44 |
| SANA-Video | 2B | 83.71 | 84.35 | 81.35 |
| Wan2.1-T2V | 14B | 83.69 | 85.59 | 76.11 |
| OpenSora 2.0(T2I2V) | 11B | 83.60 | 84.40 | 80.30 |
| Wan2.1-T2V | 1.3B | 83.31 | 85.23 | 75.65 |
| HunyuanVideo | 13B | 83.24 | 85.09 | 75.82 |
| CogVideoX1.5-5B(提示优化) | 5B | 82.17 | 82.78 | 79.76 |
| Step-Video-T2V | 30B | 81.83 | 84.46 | 71.28 |
| LTX-Video | 2B | 80.00 | 82.30 | 70.79 |
Motif-Video 2B(开源)在各维度上的显著亮点:
完整的16维度细分详见技术报告的表3。
关于VBench与感知质量的说明。 Motif-Video 2B在VBench总分上领先,但在我们与Wan2.1-T2V-14B的内部对比中,观察到较大模型在时间稳定性和精细人体解剖结构方面的感知优势。我们在报告的第7节中讨论了这种差距的来源(维度权重统一、近正确语义得分)。我们明确报告了这一差距,而非对其进行掩盖。
在一项针对40个由大型语言模型(LLM)生成的提示词,与六个同期开源基线模型(SANA-Video、LTX-Video 2、Wan2.1-14B、Wan2.1-1.3B、Wan2.2-5B、CogVideoX-5B)进行的盲法两两对比研究中,Motif-Video 2B在提示词遵循度和视频保真度这两个维度上,均优于SANA-Video(参数规模相近)和Wan2.1-1.3B(参数规模相近,但训练语料更大)。Wan2.1-14B因其7倍于Motif-Video 2B的参数规模和显著更大的训练数据量,总体上仍是更受青睐的模型。
我们所报告的局限性,是指本报告中的设计决策应在何种边界条件下进行解读,而非仅仅作为警告。
我们认为,时间稳定性和数据覆盖范围——而非架构深度——是该模型当前面临的主要性能上限。这两者也是未来迭代中最自然的优化方向,而当前架构已为此做好了整合准备。
如果您发现 Motif-Video 2B 对您的研究有所帮助,请引用:
@techreport{motifvideo2b2026,
title = {Motif-Video 2B: Technical Report},
author = {Motif Technologies},
year = {2026},
institution = {Motif Technologies},
url = {https://arxiv.org/abs/2604.16503}
}我们的工作基于多个优秀的开源项目,包括 Wan2.1 VAE [Wan Team, 2025]、T5Gemma / Gemma 3 [Google]、TREAD [Krause et al., 2025]、带有 V-JEPA 系列视觉编码器的 REPA [Bardes et al.]、DDT [Wang et al.],以及更广泛的 diffusers 和 Accelerate 生态系统。计算资源由 Microsoft Azure 提供,并通过 Kubernetes 上的 SkyPilot 进行编排。
本模型基于 Apache 2.0 许可证发布。详情请参见 LICENSE。