MiniMax-H3-AX8860 / README.md
zheqiushui's picture
Add files using upload-large-folder tool
ab9bd64 verified
|
Raw History Blame Contribute Delete
5.64 kB
metadata
license: other
language:
  - zh
  - en
pipeline_tag: text-to-video
tags:
  - axera
  - ax8860
  - minimax-h3

MiniMax-H3 for AX8860

MiniMax-H3 视频模型在 AX8860 上的模型文件:文本编码器、视觉编码器、DiT、视频 VAE、音频 VAE 全部在 NPU 上执行, 4 步蒸馏采样,无 CFG,输出 24 fps 视频和 32 kHz 立体声音频。

  • 文生视频(txt2video)
  • 首帧生视频(img2video):一张首帧图 + 提示词
  • 参考图生视频(ref2video):1–3 张参考图 + 提示词,参考图里的主体和场景出现在视频里

推理程序(C++,命令行 + HTTP 服务 + 网页):axdiffusion.cpp

目录

MiniMax-H3-AX8860/         文生视频、首帧生视频
MiniMax-H3-Ref2V-AX8860/   参考图生视频(另一套 DiT 权重)
bin/                       预编译的 axdiffusion-cli、axdiffusion-server(aarch64)

两个文件夹各是一个完整的模型目录,结构与 MiniMax-H3-Image-AX8860 相同,可以单独使用:

axdiffusion.json   模型描述
axmodels/          全部 kernel 和清单
config/            采样、预设、格式说明
dit/               DiT 权重
text_encoder/      文本编码器权重(与 MiniMax-H3-Image 相同)
vit/               视觉编码器权重(与 MiniMax-H3-Image 相同)
vae/               视频解码器、音频解码器权重

一个进程加载一个模型目录:加载 MiniMax-H3-AX8860 提供文生视频和首帧生视频,加载 MiniMax-H3-Ref2V-AX8860 提供参考图生视频。只用其中一种时只下载对应的文件夹即可。

预设

768p 与官方一致,6 种画幅,各有 3 秒(73 帧)和 5 秒(124 帧);480p 只有 16:9。

画幅 768p 输出 480p 输出
21:9 1536×672 —
16:9 1344×768 864×480
4:3 1024×768 —
1:1 768×768 —
3:4 768×1024 —
9:16 768×1344 —

命令行用 --aspect 选画幅(默认 16:9)。首帧生视频不指定画幅时取最接近首帧图的一档,首帧图居中裁到该画幅再缩放。 参考图保持比例,短边缩放到 768。

性能

768p 各画幅文生视频(进程启动后第一次请求,总耗时 / NPU 内存峰值):

画幅 3 秒 5 秒
21:9 228 s / 35.9 GiB 523 s / 39.2 GiB
16:9 229 s / 35.9 GiB 520 s / 39.0 GiB
4:3 165 s / 34.6 GiB 360 s / 37.3 GiB
1:1 116 s / 33.5 GiB 228 s / 35.3 GiB
3:4 164 s / 34.6 GiB 360 s / 37.3 GiB
9:16 229 s / 35.9 GiB 523 s / 39.2 GiB

768p 16:9 5 秒各任务:

任务 总耗时 去噪 4 步 视频解码 NPU 内存峰值
文生视频 520 s 478 s 41 s 39.0 GiB
首帧生视频 576 s 517 s 43 s 42.0 GiB
参考图生视频(1 张 16:9 参考图) 575 s 521 s 41 s 41.4 GiB

480p:

任务 3 秒 5 秒
文生视频 67 s 126 s
首帧生视频 73 s 165 s
参考图生视频(1 张参考图) 102 s 166 s
参考图生视频(2 张参考图) 121 s —
  • 测试条件:AX8860(SDK 0.6.0),4 核 NPU,4 步。480p 的文生视频和首帧生视频为常驻进程内连续请求的实测值, 其余为进程启动后第一次请求。
  • 启动(全部权重入 NPU 内存)约 26 s,加载后常驻 NPU 内存约 29.5 GiB;480p 时峰值 32–36 GiB。
  • 系统内存占用很小:768p 时进程常驻内存峰值约 1.1 GiB。
  • 首帧或参考图的 VAE 编码约 4–6 s,已包含在总耗时里。

使用

输出 H.264 + AAC 的 MP4 需要板子上装有 ffmpeg(例如 apt install ffmpeg,在 PATH 中即可); 没有时改写 Motion-JPEG AVI 和 WAV。

# 文生视频
./bin/axdiffusion-cli --model MiniMax-H3-AX8860 --task txt2video \
    --prompt "An aerial shot of a red cabin by a frozen lake at sunrise" \
    --resolution 768p --duration 5 --out t2v.mp4

# 竖屏 9:16、3 秒
./bin/axdiffusion-cli --model MiniMax-H3-AX8860 --task txt2video \
    --prompt "Vertical phone video. A woman stands on a city street at night, smiling and waving at the camera" \
    --resolution 768p --aspect 9:16 --duration 3 --out t2v_9x16.mp4

# 首帧生视频
./bin/axdiffusion-cli --model MiniMax-H3-AX8860 --task img2video --image first.png \
    --prompt "The family starts eating, steam rises from the bowls" \
    --resolution 768p --duration 5 --out i2v.mp4

# 参考图生视频(--image 可重复 1–3 次)
./bin/axdiffusion-cli --model MiniMax-H3-Ref2V-AX8860 --task ref2video --image ref.png \
    --prompt "The woman from the picture laughs and picks up noodles with chopsticks" \
    --resolution 768p --duration 5 --out r2v.mp4

# HTTP 服务 + 网页(浏览器打开 http://板子地址:18500/)
./bin/axdiffusion-server --model MiniMax-H3-AX8860 --port 18500

HTTP 接口为异步的 /v1/videos,说明见程序仓库的 docs/api.md。

限制

  • 步数固定为 4;480p 只有 16:9。
  • 竖屏(3:4、9:16)配横向场景的提示词(如海边奔跑的跟拍)时,模型偶尔会把整个画面横躺着生成;提示词写明竖拍、 人物站立等竖构图内容即可。
  • 参考图生视频使用 2–3 张参考图时,480p 3 秒已验证(2 张);768p 下多张参考图会超出现有的序列长度上限。

许可

模型权重来自 MiniMax-H3,版权归 MiniMax 所有,使用须遵守上游模型仓库的许可协议。