Перейти до основного вмісту
POST
/
runway
/
pro
/
generate
Create a compatibility-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
}
Використовуйте цей endpoint, коли вам потрібен маршрут generate у compatibility-format від Runway з одним або кількома референсними зображеннями.

Перед викликом

  • Надішліть обов’язковий заголовок X-Runway-Version, наприклад 2024-11-06
  • Використовуйте model: gen4
  • Надайте вихідне image і prompt, який описує рух або трансформацію
  • Спочатку зробіть перший запит простим, перш ніж додавати стиль і налаштування motion-vector

Потік завдання

1

Створіть завдання у compatibility-format

Надішліть prompt, image, ratio та параметри, а потім збережіть отриманий task id.
2

Опитуйте завдання

Продовжуйте з Feed Get Task. Якщо перше опитування повертає task_not_exist, зачекайте кілька секунд і повторіть спробу.
3

Збережіть результат

Коли завдання буде завершено, збережіть фінальний asset у власному media pipeline, якщо вам потрібне тривале зберігання.

Авторизації

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