影片
建立 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>"
}
}使用此端點將來源圖片製作成動畫。請將您的 CometAPI API 金鑰透過
Bearer 驗證傳送,並提供 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>"
}
}