Skip to main content
POST
Usa questo endpoint per generare un’immagine da un Prompt, con immagini di riferimento facoltative immagini per gen4_image. Invia la tua chiave API CometAPI con autenticazione Bearer e un corpo della richiesta JSON.

Scegli un modello e i riferimenti

Ogni richiesta richiede model, promptText e ratio. Per gen4_image_turbo, referenceImages è obbligatorio e deve contenere da una a tre immagini. Ogni oggetto di riferimento contiene un uri dell’immagine e un tagfacoltativo. Usa un tag di 3-16 lettere minuscole, cifre o trattini bassi, che inizi con una lettera. Fai riferimento a esso in promptText come @tag, ad esempio @cat_ref. Gli URI delle immagini accettano URL HTTPS accessibili o URI di dati immagine Base64 fino a 5 MB. Il Prompt accetta da 1 a 1.000 unità di codice UTF-16.

Scegli le dimensioni

Imposta ratio su una delle coppie di dimensioni esatte nello schema. Ad esempio, 1024:1024 richiede un’immagine quadrata, 1280:720 un’immagine orizzontale e 720:1280 un’immagine verticale. Usa ratio per selezionare le dimensioni; non inviare resolutionsize con questi modelli. Per un seed di campionamento esplicito, usa 1 fino a 4294967295. L’omissione o 0 seleziona un seed casuale. Se includi contentModeration, imposta il relativo publicFigureThreshold su auto o low; altrimenti ometti l’oggetto.

Recupera il risultato

Salva il valore id restituito e usa Recupera un’attività Runway. Quando status è SUCCEEDED, leggi gli URL delle immagini generate in output.

Autorizzazioni

Authorization
string
header
obbligatorio

Use your CometAPI API key.

Corpo

application/json

Request parameters for gen4_image.

model
enum<string>
obbligatorio

Model ID for this request variant.

Opzioni disponibili:
gen4_image
Allowed value: "gen4_image"
promptText
string
obbligatorio

Describe the requested scene or motion in 1 to 1,000 UTF-16 code units.

Required string length: 1 - 1000
ratio
enum<string>
obbligatorio

Requested output dimensions, expressed as width:height. Choose a value listed for this model and endpoint.

Opzioni disponibili:
1024:1024,
1080:1080,
1168:880,
1360:768,
1440:1080,
1080:1440,
1808:768,
1920:1080,
1080:1920,
2112:912,
1280:720,
720:1280,
720:720,
960:720,
720:960,
1680:720
seed
integer

Optional sampling seed. Use a positive integer for an explicit seed. Omission or 0 selects a random seed.

Intervallo richiesto: 0 <= x <= 4294967295
referenceImages
object[]

Optional array of up to three reference images. Omit it or use an empty array for text-only generation.

Maximum array length: 3
contentModeration
object

Optional content moderation settings. Omit the object to use standard moderation.

Risposta

Task submitted. Save its id to retrieve task status.

id
string
obbligatorio

Task ID for GET /runwayml/v1/tasks/{id}.

status
string

Task state, when returned.

createdAt
string<date-time>

Task submission timestamp, when returned.

output
string<uri>[]

Result URLs, when returned.

failure
string

Failure explanation, when returned.

failureCode
string

Machine-readable failure code, when returned.

estimatedCost
object

Task estimate metadata, when returned.

cost
object

Task cost metadata, when returned.

Ultima modifica il 18 settembre 2026