Comfy-Org/ComfyUI · error · ValueError

Only a single input image is supported.

Error message

Only a single input image is supported.

What it means

Raised by ByteDanceSeedreamLayerSeparationNode when get_number_of_images(image) != 1. The layer-separation API decomposes exactly one input image into RGBA layers, so batches or empty images are rejected before upload.

Source

Thrown at comfy_api_nodes/nodes_bytedance.py:1215

                      }
                )
                """,
            ),
        )

    @classmethod
    async def execute(
        cls,
        image: Input.Image,
        prompt: str = "",
        size: str = "auto",
        seed: int = 0,
        prompt_optimization: str = "standard",
        watermark: bool = False,
        crop_layers: bool = False,
    ) -> IO.NodeOutput:
        if get_number_of_images(image) != 1:
            raise ValueError("Only a single input image is supported.")
        validate_image_aspect_ratio(image, (1, 16), (16, 1), strict=False)
        validate_image_dimensions(image, min_width=512, min_height=512)

        request = Seedream5LayerSeparationRequest(
            model=SEEDREAM_LAYER_SEPARATION_MODEL,
            prompt=prompt.strip() or None,
            image=await upload_image_to_comfyapi(cls, image),
            size=size,
            seed=seed,
            watermark=watermark,
            optimize_prompt_options=Seedream5LayerOptimizePromptOptions(mode=prompt_optimization),
        )
        response = await sync_op(
            cls,
            ApiEndpoint(path=BYTEPLUS_IMAGE_ENDPOINT, method="POST"),
            response_model=ImageTaskCreationResponse,
            data=request,
            wait_label="Separating layers",

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Feed a single image: slice the batch, e.g. image[0:1], before the node.
  2. Run the node once per frame with a batch-splitter upstream if per-frame separation is needed.
  3. Check the source node's output count (e.g. a loader reading a whole folder).

Example fix

# before
image = batch_of_frames  # shape [N,H,W,C], N>1 -> raises

# after
image = batch_of_frames[0:1]  # single frame -> passes
Defensive patterns

Strategy: validation

Validate before calling

def get_number_of_images(t):
    return t.shape[0] if t.ndim == 4 else 1
assert get_number_of_images(image) == 1, 'feed exactly one image'
if image.ndim == 4 and image.shape[0] > 1:
    image = image[0:1]

Prevention

When it happens

Trigger: Connecting a batched IMAGE tensor with more than one frame (e.g. from LoadImageBatch or a video frame) or an empty tensor to the layer separation node.

Common situations: Downstream node in a pipeline produced a multi-frame batch; user assumes the node iterates over the batch like some image nodes do.

Related errors


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