{"record":{"id":"ce19eb9c08c94761","repo":"Comfy-Org/ComfyUI","slug":"exactly-one-input-image-is-required-ce19eb","errorCode":null,"errorMessage":"Exactly one input image is required.","messagePattern":"Exactly one input image is required\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_wavespeed.py","lineNumber":136,"sourceCode":"                depends_on=IO.PriceBadgeDepends(widgets=[\"model\"]),\n                expr=\"\"\"\n                (\n                  $prices := {\"seedvr2\": 0.01, \"ultimate\": 0.06};\n                  {\"type\":\"usd\", \"usd\": $lookup($prices, widgets.model)}\n                )\n                \"\"\",\n            ),\n        )\n\n    @classmethod\n    async def execute(\n        cls,\n        model: str,\n        image: Input.Image,\n        target_resolution: str,\n    ) -> IO.NodeOutput:\n        if get_number_of_images(image) != 1:\n            raise ValueError(\"Exactly one input image is required.\")\n        if model == \"SeedVR2\":\n            model_path = \"seedvr2/image\"\n        else:\n            model_path = \"ultimate-image-upscaler\"\n        initial_res = await sync_op(\n            cls,\n            ApiEndpoint(path=f\"/proxy/wavespeed/api/v3/wavespeed-ai/{model_path}\", method=\"POST\"),\n            response_model=TaskCreatedResponse,\n            data=SeedVR2ImageRequest(\n                target_resolution=target_resolution.lower(),\n                image=(await upload_images_to_comfyapi(cls, image, max_images=1))[0],\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\"),","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_wavespeed.py#L118-L154","documentation":"Raised by WavespeedImageUpscaleNode.execute when get_number_of_images(image) != 1. The upscale request schema (SeedVR2ImageRequest) takes a single image string, and upload_images_to_comfyapi is called with max_images=1, so a batch of 0 or 2+ images is rejected up front.","triggerScenarios":"Feeding a batched image tensor (e.g. LoadImage batch, multiple-frame output from another node) into the upscale node; the count is anything other than exactly 1.","commonSituations":"Upstream node emits a batch (e.g. animatediff frames, image list) that the user assumed would be upscaled item-by-item; empty batch from a failed/empty upstream sampler.","solutions":["Ensure exactly one image reaches the node — split the batch first (e.g. ImageBatchToImageList / index selection) and upscale items individually or via a batch-capable node","Check the upstream node's output count if the batch is unexpectedly empty","Use a local upscaler node if batch upscaling is needed"],"exampleFix":"// before\nupscale(model=\"SeedVR2\", image=batch_of_4)  # ValueError\n// after\nfor single in split_batch(batch_of_4):\n    upscale(model=\"SeedVR2\", image=single)","handlingStrategy":"validation","validationCode":"if get_number_of_images(image) != 1:\n    raise ValueError(f\"expected 1 image, got {get_number_of_images(image)}\")  # fail before upload","typeGuard":"def is_single_image(image) -> bool:\n    return get_number_of_images(image) == 1","tryCatchPattern":null,"preventionTips":["Check batch size of upstream nodes before wiring into single-image API nodes","Split batches and loop when upscaling multiple images"],"tags":["wavespeed","api-node","validation","image-batch","input-limits"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}