我们推出了 MAGI-1,一个通过 自回归 预测视频块序列来生成视频的世界模型,视频块是指一段固定长度的连续帧。MAGI-1 训练用于去噪逐步增加的每块噪声,从而实现因果时序建模,天然支持流式生成。它在图像到视频(I2V)任务上表现出色,能够根据文本指令生成高质量的时序一致的视频。其高时序一致性和可扩展性得益于多项算法创新和专门的基础设施堆栈。MAGI-1 还支持通过块级提示词实现可控生成,从而支持平滑的场景过渡、长时间跨度的合成和细粒度的文本驱动控制。我们相信 MAGI-1 为将高保真度视频生成与灵活的指令控制和实时部署结合提供了一个有前景的方向。
cd /workspace/MAGI-1
bash example/4.5B/run.sh
run.sh内容如下
# Copyright (c) 2025 SandAI. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
export MASTER_ADDR=localhost
export MASTER_PORT=6009
export GPUS_PER_NODE=1
export NNODES=1
export WORLD_SIZE=1
export CUDA_VISIBLE_DEVICES=0
export PAD_HQ=1
export PAD_DURATION=1
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
export OFFLOAD_T5_CACHE=true
export OFFLOAD_VAE_CACHE=true
export TORCH_CUDA_ARCH_LIST="8.9;9.0"
MAGI_ROOT=$(git rev-parse --show-toplevel)
LOG_DIR=log_$(date "+%Y-%m-%d_%H:%M:%S").log
export PYTHONPATH="$MAGI_ROOT:$PYTHONPATH"
python3 inference/pipeline/entry.py \
--config_file example/4.5B/4.5B_base_config.json \
--mode t2v \
--prompt "Good Boy" \
--output_path example/assets/output_t2v.mp4 \
2>&1 | tee $LOG_DIR
参数说明
--config_file: 指定配置文件路径,包含模型配置参数,例如 example/24B/24B_config.json
--mode: 指定操作模式。可选项有:
t2v: 文本到视频
i2v: 图像到视频
v2v: 视频到视频
--prompt: 用于视频生成的文本提示,例如 "Good Boy"。
--image_path: 图像文件路径,仅在 i2v 模式下使用。
--prefix_video_path: 前缀视频文件路径,仅在 v2v 模式下使用。
--output_path: 生成的视频文件保存路径。
run.sh使用的配置文件为example/4.5B/4.5B_base_config.json,如需使用其他的配置文件,请参考4.5B_base_config.json