Passer au contenu principal
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
}
Utilisez ce endpoint lorsque vous voulez la route generate au format inversé de Runway avec une ou plusieurs images de référence.

Avant de l’appeler

  • Envoyez l’en-tête X-Runway-Version requis, par exemple 2024-11-06
  • Utilisez model: gen4
  • Fournissez l’image source et le prompt décrivant le mouvement ou la transformation
  • Gardez la première requête simple avant d’ajouter du style et l’ajustement du vecteur de mouvement

Flux de tâche

1

Créer la tâche au format inversé

Soumettez le prompt, l’image, le ratio et les options, puis enregistrez l’id de tâche renvoyé.
2

Interroger la tâche

Poursuivez avec Feed Get Task. Si la première interrogation renvoie task_not_exist, attendez quelques secondes puis réessayez.
3

Conserver le résultat

Lorsque la tâche est terminée, stockez l’asset final dans votre propre pipeline média si vous avez besoin d’une conservation longue durée.

Autorisations

Authorization
string
header
requis

Bearer token authentication. Use your CometAPI key.

En-têtes

X-Runway-Version
string

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

Corps

application/json
callback_url
string
défaut:https://example.com/webhook
requis

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

ratio
string
défaut:1280:720
requis

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

prompt
string
défaut:A paper boat gently rocks on calm water.
requis

Text prompt describing the desired video content or motion.

model
string
défaut:gen4
requis

Model version to use, e.g. gen4.

image
string
défaut:https://db.xiaohuhd.com/1.jpeg
requis

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.

Réponse

200 - application/json

OK

code
integer
requis

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

msg
string
requis

Text description of the status code

data
object
requis

Specific response data content

exec_time
number
requis

Time spent processing this request