{"openapi":"3.0.2","info":{"title":"kling/kling-image-o1","description":"The request body Comfy Router accepts for the model \"kling/kling-image-o1\", 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":"2f948f55402b"},"paths":{"/v2/models/kling/kling-image-o1":{"post":{"operationId":"runRouterModel","summary":"Run kling/kling-image-o1 synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"Request body for a Kling omni-image generation. `prompt` is the one field Kling requires and it stays on this Router-safe floor -- the v1 component has required it since the operation was added, and `prompt` is not a field Router fills, so requiring it costs a Router caller nothing. The `example` below is the COMFY ROUTER form and omits `model_name`, which Router fills from the `{model}` path segment.","example":{"aspect_ratio":"1:1","n":1,"prompt":"A watercolour koi pond at dawn, soft light.","resolution":"1k"},"properties":{"aspect_ratio":{"default":"auto","description":"Aspect ratio of the generated images (width:height). auto is to intelligently generate images based on incoming content.","enum":["16:9","9:16","1:1","4:3","3:4","3:2","2:3","21:9","auto"],"type":"string"},"callback_url":{"description":"The callback notification address for the result of this task. If configured, the server will actively notify when the task status changes. Ignored: comfy-api drops this field before forwarding; Comfy Router polls on your behalf.","format":"uri","type":"string"},"element_list":{"description":"Reference Element List based on element ID configuration. The sum of reference elements and reference images shall not exceed 10.","items":{"properties":{"element_id":{"description":"Element ID","format":"int64","type":"integer"}},"required":["element_id"],"type":"object"},"maxItems":10,"type":"array"},"external_task_id":{"description":"Customized Task ID. Must be unique within a single user account. Ignored: comfy-api drops this field before forwarding; Comfy Router polls on your behalf.","type":"string"},"image_list":{"description":"Reference Image List. Supports inputting image Base64 encoding or image URL (ensure accessibility). Supported formats include .jpg/.jpeg/.png. File size cannot exceed 10MB. Width and height dimensions shall not be less than 300px, aspect ratio between 1:2.5 ~ 2.5:1. The sum of reference elements and reference images shall not exceed 10.","items":{"properties":{"image":{"description":"Image Base64 encoding or image URL (ensure accessibility)","type":"string"}},"required":["image"],"type":"object"},"maxItems":10,"type":"array"},"model_name":{"description":"Model name. Omit it or send null when using Comfy Router; the model is selected by the request path. A supplied name must match that path.","nullable":true,"type":"string"},"n":{"default":1,"description":"Number of generated images. Value range [1,9].","maximum":9,"minimum":1,"type":"integer"},"prompt":{"description":"Text prompt words, which can include positive and negative descriptions. Must not exceed 2,500 characters. The Omni model can achieve various capabilities through Prompt with elements and images. Specify an image in the format of \u003c\u003c\u003c\u003e\u003e\u003e, such as \u003c\u003c\u003cimage_1\u003e\u003e\u003e.","maxLength":2500,"type":"string"},"resolution":{"default":"1k","description":"Image generation resolution. 1k is 1K standard, 2k is 2K high-res, 4k is 4K high-res.","enum":["1k","2k","4k"],"type":"string"},"result_type":{"default":"single","description":"Control whether to generate a single image or a series of images. series is not supported for kling-image-o1 (also what the v1 proxy uses when model_name is omitted); such a request is refused with HTTP 400.","enum":["single","series"],"type":"string"},"series_amount":{"default":4,"description":"Number of images in a series. Value range [2,9].","maximum":9,"minimum":2,"type":"integer"}},"required":["prompt"],"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/KlingOmniImageResponse"}],"description":"Comfy Router output schema for Kling Omni Image: the terminal `GET /v1/images/omni-image/{id}` task-query document, forwarded unchanged. The operation is submit-and-poll — `routerresult/classification.go` records `{provider: kling, endpoint: /v1/images/omni-image}` as `ReturnModeSubmitPoll` — and Router polls on the caller's behalf, so the body a caller receives is the finished task rather than the `data.task_id` handle the underlying submit answers with.\nThe envelope is the same one the Kling v1 VIDEO ids carry (`KlingVideoRouterOutput`) and `data.task_status` is the same four-value vocabulary, terminal success spelled `succeed`. What differs — and the whole reason this is its own component — is the OUTPUT leaf: the generated image is at `data.task_result.images[].url`, typed `KlingImageResult {index, url}`, and `data.task_result.videos[]` is absent on every one of these documents. A caller reusing the video leaf here would read every terminal success as producing nothing.\nRead the ELEMENT `url`, not the `images` container or the element's `index`: `index` is a sequence number, so an element carrying only an index is a non-empty array holding no image. When the request set `result_type: series` the results arrive under `data.task_result.series_images[]` instead, same `{index, url}` shape; `routerpollstate.classifyKlingImage` accepts either leaf and calls a `succeed` with neither `success_without_output`.","example":{"code":0,"data":{"created_at":1798761600000,"task_id":"kling-image-task-3c4d5e6f7a8b","task_result":{"images":[{"index":0,"url":"https://example.invalid/kling/kling-image-o1/generated.png"}],"result_type":"single"},"task_status":"succeed","task_status_msg":"","updated_at":1798761660000},"message":"SUCCEED","request_id":"6a4b2c80-1e93-4d57-b8f2-05c7e9a3d146"}}}}}}}}},"components":{"schemas":{"KlingImageResult":{"properties":{"index":{"description":"Image Number (0-9)","type":"integer"},"url":{"description":"URL for generated image","format":"uri","type":"string"}},"type":"object"},"KlingOmniImageResponse":{"properties":{"code":{"description":"Error code","type":"integer"},"data":{"properties":{"created_at":{"description":"Task creation time, Unix timestamp in milliseconds","type":"integer"},"final_unit_deduction":{"description":"The deduction units of task","type":"string"},"task_id":{"description":"Task ID","type":"string"},"task_info":{"properties":{"external_task_id":{"description":"Customer-defined task ID","type":"string"}},"type":"object"},"task_result":{"properties":{"images":{"items":{"$ref":"#/components/schemas/KlingImageResult"},"type":"array"},"result_type":{"description":"Whether the result is a single image or a series of images","enum":["single","series"],"type":"string"},"series_images":{"description":"Series images result list","items":{"properties":{"index":{"description":"Series-image sequence number","type":"integer"},"url":{"description":"URL for generated image","format":"uri","type":"string"}},"type":"object"},"type":"array"}},"type":"object"},"task_status":{"$ref":"#/components/schemas/KlingTaskStatus"},"task_status_msg":{"description":"Task status information, displaying the failure reason when the task fails (such as triggering the content risk control of the platform, etc.)","type":"string"},"updated_at":{"description":"Task update time, Unix timestamp in milliseconds","type":"integer"}},"type":"object"},"message":{"description":"Error message","type":"string"},"request_id":{"description":"Request ID","type":"string"}},"type":"object"},"KlingTaskStatus":{"description":"Task Status","enum":["submitted","processing","succeed","failed"],"type":"string"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"kling/kling-image-o1","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"]}
