视频
创建 Runway 图像转视频任务
使用 Gen-4.5 或 Gen-4 Turbo 为源图像添加动画,并以 Runway 任务形式获取结果。
POST
/
runwayml
/
v1
/
image_to_video
curl "https://api.cometapi.com/runwayml/v1/image_to_video" \
--request POST \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "gen4.5",
"promptImage": "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg",
"promptText": "The cat turns toward the camera.",
"ratio": "1280:720",
"duration": 5
}'{
"id": "00000000-0000-4000-8000-000000000001"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}使用此端点为源图像添加动画。请通过
Bearer 身份验证发送您的 CometAPI API 密钥,并使用 JSON 请求正文。
对于纯文本请求,请使用 创建 Runway 文本转视频任务.
选择模型
| 模型 | 必填字段 | 动作 Prompt |
|---|---|---|
gen4.5 | model, promptImage, promptText, ratio, duration | 在中描述动作 promptText. |
gen4_turbo | model, promptImage, ratio | 可选地,在 promptText 中描述动作,长度为 1 到 1,000 个 UTF-16 代码单元。 |
提供首帧
将promptImage 设置为可访问的 HTTPS 图像 URL 或 Base64 图像数据 URI。
您还可以提供一个仅含 uri 和 position: "first" 的单项数组。
此接口接受一个起始帧;请勿添加末帧条目。
HTTPS 图像必须可直接访问且无需重定向,并具有有效的
图像内容标头。编码后的图像数据 URI 最大可为 5 MB。请参阅
Runway 媒体输入要求
以了解图像格式和尺寸。
设置时长和尺寸
使用从duration 到 2 秒的整数 10。该字段对于
gen4.5 为必填项,对于 gen4_turbo 为可选项。
将 ratio 设置为 1280:720、720:1280、1104:832、960:960、832:1104 或
1584:672。这些是以冒号分隔的宽度和高度值。
如需指定采样种子,请使用 1 到 4294967295。省略该字段或使用 0
会选择随机种子。如果包含 contentModeration,请将其
publicFigureThreshold 设置为 auto 或 low;否则请省略该对象。
选择输出格式
gen4.5 接受 outputFormat,用于 MP4、ProRes、PNG 序列以及 HDR
格式,这些格式列于请求架构中。若使用 H.264 MP4,请省略该字段。
proresProfile 仅适用于 prores 和 hdr_prores;其允许的值
取决于所选格式。使用 gen4_turbo 时请省略这两个字段。
获取结果
保存返回的id,然后使用 获取 Runway 任务.
当 status 为 SUCCEEDED 时,请从 output 中读取结果 URL。请求体
application/json
- gen4.5
- gen4_turbo
Request parameters for gen4.5.
Output encoding. Omit for mp4 (H.264). prores returns MOV; png_sequence returns a PNG ZIP; sdr_rec709_10bit returns 10-bit Rec.709 HEVC. hdr10 and hlg return 10-bit HDR MP4; hdr_pq_12bit_master returns 12-bit HEVC MOV; hdr_prores returns HDR ProRes MOV. The HDR PNG/EXR sequence formats return ZIP archives; the ACEScg variants target the named ACES version.
可用选项:
mp4, prores, png_sequence, hdr10, hlg, sdr_rec709_10bit, hdr_pq_12bit_master, hdr_prores, hdr_png_sequence, hdr_exr_sequence, hdr_exr_acescg_sequence_1_3, hdr_exr_acescg_sequence_2_0 响应
Task submitted. Save its id to retrieve task status.
最后修改于 2026年9月22日
⌘I
curl "https://api.cometapi.com/runwayml/v1/image_to_video" \
--request POST \
--header "Authorization: Bearer $COMETAPI_KEY" \
--header "Content-Type: application/json" \
--data '{
"model": "gen4.5",
"promptImage": "https://upload.wikimedia.org/wikipedia/commons/3/3a/Cat03.jpg",
"promptText": "The cat turns toward the camera.",
"ratio": "1280:720",
"duration": 5
}'{
"id": "00000000-0000-4000-8000-000000000001"
}{
"code": "<string>",
"message": "<string>",
"data": "<unknown>"
}{
"error": {
"message": "<string>",
"type": "<string>",
"code": "<string>"
}
}