{"record":{"id":"46d6aa6cf744e363","repo":"Comfy-Org/ComfyUI","slug":"task-creation-fails-with-code-initial-res-code-a","errorCode":null,"errorMessage":"Task creation fails with code={initial_res.code} and message={initial_res.message}","messagePattern":"Task creation fails with code=(.+?) and message=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_wavespeed.py","lineNumber":80,"sourceCode":"    async def execute(\n        cls,\n        video: Input.Video,\n        target_resolution: str,\n    ) -> IO.NodeOutput:\n        validate_container_format_is_mp4(video)\n        validate_video_duration(video, min_duration=5, max_duration=60 * 10)\n        initial_res = await sync_op(\n            cls,\n            ApiEndpoint(path=\"/proxy/wavespeed/api/v3/wavespeed-ai/flashvsr\", method=\"POST\"),\n            response_model=TaskCreatedResponse,\n            data=FlashVSRRequest(\n                target_resolution=target_resolution.lower(),\n                video=await upload_video_to_comfyapi(cls, video),\n                duration=video.get_duration(),\n            ),\n        )\n        if initial_res.code != 200:\n            raise ValueError(f\"Task creation fails with code={initial_res.code} and message={initial_res.message}\")\n        final_response = await poll_op(\n            cls,\n            ApiEndpoint(path=f\"/proxy/wavespeed/api/v3/predictions/{initial_res.data.id}/result\"),\n            response_model=TaskResultResponse,\n            status_extractor=lambda x: \"failed\" if x.data is None else x.data.status,\n            poll_interval=10.0,\n        )\n        if final_response.code != 200:\n            raise ValueError(\n                f\"Task processing failed with code={final_response.code} and message={final_response.message}\"\n            )\n        return IO.NodeOutput(await download_url_to_video_output(final_response.data.outputs[0]))\n\n\nclass WavespeedImageUpscaleNode(IO.ComfyNode):\n    @classmethod\n    def define_schema(cls):\n        return IO.Schema(","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_wavespeed.py#L62-L98","documentation":"Raised by WavespeedFlashVSRNode.execute when the WaveSpeed FlashVSR task-creation POST to /proxy/wavespeed/api/v3/wavespeed-ai/flashvsr returns a non-200 `code` in its body. TaskCreatedResponse (comfy_api_nodes/apis/wavespeed.py:21) carries an integer code and message; any value other than 200 means the task was never created.","triggerScenarios":"FlashVSR creation fails server-side: target_resolution not in the accepted set, uploaded video URL rejected, duration metadata inconsistent, invalid API key/quota for the WaveSpeed account behind the proxy, or upstream outage.","commonSituations":"Typo'd or unsupported target_resolution; source video re-encoded in a format WaveSpeed rejects; expired WaveSpeed credentials; service incidents returning error codes with 200-level transport.","solutions":["Read code and message from the exception — they come straight from WaveSpeed","Use a supported target_resolution value (uppercase display strings are lowercased; verify the exact allowed set)","Re-upload a freshly encoded H.264/MP4 clip and retry","Check WaveSpeed API key/quota and the service status page; retry once if transient"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"ALLOWED = {\"720p\", \"1080p\", \"4k\"}  # confirm against current FlashVSR docs\nif target_resolution.lower() not in ALLOWED:\n    raise ValueError(f\"unsupported target_resolution: {target_resolution}\")","typeGuard":null,"tryCatchPattern":"try:\n    ...await execute(...)\nexcept ValueError as e:\n    if \"Task creation fails\" in str(e):\n        retry_with_backoff(...)  # creation failures are often transient upstream","preventionTips":["Use exact supported target_resolution strings","Re-encode videos to standard H.264 MP4 before upload","Check WaveSpeed quota/key health before long batches"],"tags":["wavespeed","api-node","task-creation","upstream-error","video-upscale"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}