主题
提交视频生成任务
POST
https://az.gptplus5.com/runwayml/v1/image_to_video
官方文档:https://docs.dev.runwayml.com/api/#tag/Start-generating/paths/~1v1~1image_to_video/post
请求参数
Authorization
在 Header 添加参数Authorization,其值为在 Bearer 之后拼接 Token
示例:Authorization: Bearer ********************
Header 参数
| 参数名 | 类型 | 必需 | 说明 | 示例 |
|---|---|---|---|---|
Content-Type | string | 必需 | application/json | |
Accept | string | 必需 | application/json | |
Authorization | string | 必需 | Bearer {{YOUR_API_KEY}} |
Body 参数 (application/json)
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
promptImage | string | 必需 | 必填,HTTPS URL或数据URI,包含编码图像作为生成视频的第一帧 |
model | string | 必需 | 必填,指定使用的模型变体,可选值:"gen4_turbo"或"gen3a_turbo" |
ratio | string | 必需 | 必填,输出视频分辨率,格式为"宽度:高度",不同模型支持不同分辨率 |
seed | integer | 必需 | 可选,随机种子值(0-4294967295),相同种子对相同请求产生相似结果 |
promptText | string | 必需 | 可选,字符串(≤1000字符),详细描述期望在视频中出现的内容 |
duration | integer | 必需 | 可选,视频时长(秒),可选值:5或10,默认为10 |
请求示例
json
{
"promptImage": "https://www.bt.cn/bbs/template/qiao/style/image/btlogo.png",
"model": "gen4_turbo",
"promptText": "cat dance",
"watermark": false,
"duration": 5,
"ratio": "1280:768"
}cURL 示例
bash
curl --location --request POST 'https://az.gptplus5.com/runwayml/v1/image_to_video' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"promptImage": "https://www.bt.cn/bbs/template/qiao/style/image/btlogo.png",
"model": "gen4_turbo",
"promptText": "cat dance",
"watermark": false,
"duration": 5,
"ratio": "1280:768"
}'返回响应
🟢200成功
响应 Body
| 参数名 | 类型 | 必需 | 说明 |
|---|---|---|---|
code | integer | 必需 | |
message | string | 必需 | |
request_id | string | 必需 | |
data | object | 必需 | |
└ task_id | string | 必需 | |
└ task_status | string | 必需 | |
└ created_at | integer | 必需 | |
└ updated_at | integer | 必需 |
响应示例
json
{
"id": "4665a07c-7641-4809-a133-10786201bb56",
"prompt": "",
"state": "pending",
"queue_state": null,
"created_at": "2024-12-22T13:38:40.139409Z",
"batch_id": "",
"video": null,
"video_raw": null,
"liked": null,
"estimate_wait_seconds": null,
"thumbnail": null,
"last_frame": null
}