跳转到主要内容
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 请求头,例如 2024-11-06
  • 使用 model: gen4
  • 提供源 image 以及描述运动或变换的 Prompt
  • 在叠加风格和运动向量调优之前,先让第一次请求尽量保持简单

任务流程

1

创建反向格式任务

提交 prompt、image、ratio 和选项,然后保存返回的任务 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