Comfy-Org/ComfyUI · error · ValueError

Expected 1 or 2 input images, but got {n_images}.

Error message

Expected 1 or 2 input images, but got {n_images}.

What it means

Error "Expected 1 or 2 input images, but got {n_images}." thrown in Comfy-Org/ComfyUI.

Source

Thrown at comfy_api_nodes/nodes_wan.py:281

        # width: int = 1024,
        # height: int = 1024,
        seed: int = 0,
        watermark: bool = False,
    ):
        n_images = get_number_of_images(image)
        if n_images not in (1, 2):
            raise ValueError(f"Expected 1 or 2 input images, but got {n_images}.")
        images = []
        for i in image:
            images.append("data:image/png;base64," + tensor_to_base64_string(i, total_pixels=4096 * 4096))

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Provide 1 or 2 input images.

When it happens

Trigger: Thrown at comfy_api_nodes/nodes_wan.py:281 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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