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
- 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).
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
- 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.
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
- 'thinking' can only be disabled for text-to-image; enable it
- Unexpected response: no base image returned.
- Unexpected response: the first item is not the base image.
- The model returned no layers. Try a different prompt or inpu
- Failed to download layer {i + 1} of {len(specs)} (name={item
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/49aa000b329c3361.
Report an issue: GitHub.