{"openapi":"3.0.2","info":{"title":"wan/wan2.5-t2i-preview","description":"The request body Comfy Router accepts for the model \"wan/wan2.5-t2i-preview\", 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":"d118eb611dd7"},"paths":{"/v2/models/wan/wan2.5-t2i-preview":{"post":{"operationId":"runRouterModel","summary":"Run wan/wan2.5-t2i-preview synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"The Wan text-to-image fields, shared by the v1 `POST /proxy/wan/api/v1/services/aigc/text2image/image-synthesis` request body and the Comfy Router input schema for `wan/wan2.5-t2i-preview`.\n`required` here is the ROUTER-SAFE floor; the v1 wrapper `WanImageGenerationRequest` re-adds `model` for direct v1 calls.","example":{"input":{"prompt":"A single red maple leaf on a plain white background."},"parameters":{"n":1,"size":"1280*1280"}},"properties":{"input":{"description":"Enter basic information, such as prompt words, etc.","properties":{"negative_prompt":{"description":"Reverse prompt words to describe content that you do not want to see in the image. Past 500 characters the model truncates it rather than refusing it. It counts toward the same input budget as prompt.","type":"string"},"prompt":{"description":"Positive prompt words to describe expected image elements and visual features. Supports Chinese and English. Past 2,000 characters the model truncates the prompt rather than refusing it. The provider refuses a request whose prompt and negative_prompt together are longer than about 60,850 bytes of UTF-8 text (about 20,000 Chinese characters), answering InvalidParameter `Range of input length should be [1, 61440]`.","maxLength":61440,"type":"string"}},"required":["prompt"],"type":"object"},"model":{"description":"The ID of the model to call for text-to-image generation. NOT constrained on this component: Comfy Router fills it from the `{model}` path segment of `POST /v2/models/wan/{model}`. A direct v1 call to `POST /proxy/wan/api/v1/services/aigc/text2image/image-synthesis` MUST supply it, and the enum of accepted spellings lives on that operation's own component, `WanImageGenerationRequest`.","nullable":true,"type":"string"},"parameters":{"description":"Image processing parameters","properties":{"n":{"default":4,"description":"Number of generated images. Range 1-4, default is 4","maximum":4,"minimum":1,"type":"integer"},"prompt_extend":{"default":true,"description":"Enable prompt intelligent rewriting. Default is true","type":"boolean"},"seed":{"description":"Random number seed to control randomness. Range [0, 2147483647]","maximum":2147483647,"minimum":0,"type":"integer"},"size":{"default":"1280*1280","description":"The output image resolution in the format width*height. Default is 1280*1280. The API accepts a pixel area between 1638400 (1280*1280) and 2073600 (1440*1440) with an aspect ratio between 1:4 and 4:1, so 768*2700 is valid","type":"string"},"watermark":{"default":false,"description":"Whether to add watermark logo in lower right corner","type":"boolean"}},"type":"object"}},"required":["input"],"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/WanTaskQueryResponse"},{"properties":{"code":{"description":"Error code for a failed request, reported at the ROOT of the envelope rather than under `output` (not returned if the request succeeded).","type":"string"},"message":{"description":"Detailed information about a failed request, reported at the ROOT of the envelope rather than under `output` (not returned if the request succeeded). Read this before falling back to `output.message`.","type":"string"}},"type":"object"}],"description":"Comfy Router output schema for the Wan and HappyHorse models: the terminal `GET /proxy/wan/api/v1/tasks/{task_id}` document, forwarded unchanged. All three DashScope submit operations — `/api/v1/services/aigc/video-generation/video-synthesis` (video), `/api/v1/services/aigc/text2image/image-synthesis` (image) and `/api/v1/services/aigc/image2image/image-synthesis` (image) — are SUBMIT-AND-POLL: Router submits the task and then polls the one shared task-status route on the caller's behalf, so the body a caller receives is the finished task rather than the `{task_id, task_status}` handle the underlying submit answers with. That is the reading a modality-shaped guess gets backwards: unlike xAI and BytePlus, DashScope puts the IMAGE operations behind the same task queue as the video one, and all twenty ids answer this one document.\n`output.task_status` is DashScope's own UPPERCASE vocabulary — `PENDING`, `RUNNING`, `SUCCEEDED`, `FAILED`, `CANCELED`, `UNKNOWN` — forwarded unchanged. Router treats `SUCCEEDED` as the one terminal success for these models. `FAILED` and `CANCELED` are the terminal failures. `PENDING` and `RUNNING` are IN-FLIGHT and Router keeps polling on them, so a client must not abandon a task that reports either; `UNKNOWN` is treated as an unknown status and gets a bounded retry grace before it is failed.\nWHICH LEAF CARRIES THE ASSET DEPENDS ON THE OPERATION, and a caller must select on the operation it submitted rather than on `output` being non-empty:\n* VIDEO tasks (the eighteen video ids, submitted through\n  `video-generation/video-synthesis`) put the generated video at\n  `output.video_url`. An I2V task that also generated audio carries it separately at\n  `output.check_audio`; that is not a substitute for `output.video_url`.\n* IMAGE tasks (`wan/wan2.5-t2i-preview` through `text2image/image-synthesis` and\n  `wan/wan2.5-i2i-preview` through `image2image/image-synthesis`) put each generated\n  image at `output.results[].url`. `results` is a LIST, one element per image. When\n  the body omits `parameters.n`, text-to-image takes DashScope's default of four images\n  and Comfy sends `n: 1` for image-to-image. An individual element may carry `code` and\n  `message` INSTEAD of `url` when that one image failed while the task as a whole\n  succeeded, so a caller must read `url` per element rather than assume the list is\n  uniform. `output.task_metrics` reports the TOTAL/SUCCEEDED/FAILED split for\n  exactly that case.\n\nA `SUCCEEDED` whose `output` carries neither leaf is a success that produced nothing, not a finished generation; through Router that distinction is already settled, because Router answers it as a Comfy Router error rather than with the provider document. A FAILED task reports its reason at `output.code`/`output.message`, and DashScope may additionally report a top-level `code`/`message` on the envelope itself; read the ROOT pair first and fall back to the nested one, which is the order the first-party Wan poller uses.\nThe URLs are DashScope-hosted and valid for 24 HOURS from completion, so download them promptly rather than storing them. `usage` reports DashScope's own generation accounting — its numbers, not the Comfy charge — and its fields are per-operation (`video_duration`/`video_ratio`/`video_count` for T2V, `duration`/`SR` for I2V and wan3.0-video, `size`/`image_count` for both image operations — T2I and I2I).\nSCHEMA VS EXAMPLE: the schema below is the ONE shared `WanTaskQueryResponse` all twenty ids answer with — the wan/* output components are split only so that each published document carries an example of its OWN RESULT SHAPE, never a video example printed under an image model. The split is presentational; the contract is not.\nTHIS DOCUMENT describes an IMAGE id, so its example is the image shape: the assets at `output.results[].url` — a LIST, one element per generated image — with `output.task_metrics` reporting the TOTAL/SUCCEEDED/FAILED split and the `size`/`image_count` usage pair. Both image ids report that same shape, so the example below is written to serve either one: its asset URL names no model, and its `usage.size` of `1280*1280` is a resolution both operations accept. The example deliberately shows a partially failed task, the case in which an element carries `code`/`message` INSTEAD of `url`, because that is the shape a caller most easily gets wrong. `output.video_url` is the video spelling and is never populated here.","example":{"output":{"end_time":"2027-01-01T00:00:12.000Z","results":[{"actual_prompt":"a single red maple leaf resting on still water, shallow depth of field, soft morning light","orig_prompt":"a single red maple leaf resting on still water","url":"https://example.invalid/wan/generated-1.png"},{"code":"DataInspectionFailed","message":"This candidate was rejected; the task as a whole succeeded.","orig_prompt":"a single red maple leaf resting on still water"}],"scheduled_time":"2027-01-01T00:00:01.000Z","submit_time":"2027-01-01T00:00:00.000Z","task_id":"0385dc79-5ff8-4d82-bcb6-7c1a9f2e4d60","task_metrics":{"FAILED":1,"SUCCEEDED":1,"TOTAL":2},"task_status":"SUCCEEDED"},"request_id":"7574ee8f-38a3-4b1e-9280-11c33ab46e51","usage":{"image_count":1,"size":"1280*1280"}}}}}}}}}},"components":{"schemas":{"WanTaskQueryResponse":{"properties":{"output":{"properties":{"actual_prompt":{"description":"Actual prompt after intelligent rewriting (for video tasks)","type":"string"},"check_audio":{"description":"Audio URL for I2V tasks with audio generation","type":"string"},"code":{"description":"The error code for the failed request (not returned if request is successful)","type":"string"},"end_time":{"description":"Task completion time","type":"string"},"message":{"description":"Detailed information about the failed request (not returned if request is successful)","type":"string"},"orig_prompt":{"description":"Original input prompt (for video tasks)","type":"string"},"results":{"description":"List of task results for image generation tasks","items":{"properties":{"actual_prompt":{"description":"Actual prompt after intelligent rewriting (if enabled)","type":"string"},"code":{"description":"Image error code (returned when some tasks fail)","type":"string"},"message":{"description":"Image error information (returned when some tasks fail)","type":"string"},"orig_prompt":{"description":"Original input prompt","type":"string"},"url":{"description":"Generated image URL address","type":"string"}},"type":"object"},"type":"array"},"scheduled_time":{"description":"Task execution time","type":"string"},"submit_time":{"description":"Task submission time","type":"string"},"task_id":{"description":"Task ID","type":"string"},"task_metrics":{"description":"Task result statistics for image generation tasks","properties":{"FAILED":{"description":"Number of failed tasks","type":"integer"},"SUCCEEDED":{"description":"Number of successful tasks","type":"integer"},"TOTAL":{"description":"Total number of tasks","type":"integer"}},"type":"object"},"task_status":{"description":"Task status","enum":["PENDING","RUNNING","SUCCEEDED","FAILED","CANCELED","UNKNOWN"],"type":"string"},"video_url":{"description":"Video URL for completed video generation tasks. Link validity period 24 hours","type":"string"}},"required":["task_id","task_status"],"type":"object"},"request_id":{"description":"Unique request identifier","type":"string"},"usage":{"description":"Output information statistics. Only successful results are counted","properties":{"SR":{"description":"Video resolution level (I2V and wan3.0-video tasks)","type":"integer"},"duration":{"description":"Duration of generated video in seconds (I2V and wan3.0-video tasks)","type":"number"},"fps":{"description":"Frame rate of the generated video (wan3.0-video tasks)","type":"integer"},"image_count":{"description":"Number of generated images (T2I and I2I tasks)","type":"integer"},"input_video_duration":{"description":"Duration of the input video in seconds, 0.0 when no video input (wan3.0-video tasks)","type":"number"},"output_video_duration":{"description":"Duration of the output video in seconds (wan3.0-video tasks)","type":"number"},"ratio":{"description":"Aspect ratio of the generated video, e.g. 16:9 (wan3.0-video tasks)","type":"string"},"size":{"description":"Image resolution (T2I and I2I tasks)","type":"string"},"video_count":{"description":"Number of generated videos (T2V tasks)","type":"integer"},"video_duration":{"description":"Duration of generated video in seconds (T2V tasks)","type":"number"},"video_ratio":{"description":"Video resolution ratio (T2V tasks)","type":"string"}},"type":"object"}},"required":["request_id","output"],"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"wan/wan2.5-t2i-preview","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["text"],"x-comfy-router-output-modalities":["image"]}
