{"record":{"id":"49aa000b329c3361","repo":"Comfy-Org/ComfyUI","slug":"only-a-single-input-image-is-supported","errorCode":null,"errorMessage":"Only a single input image is supported.","messagePattern":"Only a single input image is supported\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":1215,"sourceCode":"                      }\n                )\n                \"\"\",\n            ),\n        )\n\n    @classmethod\n    async def execute(\n        cls,\n        image: Input.Image,\n        prompt: str = \"\",\n        size: str = \"auto\",\n        seed: int = 0,\n        prompt_optimization: str = \"standard\",\n        watermark: bool = False,\n        crop_layers: bool = False,\n    ) -> IO.NodeOutput:\n        if get_number_of_images(image) != 1:\n            raise ValueError(\"Only a single input image is supported.\")\n        validate_image_aspect_ratio(image, (1, 16), (16, 1), strict=False)\n        validate_image_dimensions(image, min_width=512, min_height=512)\n\n        request = Seedream5LayerSeparationRequest(\n            model=SEEDREAM_LAYER_SEPARATION_MODEL,\n            prompt=prompt.strip() or None,\n            image=await upload_image_to_comfyapi(cls, image),\n            size=size,\n            seed=seed,\n            watermark=watermark,\n            optimize_prompt_options=Seedream5LayerOptimizePromptOptions(mode=prompt_optimization),\n        )\n        response = await sync_op(\n            cls,\n            ApiEndpoint(path=BYTEPLUS_IMAGE_ENDPOINT, method=\"POST\"),\n            response_model=ImageTaskCreationResponse,\n            data=request,\n            wait_label=\"Separating layers\",","sourceCodeStart":1197,"sourceCodeEnd":1233,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L1197-L1233","documentation":"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.","triggerScenarios":"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.","commonSituations":"Downstream node in a pipeline produced a multi-frame batch; user assumes the node iterates over the batch like some image nodes do.","solutions":["Feed a single image: slice the batch, e.g. image[0:1], before the node.","Run the node once per frame with a batch-splitter upstream if per-frame separation is needed.","Check the source node's output count (e.g. a loader reading a whole folder)."],"exampleFix":"# before\nimage = batch_of_frames  # shape [N,H,W,C], N>1 -> raises\n\n# after\nimage = batch_of_frames[0:1]  # single frame -> passes","handlingStrategy":"validation","validationCode":"def get_number_of_images(t):\n    return t.shape[0] if t.ndim == 4 else 1\nassert get_number_of_images(image) == 1, 'feed exactly one image'\nif image.ndim == 4 and image.shape[0] > 1:\n    image = image[0:1]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Insert a batch-slice (image[0:1]) between batch-producing nodes and layer separation.","Verify loader nodes are not reading a whole folder as a batch."],"tags":["bytedance","seedream","layer-separation","validation","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}