{"record":{"id":"baba37dcfd65c9b8","repo":"Comfy-Org/ComfyUI","slug":"failed-to-upload-one-or-more-images-to-comfy-api","errorCode":null,"errorMessage":"Failed to upload one or more images to comfy api.","messagePattern":"Failed to upload one or more images to comfy api\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_runway.py","lineNumber":421,"sourceCode":"        duration: str,\n        ratio: str,\n        seed: int,\n    ) -> IO.NodeOutput:\n        validate_string(prompt, min_length=1)\n        validate_image_dimensions(start_frame, max_width=7999, max_height=7999)\n        validate_image_dimensions(end_frame, max_width=7999, max_height=7999)\n        validate_image_aspect_ratio(start_frame, (1, 2), (2, 1))\n        validate_image_aspect_ratio(end_frame, (1, 2), (2, 1))\n\n        stacked_input_images = image_tensor_pair_to_batch(start_frame, end_frame)\n        download_urls = await upload_images_to_comfyapi(\n            cls,\n            stacked_input_images,\n            max_images=2,\n            mime_type=\"image/png\",\n        )\n        if len(download_urls) != 2:\n            raise ValueError(\"Failed to upload one or more images to comfy api.\")\n\n        return IO.NodeOutput(\n            await generate_video(\n                cls,\n                RunwayImageToVideoRequest(\n                    promptText=prompt,\n                    seed=seed,\n                    model=Model(\"gen3a_turbo\"),\n                    duration=Duration(duration),\n                    ratio=AspectRatio(ratio),\n                    promptImage=RunwayPromptImageObject(\n                        root=[\n                            RunwayPromptImageDetailedObject(uri=str(download_urls[0]), position=\"first\"),\n                            RunwayPromptImageDetailedObject(uri=str(download_urls[1]), position=\"last\"),\n                        ]\n                    ),\n                ),\n                estimated_duration=AVERAGE_DURATION_FLF_SECONDS,","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_runway.py#L403-L439","documentation":"Raised by the Runway first/last frame node when upload_images_to_comfyapi returns fewer than 2 download URLs for the 2 stacked frames (start + end). The upload helper may silently skip images that exceed its max_images or fail partway, so the count check is the only signal that the upload was incomplete. Execution stops before the generation request is built.","triggerScenarios":"Calling RunwayFirstLastFrameNode with start_frame and end_frame where upload_images_to_comfyapi(cls, stacked_input_images, max_images=2) returns 0 or 1 URLs (partial upload failure, helper truncation, or an upload exception swallowed upstream).","commonSituations":"Flaky network to the ComfyUI API upload endpoint; auth/token expiry mid-upload; upstream changes to upload_images_to_comfyapi dropping frames from batched tensors.","solutions":["Retry the node — transient upload failures are the most common cause","Verify API credentials/session for the ComfyAPI upload endpoint are valid","Check network connectivity and any proxy that could truncate multipart uploads","Confirm each input is a single image (not an empty or zero-batch tensor)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"from comfy_api_nodes.utils import get_number_of_images\nassert get_number_of_images(start_frame) == 1, \"start_frame must be one image\"\nassert get_number_of_images(end_frame) == 1, \"end_frame must be one image\"","typeGuard":null,"tryCatchPattern":"try:\n    await runway_first_last_frame(...)\nexcept ValueError as e:\n    if \"Failed to upload\" in str(e):\n        await asyncio.sleep(2)\n        await runway_first_last_frame(...)  # one retry\n    else:\n        raise","preventionTips":["Ensure stable network before running Runway nodes","Verify ComfyAPI credentials are valid before batching long workflows","Confirm both inputs are single images so the stacked batch is exactly 2"],"tags":["runway","upload","api-nodes","network"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}