跳轉到主要內容
POST
/
runway
/
pro
/
generate
Create a reverse-format Runway generate task
curl --request POST \
  --url https://api.cometapi.com/runway/pro/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "callback_url": "http://baidu.com",
  "image": "https://db.xiaohuhd.com/1.jpeg",
  "model": "gen4",
  "prompt": "Smile, Eat Burger"
}
'
{
  "code": 123,
  "msg": "<string>",
  "data": {
    "task_id": "<string>"
  },
  "exec_time": 123
}
當你想使用 Runway 反向格式的 generate 路由,並搭配一張或多張參考圖片時,請使用此端點。

呼叫之前

  • 傳送必要的 X-Runway-Version header,例如 2024-11-06
  • 使用 model: gen4
  • 提供來源 image 與描述動作或轉換的 prompt
  • 在疊加風格與運動向量微調之前,先讓第一個請求保持簡單

任務流程

1

建立反向格式任務

提交 prompt、image、ratio 與選項,然後儲存回傳的 task id。
2

輪詢任務

接著使用 Feed Get Task。如果第一次輪詢回傳 task_not_exist,請等待幾秒後重試。
3

保存結果

當任務完成後,如果你需要長期保留,請將最終資產儲存到你自己的媒體處理流程中。

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

標頭

X-Runway-Version
string

Optional Runway version header, for example 2024-11-06.

主體

application/json
callback_url
string
預設值:https://example.com/webhook
必填

Webhook URL that receives a POST request with the result when the task completes.

ratio
string
預設值:1280:720
必填

Aspect ratio of the generated video, e.g. 1280:720.

prompt
string
預設值:A paper boat gently rocks on calm water.
必填

Text prompt describing the desired video content or motion.

model
string
預設值:gen4
必填

Model version to use, e.g. gen4.

image
string
預設值:https://db.xiaohuhd.com/1.jpeg
必填

URL of the source image to animate.

style
string

Artistic style for the generated video, e.g. cinematic.

options
object

Advanced generation options.

last_image
string

URL of the end-frame image. When provided, the video transitions toward this frame.

回應

200 - application/json

OK

code
integer
必填

HTTP status code or business status code, 200 usually indicates success

msg
string
必填

Text description of the status code

data
object
必填

Specific response data content

exec_time
number
必填

Time spent processing this request