跳轉到主要內容
POST
cURL
使用 aleph2 搭配文字 Prompt 編輯來源影片。此請求會傳回一個 任務 id;擷取任務詳細資料即可取得完成的輸出。

準備請求

  • 使用您的 CometAPI API 金鑰進行驗證。
  • 將 model 設為 aleph2,並為最長 30 秒的影片提供 videoUri。
  • 選用:加入 promptText 來描述編輯內容,長度為 1 至 1,000 個 字元。使用關鍵影格時,也可以省略此欄位。
  • 請將範例媒體 URL 替換為可存取的 HTTPS URL。媒體欄位 也接受編碼大小最高 5 MB 的 Base64 資料 URI。

新增定時引導圖片

若要引導特定時刻,請在 keyframes 中提供一至五個物件。 每個物件都包含圖片 uri 和恰好一個位置: 關鍵影格時間戳記必須落在其編輯視窗內。若使用 range, 請在每個關鍵影格上設定它。否則,請從每個關鍵影格省略 range。 不需要引導圖片時,請省略 keyframes。空陣列或 null 會視為省略。

選擇畫面形狀和格式

使用 targetAspectRatio 請求擴展為 16:9、4:3、3:2、1:1 2:3, 3:4, 9:16、或 21:9。輸入影片和引導圖片會在生成前 以此形狀加上黑邊。已淘汰的 ratio 欄位 為選用項目;請使用 targetAspectRatio 控制長寬比。 若 outputFormat 為 prores,可將 proresProfile 設為 422、4444 422 Proxy, 422 LT, 422 HQ或 4444 XQ。預設設定檔為 4444。 4444 和 4444 XQ 中的 Alpha 通道為不透明。請省略 proresProfile 以使用其他輸出格式。 若要指定取樣種子,請使用 1 至 4294967295。如要使用隨機種子,請省略 seed ;0 會視為省略。

擷取結果

儲存傳回的 id,並使用 取得 Runway 任務 來擷取任務狀態。 當 status 為 SUCCEEDED 時,請從 output 讀取結果 URL。若任務 失敗,請在存在時檢查 failure 和 failureCode。

授權

Authorization
string
header
必填

Your CometAPI API key.

主體

application/json

Aleph 2 video-editing request.

model
enum<string>
必填

Model ID for this request.

可用選項:
aleph2
videoUri
必填

Input video to edit, with a maximum duration of 30 seconds. Use an accessible HTTPS URL or a Base64 data URI with an encoded size of up to 5 MB.

Required string length: 13 - 2048
Pattern: ^https://
promptText
string

Optional instruction describing the edit, from 1 to 1,000 characters. Can be omitted when using keyframes.

Required string length: 1 - 1000
keyframes
object[] | null

One to five timed guidance images. Each image uses exactly one of seconds or at. Omit when no guidance images are needed; an empty array or null is treated as omission.

Maximum array length: 5

Guidance image positioned using seconds.

targetAspectRatio
enum<string>

Target aspect ratio for expansion. The input video and keyframes are letterboxed to this shape before generation.

可用選項:
16:9,
4:3,
3:2,
1:1,
2:3,
3:4,
9:16,
21:9
ratio
string
已棄用

Deprecated aspect-ratio field. Use targetAspectRatio instead.

seed
integer

Sampling seed. Omit for a random seed; 0 is treated as omission.

必填範圍: 0 <= x <= 4294967295
outputFormat
enum<string>
必填 if proresProfile is set

Output format: mp4 for H.264 MP4, prores for ProRes MOV, png_sequence for a ZIP of PNG frames, or sdr_rec709_10bit for 10-bit Rec.709 HEVC MP4. Omit for mp4.

可用選項:
mp4,
prores,
png_sequence,
sdr_rec709_10bit
proresProfile
enum<string>

ProRes profile. Include only with outputFormat set to prores; omit for 4444. The 4444 and 4444 XQ profiles have an opaque alpha channel.

可用選項:
422,
4444,
422 Proxy,
422 LT,
422 HQ,
4444 XQ
contentModeration
object

Content moderation settings. Omit to use the standard settings.

回應

The task was created. Save its id for task retrieval.

id
string
必填

Task ID for GET /runwayml/v1/tasks/{id}.

status
string

Task state, when returned.

createdAt
string<date-time>

Task submission timestamp, when returned.

output
string<uri>[]

Result URLs, when returned.

failure
string

Failure explanation, when returned.

failureCode
string

Machine-readable failure code, when returned.

estimatedCost
object

Task estimate metadata, when returned.

cost
object

Task cost metadata, when returned.

最後修改於 2026年9月22日