{"record":{"id":"b15607573cc7ace9","repo":"Comfy-Org/ComfyUI","slug":"aleph2-supports-at-most-5-prompt-images","errorCode":null,"errorMessage":"Aleph2 supports at most 5 prompt images.","messagePattern":"Aleph2 supports at most 5 prompt images\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_runway.py","lineNumber":808,"sourceCode":"\n        video_url = await upload_video_to_comfyapi(cls, video)\n\n        keyframe_models: list[RunwayAleph2KeyframeSeconds | RunwayAleph2KeyframeAt] = []\n        if keyframes is not None:\n            if len(keyframes.items) > 5:\n                raise ValueError(\"Aleph2 supports at most 5 keyframes.\")\n            for item in keyframes.items:\n                image_url = await upload_image_to_comfyapi(cls, item.image, mime_type=\"image/png\")\n                if item.mode == KEYFRAME_MODE_SECONDS:\n                    _check_seconds(item.value, \"Keyframe timestamp\")\n                    keyframe_models.append(RunwayAleph2KeyframeSeconds(seconds=item.value, uri=image_url))\n                else:\n                    keyframe_models.append(RunwayAleph2KeyframeAt(at=item.value, uri=image_url))\n\n        prompt_image_models: list[RunwayAleph2PromptImage] = []\n        if prompt_images is not None:\n            if len(prompt_images.items) > 5:\n                raise ValueError(\"Aleph2 supports at most 5 prompt images.\")\n            for item in prompt_images.items:\n                image_url = await upload_image_to_comfyapi(cls, item.image, mime_type=\"image/png\")\n                position: RunwayAleph2TimestampPosition | RunwayAleph2RelativePosition\n                if item.mode == PROMPT_IMAGE_MODE_TIMESTAMP:\n                    _check_seconds(item.value, \"Prompt image timestamp\")\n                    position = RunwayAleph2TimestampPosition(timestampSeconds=item.value)\n                else:\n                    position = RunwayAleph2RelativePosition(positionPercentage=item.value)\n                prompt_image_models.append(RunwayAleph2PromptImage(position=position, uri=image_url))\n\n        initial_response = await sync_op(\n            cls,\n            endpoint=ApiEndpoint(path=PATH_VIDEO_TO_VIDEO, method=\"POST\"),\n            response_model=RunwayAleph2Response,\n            data=RunwayAleph2Request(\n                promptText=prompt,\n                videoUri=video_url,\n                seed=seed,","sourceCodeStart":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_runway.py#L790-L826","documentation":"Raised by the Aleph2 node when the prompt_images collection contains more than 5 items. Mirror of the keyframe cap: the Runway Aleph2 API limits prompt-image guidance to 5 images, checked before uploading each image.","triggerScenarios":"Connecting a prompt_images aggregation with 6+ items (each item = one image + timestamp or relative position) to the Aleph2 node.","commonSituations":"Style-reference-heavy workflows attaching many reference images along the timeline; reusing a keyframe-style aggregation for prompt images.","solutions":["Reduce prompt_images to at most 5 items, keeping the most influential references","Split the generation into multiple runs if more references are essential"],"exampleFix":"// before\naleph2(prompt, video, prompt_images=8_refs)\n\n// after\naleph2(prompt, video, prompt_images=8_refs[:5])","handlingStrategy":"validation","validationCode":"assert prompt_images is None or len(prompt_images.items) <= 5, \"Aleph2: at most 5 prompt images\"","typeGuard":"def prompt_image_count_ok(prompt_images) -> bool:\n    return prompt_images is None or len(prompt_images.items) <= 5","tryCatchPattern":"try:\n    await aleph2_execute(...)\nexcept ValueError as e:\n    if \"at most 5 prompt images\" in str(e):\n        prompt_images.items = prompt_images.items[:5]\n        await aleph2_execute(...)\n    else:\n        raise","preventionTips":["Limit reference-image collections to 5 for Aleph2","Remember keyframes and prompt images share separate 5-item caps and are mutually exclusive"],"tags":["runway","aleph2","prompt-images","limit","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}