0蚂蚁灵波开源世界模型,基于 DiT 扩散 Transformer 架构,支持超长时序稳定生成、实时交互响应和 Zero-shot 泛化。
详细内容可以学习参考LingBot-World 技术详解与部署指南
| 配置项 | 推荐配置 |
|---|---|
| GPU | 1-2 张 NVIDIA RTX 4090 48GB(或 8×A100 80GB 用于长视频) |
| 显存 | 24-48GB |
| 系统内存 | 64GB+ |
| 存储空间 | 100GB+ |
显存不足时可使用
--t5_cpu卸载 T5 到 CPU,或使用 NF4 量化版本。
conda create -n lingbot python=3.10
conda activate lingbot
git clone https://github.com/robbyant/lingbot-world.git
cd lingbot-world
# CUDA 12.1(推荐)
pip install torch>=2.4.0 torchvision>=0.19.0 torchaudio --index-url https://download.pytorch.org/whl/cu121
# CUDA 11.8
pip install torch>=2.4.0 torchvision>=0.19.0 torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install -r requirements.txt
pip install flash-attn --no-build-isolation
HuggingFace(国际用户):
pip install "huggingface_hub[cli]"
huggingface-cli download robbyant/lingbot-world-base-cam --local-dir ./lingbot-world-base-cam
ModelScope(国内用户推荐):
pip install modelscope
modelscope download robbyant/lingbot-world-base-cam --local_dir ./lingbot-world-base-cam
NF4 量化版本(显存受限用户):
huggingface-cli download cahlen/lingbot-world-base-cam-nf4 --local_dir ./lingbot-world-base-cam-nf4
480P(4 GPU):
torchrun --nproc_per_node=4 generate.py \
--task i2v-A14B \
--size 480*832 \
--ckpt_dir lingbot-world-base-cam \
--image examples/00/image.jpg \
--action_path examples/00 \
--dit_fsdp --t5_fsdp \
--ulysses_size 4 \
--frame_num 161 \
--prompt "Your scene description here..."
720P(8 GPU):
torchrun --nproc_per_node=8 generate.py \
--task i2v-A14B \
--size 720*1280 \
--ckpt_dir lingbot-world-base-cam \
--image examples/00/image.jpg \
--action_path examples/00 \
--dit_fsdp --t5_fsdp \
--ulysses_size 8 \
--frame_num 161 \
--prompt "Your scene description here..."
python generate.py \
--task i2v-A14B \
--size 480*832 \
--ckpt_dir lingbot-world-base-cam \
--image examples/00/image.jpg \
--t5_cpu \
--frame_num 49 \
--prompt "Your scene description here..."
单 GPU 模式下建议配合
--t5_cpu并将--frame_num降至 49。
torchrun --nproc_per_node=8 generate.py \
--task i2v-A14B \
--size 480*832 \
--ckpt_dir lingbot-world-base-cam \
--image examples/00/image.jpg \
--dit_fsdp --t5_fsdp \
--ulysses_size 8 \
--frame_num 961 \
--prompt "Your scene description here..."
| 参数 | 默认值 | 说明 |
|---|---|---|
--task | i2v-A14B | 任务类型(图生视频) |
--size | 1280*720 | 输出分辨率,格式 "宽*高" |
--ckpt_dir | 必填 | 模型检查点目录 |
--image | 必填 | 输入图像路径 |
--action_path | 可选 | 相机控制信号目录(含 intrinsics.npy 和 poses.npy) |
--frame_num | 161 | 生成帧数,需满足 4n+1(如 49, 161, 321, 961) |
--prompt | 示例文本 | 场景描述文本 |
--dit_fsdp | False | 对 DiT 启用 FSDP 并行 |
--t5_fsdp | False | 对 T5 启用 FSDP 并行 |
--t5_cpu | False | 将 T5 编码器放置于 CPU(节省约 8-10GB 显存) |
--ulysses_size | 1 | 序列并行分片数(必须等于 GPU 数量) |
--base_seed | 42 | 随机种子 |
| 文件 | 格式 | 说明 |
|---|---|---|
image.jpg | PNG/JPG | 视频第一帧图像 |
intrinsics.npy | [num_frames, 4] | 相机内参 [fx, fy, cx, cy] |
poses.npy | [num_frames, 4, 4] | 相机外参变换矩阵(OpenCV 坐标系) |
prompt.txt | 文本 | 场景描述(可选,也可通过命令行 --prompt 指定) |
不提供
--action_path时,模型将根据文本提示自主决定镜头运动。
| 策略 | 操作 | 节省显存 |
|---|---|---|
| T5 CPU 卸载 | 添加 --t5_cpu | ~8-10GB |
| 降低帧数 | --frame_num 49 | 线性降低 |
| 降低分辨率 | --size 480*832 | 显著降低 |
| NF4 量化模型 | 使用量化版本权重 | ~60-70% |
| 减少 GPU 数 | 调整 --nproc_per_node 和 --ulysses_size | 按需调整 |
认证作者