Comfy-Org/ComfyUI · error · ValueError
Currently only one input image is supported.
Error message
Currently only one input image is supported.
What it means
Raised by the Sora-2 node when an optional image input is provided whose batch contains more than one image. The OpenAI videos endpoint accepts a single input_reference file, so get_number_of_images(image) must equal 1. It fires before the multipart request is built.
Source
Thrown at comfy_api_nodes/nodes_sora.py:131
),
)
@classmethod
async def execute(
cls,
model: str,
prompt: str,
size: str = "1280x720",
duration: int = 8,
seed: int = 0,
image: Optional[torch.Tensor] = None,
):
if model == "sora-2" and size not in ("720x1280", "1280x720"):
raise ValueError("Invalid size for sora-2 model, only 720x1280 and 1280x720 are supported.")
files_input = None
if image is not None:
if get_number_of_images(image) != 1:
raise ValueError("Currently only one input image is supported.")
files_input = {"input_reference": ("image.png", tensor_to_bytesio(image), "image/png")}
initial_response = await sync_op(
cls,
endpoint=ApiEndpoint(path="/proxy/openai/v1/videos", method="POST"),
data=Sora2GenerationRequest(
model=model,
prompt=prompt,
seconds=str(duration),
size=size,
),
files=files_input,
response_model=Sora2GenerationResponse,
content_type="multipart/form-data",
)
if initial_response.error:
raise Exception(initial_response.error["message"])
model_time_multiplier = 1 if model == "sora-2" else 2View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Select a single frame from the batch before connecting (slice index 0 or the desired frame)
- Use an image-selection/pick-frame node upstream
Example fix
# before sora_generate(prompt, image=batch_tensor) # shape[0] == 4 # after sora_generate(prompt, image=batch_tensor[0:1]) # single image
Defensive patterns
Strategy: validation
Validate before calling
if image is not None:
assert get_number_of_images(image) == 1, "Sora image input must be a single image, not a batch" Type guard
def is_single_image(image) -> bool:
return image is None or get_number_of_images(image) == 1 Try / catch
try:
await sora_execute(prompt, image=image, ...)
except ValueError as e:
if "only one input image" in str(e):
await sora_execute(prompt, image=image[0:1], ...)
else:
raise Prevention
- Slice batches to one frame before image-to-video nodes
- Check shape[0] after any node that can expand batches (e.g. video-to-image decoders)
When it happens
Trigger: Connecting a batched image tensor (shape[0] > 1) to the node's image input while doing image-to-video generation.
Common situations: Feeding decoded video frames or a multi-image generation output directly; forgetting that LoadImage batches remain shape [N,C,H,W] after common preprocessing nodes.
Related errors
- Up to {SEED_MAX_IMAGES} images are supported per request.
- No images provided to create_image_parts; at least one image
- kling-video-o1 does not support durations greater than 10 se
- Currently only one input image is supported.
- Currently only one last frame image is supported.
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/da9bfcf339777e02.
Report an issue: GitHub.