Midjourney 图生视频任务提交 API 接口文档
介绍
本API用于基于文本提示和首帧图片生成动态视频。支持不同的动作幅度控制,并可选择扩展已有视频动作。
模型名称
Mj_fast_video
接口地址
https://www.dmxapi.cn/mj-fast/mj/submit/video
请求参数
参数名 | 类型 | 是否必需 | 约束/枚举值 | 描述 |
---|---|---|---|---|
prompt | string | 可选 | - | 视频生成提示文本 |
motion | string | 必需 | low , high , image | 视频动作幅度:low(低), high(高), image(图片模式) |
image | string | 必需 | - | 首帧图片(Base64编码或URL) |
action | string | 可选 | extend | 扩展动作类型,需配合index 和taskId 使用 |
index | integer | 可选 | 0-3 | 视频索引号(0到3) |
taskId | string | 可选 | - | 父任务ID(与action联用时必填) |
state | string | 可选 | - | 自定义状态参数 |
notifyHook | string | 可选 | - | 异步结果回调地址 |
noStorage | string | 可选 | True | 设为True返回官方链接(不存储结果) |
示例代码
python
import json
import requests
url = "https://www.dmxapi.cn/mj-fast/mj/submit/video"
API_KEY = "sk-**************************************" # 填上你的 DMXAPI 令牌
payload = json.dumps(
{
"prompt": "书慢慢打开,魔法从里面跑出来",
"motion": "low",
"image": "https://dmxapi.cn/img/doc1.png",
}
)
headers = {"Authorization": "Bearer " + API_KEY, "Content-Type": "application/json"}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
返回示例
json
{
"code": 1,
"description": "Submit Success",
"result": "1757399847039557" # 用这个ID去任务查询接口看结果
}