{"openapi":"3.0.2","info":{"title":"runway/gen4_image","description":"The request body Comfy Router accepts for the model \"runway/gen4_image\", and the response body it returns. The INPUT schema is the same schema the server validates a call against before it reaches the provider, so what is published and what is enforced cannot differ. `x-comfy-router-input-modalities` records the media kinds the model is documented to accept; the request schema is shared across sibling models and may admit media kinds this model ignores. The OUTPUT schema describes the provider's native result document exactly as Router returns it: Router does not validate, narrow or re-envelope the response, so the output schema is descriptive rather than enforced, and Comfy owns no output shape of its own.","version":"9c4cecd6c0af"},"paths":{"/v2/models/runway/gen4_image":{"post":{"operationId":"runRouterModel","summary":"Run runway/gen4_image synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"example":{"promptText":"a red circle","ratio":"1024:1024"},"properties":{"model":{"description":"Model to use for generation. On the Comfy Router route `POST /v2/models/runway/{model}` this field is supplied from the path and MUST NOT be sent; on the v1 `POST /proxy/runway/text_to_image` route it is required and constrained to `gen4_image`.","nullable":true,"type":"string"},"promptText":{"description":"Text prompt for the image generation, at most 1000 UTF-16 code units (a character outside the Basic Multilingual Plane, such as most emoji, counts as two)","maxLength":1000,"type":"string"},"ratio":{"$ref":"#/components/schemas/RunwayTextToImageAspectRatioEnum"},"referenceImages":{"description":"Array of reference images to guide the generation","items":{"properties":{"uri":{"description":"A HTTPS URL, Runway upload URI (runway://) or data URI containing an encoded image","type":"string"}},"required":["uri"],"type":"object"},"maxItems":3,"type":"array"}},"required":["promptText","ratio"],"type":"object"}}}},"responses":{"200":{"description":"OK - the model's native JSON output, returned unchanged; the schema describes the provider's terminal result document as Router returns it.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RunwayTaskStatusResponse"},{"properties":{"output":{"description":"The finished generation's asset URLs — for `runway/gen4_image` each element is an IMAGE URL. Present once the task terminates successfully; this list IS the result.","items":{"type":"string"},"type":"array"}},"type":"object"}],"description":"Comfy Router output schema for the Runway image model: the terminal `GET /v1/tasks/{id}` document, forwarded unchanged. `runway/gen4_image` is SUBMIT-AND-POLL DESPITE being an image generation — `routerresult/classification.go` records `{provider: runway, endpoint: /text_to_image}` as `ReturnModeSubmitPoll`, sharing the one `GET /proxy/runway/tasks/{task_id}` poll route its video siblings use — because Runway's images go through the same task queue its videos do and are collected from the same status route. Router polls on the caller's behalf, so the body a caller receives is the finished task rather than the `{\"id\": ...}` handle the underlying submit answers with.\nTHE ASSET IS THE `output` LIST ITSELF. `output` is an array of URL STRINGS — not objects with a URL inside — so the leaf a caller reads is `output[]`, and there is no deeper field to key completion off. For this model its element is a GENERATED IMAGE URL. The video models of the same family answer the same document with a video URL in that list; see `RunwayVideoRouterOutput`.\n`output` is absent until the task reaches a terminal state, and a `SUCCEEDED` task carrying an empty `output` is a success that produced nothing — `routerpollstate.classifyRunway` (`FamilyRunway`) draws exactly that line, keying success on a non-empty `output` and answering `success_without_output` otherwise. Through Router that distinction is already settled, because such a task is answered as a Comfy Router error rather than with this document, so a `200` here always carries at least one URL.\nThe URLs are served from Runway's own asset host and are NOT permanent — download them promptly rather than storing them. `status` is Runway's own UPPERCASE vocabulary (`PENDING`, `RUNNING`, `THROTTLED`, `SUCCEEDED`, `FAILED`, `CANCELLED`); `SUCCEEDED` is the one terminal success, `FAILED` and `CANCELLED` are terminal failures, and the classifier upper-cases before comparing. `progress` is populated only while `status` is `RUNNING`, so it is not present on the document Router returns.","example":{"createdAt":"2027-01-01T00:00:00Z","id":"5f7c1b28-9a03-4e61-8d2f-1b2c3d4e5f60","output":["https://example.invalid/runway/gen4_image/generated.png"],"status":"SUCCEEDED"}}}}}}}}},"components":{"schemas":{"RunwayTaskStatusEnum":{"description":"Possible statuses for a Runway task.","enum":["SUCCEEDED","RUNNING","FAILED","PENDING","CANCELLED","THROTTLED"],"type":"string"},"RunwayTaskStatusResponse":{"properties":{"createdAt":{"description":"Task creation timestamp","format":"date-time","type":"string"},"id":{"description":"Task ID","type":"string"},"output":{"description":"Array of the finished task's output asset URLs. This route is shared by every Runway model, so the medium follows the model that was submitted - a video URL for the image_to_video and video_to_video models, an image URL for the text_to_image model.","items":{"type":"string"},"type":"array"},"progress":{"description":"Float value between 0 and 1 representing the progress of the task. Only available if status is RUNNING.","format":"float","maximum":1,"minimum":0,"type":"number"},"status":{"$ref":"#/components/schemas/RunwayTaskStatusEnum"}},"required":["id","status","createdAt"],"type":"object"},"RunwayTextToImageAspectRatioEnum":{"enum":["1920:1080","1080:1920","1024:1024","1360:768","1080:1080","1168:880","1440:1080","1080:1440","1808:768","2112:912","1280:720","720:1280","720:720","960:720","720:960","1680:720"],"type":"string"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"runway/gen4_image","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["text","image"],"x-comfy-router-output-modalities":["image"]}
