Chuyển đến nội dung chính
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
}
Sử dụng endpoint này khi bạn muốn dùng route generate định dạng đảo ngược của Runway với một hoặc nhiều hình ảnh tham chiếu.

Trước khi gọi

  • Gửi header X-Runway-Version bắt buộc, ví dụ 2024-11-06
  • Sử dụng model: gen4
  • Cung cấp image nguồn và prompt mô tả chuyển động hoặc biến đổi
  • Giữ yêu cầu đầu tiên đơn giản trước khi thêm các tinh chỉnh về style và motion-vector

Luồng tác vụ

1

Tạo tác vụ định dạng đảo ngược

Gửi prompt, image, ratio và các tùy chọn, sau đó lưu task id được trả về.
2

Poll tác vụ

Tiếp tục với Feed Get Task. Nếu lần poll đầu tiên trả về task_not_exist, hãy đợi vài giây rồi thử lại.
3

Lưu trữ kết quả

Khi tác vụ hoàn tất, hãy lưu asset cuối cùng vào media pipeline của riêng bạn nếu cần lưu giữ lâu dài.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer token authentication. Use your CometAPI key.

Tiêu đề

X-Runway-Version
string

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

Nội dung

application/json
callback_url
string
mặc định:https://example.com/webhook
bắt buộc

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

ratio
string
mặc định:1280:720
bắt buộc

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

prompt
string
mặc định:A paper boat gently rocks on calm water.
bắt buộc

Text prompt describing the desired video content or motion.

model
string
mặc định:gen4
bắt buộc

Model version to use, e.g. gen4.

image
string
mặc định:https://db.xiaohuhd.com/1.jpeg
bắt buộc

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.

Phản hồi

200 - application/json

OK

code
integer
bắt buộc

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

msg
string
bắt buộc

Text description of the status code

data
object
bắt buộc

Specific response data content

exec_time
number
bắt buộc

Time spent processing this request