Comfy-Org/ComfyUI · error · ValueError

Exactly one input image is required.

Error message

Exactly one input image is required.

What it means

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.

Source

Thrown at comfy_api_nodes/nodes_wavespeed.py:136

                depends_on=IO.PriceBadgeDepends(widgets=["model"]),
                expr="""
                (
                  $prices := {"seedvr2": 0.01, "ultimate": 0.06};
                  {"type":"usd", "usd": $lookup($prices, widgets.model)}
                )
                """,
            ),
        )

    @classmethod
    async def execute(
        cls,
        model: str,
        image: Input.Image,
        target_resolution: str,
    ) -> IO.NodeOutput:
        if get_number_of_images(image) != 1:
            raise ValueError("Exactly one input image is required.")
        if model == "SeedVR2":
            model_path = "seedvr2/image"
        else:
            model_path = "ultimate-image-upscaler"
        initial_res = await sync_op(
            cls,
            ApiEndpoint(path=f"/proxy/wavespeed/api/v3/wavespeed-ai/{model_path}", method="POST"),
            response_model=TaskCreatedResponse,
            data=SeedVR2ImageRequest(
                target_resolution=target_resolution.lower(),
                image=(await upload_images_to_comfyapi(cls, image, max_images=1))[0],
            ),
        )
        if initial_res.code != 200:
            raise ValueError(f"Task creation fails with code={initial_res.code} and message={initial_res.message}")
        final_response = await poll_op(
            cls,
            ApiEndpoint(path=f"/proxy/wavespeed/api/v3/predictions/{initial_res.data.id}/result"),

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. 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
  2. Check the upstream node's output count if the batch is unexpectedly empty
  3. Use a local upscaler node if batch upscaling is needed

Example fix

// before
upscale(model="SeedVR2", image=batch_of_4)  # ValueError
// after
for single in split_batch(batch_of_4):
    upscale(model="SeedVR2", image=single)
Defensive patterns

Strategy: validation

Validate before calling

if get_number_of_images(image) != 1:
    raise ValueError(f"expected 1 image, got {get_number_of_images(image)}")  # fail before upload

Type guard

def is_single_image(image) -> bool:
    return get_number_of_images(image) == 1

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/ce19eb9c08c94761. Report an issue: GitHub.