{"openapi":"3.0.2","info":{"title":"kling/videos-avatar-image2video","description":"The request body Comfy Router accepts for the model \"kling/videos-avatar-image2video\", 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":"1c2a3ba2064f"},"paths":{"/v2/models/kling/videos-avatar-image2video":{"post":{"operationId":"runRouterModel","summary":"Run kling/videos-avatar-image2video synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"Generate an avatar video from an image and exactly one audio source: audio_id or sound_file.","example":{"image":"https://example.invalid/kling/avatar.png","mode":"std","prompt":"The presenter smiles and gestures towards the camera.","sound_file":"https://example.invalid/kling/voice.mp3"},"oneOf":[{"required":["audio_id"]},{"required":["sound_file"]}],"properties":{"audio_id":{"description":"Audio ID Generated via TTS API. Only supports 2-300 second audio generated within the last 30 days. Either audio_id or sound_file must be provided (mutually exclusive).","type":"string"},"callback_url":{"description":"The callback notification address for the result of this task. Ignored: comfy-api drops this field before forwarding; Comfy Router polls on your behalf.","format":"uri","type":"string"},"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":{"description":"Avatar Reference Image. Supports Base64 encoding or image URL. Supported formats: .jpg/.jpeg/.png. Max 10MB, min 300px width/height, aspect ratio between 1:2.5 and 2.5:1.","type":"string"},"mode":{"$ref":"#/components/schemas/KlingAvatarMode"},"prompt":{"description":"Positive text prompt. Can define avatar actions, emotions, and camera movements.","maxLength":2500,"type":"string"},"sound_file":{"description":"Sound File. Supports Base64-encoded audio or accessible audio URL. Accepted formats: .mp3/.wav/.m4a/.aac (max 5MB), 2-300 seconds. Either audio_id or sound_file must be provided (mutually exclusive).","type":"string"},"watermark_info":{"properties":{"enabled":{"description":"Whether to generate watermarked results simultaneously.","type":"boolean"}},"type":"object"}},"required":["image"],"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/KlingQueryTaskResponse"}],"description":"Comfy Router output schema for the Kling v1 VIDEO models: the terminal `GET /v1/videos/{operation}/{id}` task-query document, forwarded unchanged. Every Kling v1 operation is SUBMIT-AND-POLL, each polled on `\u003csubmit path\u003e/:id` — the operations this component covers, `/v1/videos/text2video`, `/v1/videos/omni-video` and `/v1/videos/avatar/image2video`, and the lip-sync sibling documented separately alike — and Router polls on the caller's behalf, so the body a caller receives is the finished task rather than the `{code, message, request_id, data.task_id}` handle the underlying `/proxy/kling/*` submit answers with.\nThe generated video's download URL is at `data.task_result.videos[].url`. Read the ELEMENT field, not the `videos` container: `KlingVideoResult` is `{id, url, watermark_url, duration}`, so a one-element list carrying an id and a duration and no URL is a non-empty array holding nothing playable. `data.task_result.videos[].watermark_url` is the same asset under Kling's hotlink-protection form and counts as a result; `routerpollstate.classifyKling` draws exactly that line, and a `succeed` carrying neither is `success_without_output` rather than a finished generation.\n`data.task_status` is Kling's own four-value vocabulary — `submitted`, `processing`, `succeed`, `failed` — and the terminal success spells it `succeed`, NOT `succeeded`. The `kling/kling-3.0-turbo` sibling (`KlingV2RouterOutput`) says `succeeded` and carries an entirely different document; the two vocabularies are deliberately not folded together.\nThe operations share this component because they share this document, and the ids are grouped by operation in the list above: text2video is the family's primary and admits every create-task id, so `kling/kling-v3-omni` and `kling/kling-video-o1` are the pair that resolves onto omni-video. The last id is a route-slug model — `kling/videos-avatar-image2video`, the only id on its own operation. Its document is typed separately in the v1 contract (`KlingAvatarResponse`) but declares the same property set as `KlingQueryTaskResponse`, envelope and `data.task_result.videos[]` leaf alike, which is why it is documented here rather than as a near-identical component of its own. Its route-slug sibling is NOT: `kling/videos-lip-sync` answers a strictly NARROWER envelope and is authored by `KlingLipSyncRouterOutput`. `kling/videos-avatar-image2video` publishes its own example, on its own model page; the five generation-id pages carry the shared text2video one.","example":{"code":0,"data":{"created_at":1798761600000,"task_id":"kling-avatar-task-8b7a6c5d4e3f","task_result":{"videos":[{"duration":"10","id":"kling-video-1c2d3e4f5a6b","url":"https://example.invalid/kling/videos-avatar-image2video/generated.mp4"}]},"task_status":"succeed","task_status_msg":"","updated_at":1798761900000},"message":"SUCCEED","request_id":"b41d7c58-9e26-4f03-a7d1-5c8e0b3f2a69"}}}}}}}}},"components":{"schemas":{"KlingAvatarMode":{"default":"std","description":"Video generation mode. std: Standard Mode (cost-effective), pro: Professional Mode (longer duration, higher quality).","enum":["std","pro"],"type":"string"},"KlingQueryTaskResponse":{"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":{"type":"string"}},"type":"object"},"task_result":{"properties":{"videos":{"items":{"$ref":"#/components/schemas/KlingVideoResult"},"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","type":"string"},"updated_at":{"description":"Task update time, Unix timestamp in milliseconds","type":"integer"},"watermark_info":{"properties":{"enabled":{"type":"boolean"}},"type":"object"}},"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"},"KlingVideoResult":{"properties":{"duration":{"description":"Total video duration in seconds","type":"string"},"id":{"description":"Generated video ID","type":"string"},"url":{"description":"URL for generated video","format":"uri","type":"string"},"watermark_url":{"description":"URL for generated video with watermark, hotlink protection format","format":"uri","type":"string"}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"kling/videos-avatar-image2video","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["image","audio"],"x-comfy-router-output-modalities":["video"]}
