{"record":{"id":"c6e10deee6e82deb","repo":"Comfy-Org/ComfyUI","slug":"rodin-gen-2-5-accepts-at-most-5-images-received","errorCode":null,"errorMessage":"Rodin Gen-2.5 accepts at most 5 images; received {len(flat_images)}.","messagePattern":"Rodin Gen-2\\.5 accepts at most 5 images; received (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_rodin.py","lineNumber":1004,"sourceCode":"        bbox_height: int,\n        bbox_length: int,\n        height_cm: int,\n    ) -> IO.NodeOutput:\n        image_tensors = [img for img in images.values() if img is not None]\n        if not image_tensors:\n            raise ValueError(\"Rodin Gen-2.5 Image-to-3D requires at least one image.\")\n\n        # Flatten multi-image tensors into individual frames; the API accepts each as a separate part.\n        flat_images: list = []\n        for tensor in image_tensors:\n            if hasattr(tensor, \"shape\") and len(tensor.shape) == 4:\n                for i in range(tensor.shape[0]):\n                    flat_images.append(tensor[i])\n            else:\n                flat_images.append(tensor)\n\n        if len(flat_images) > 5:\n            raise ValueError(f\"Rodin Gen-2.5 accepts at most 5 images; received {len(flat_images)}.\")\n\n        request = _build_request(\n            mode_input=mode,\n            material=material,\n            geometry_file_format=geometry_file_format,\n            texture_mode=texture_mode,\n            seed=seed,\n            TAPose=TAPose,\n            hd_texture=hd_texture,\n            texture_delight=texture_delight,\n            addon_highpack=addon_highpack,\n            bbox_width=bbox_width,\n            bbox_height=bbox_height,\n            bbox_length=bbox_length,\n            height_cm=height_cm,\n            prompt=None,\n            use_original_alpha=use_original_alpha,\n        )","sourceCodeStart":986,"sourceCodeEnd":1022,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_rodin.py#L986-L1022","documentation":"Raised by the Rodin Gen-2.5 Image-to-3D node when the flattened input image list exceeds the API's hard limit of 5 images. Multi-image tensors are flattened frame-by-frame (a 4D tensor of shape [N,C,H,W] becomes N separate images), so a batch of 6+ frames triggers it even if only one tensor was connected. It is a pre-flight client-side check before _build_request is called.","triggerScenarios":"Connecting an image batch/latent-decoded tensor with shape[0] > 5 to the Rodin Gen-2.5 node, or connecting 6+ individual image links; flattening logic at nodes_rodin.py:1004 counts every frame of every 4D tensor.","commonSituations":"Feeding an animated sequence or multi-view capture set into the image-to-3D node; assuming the node accepts one batched tensor of any size; iterating frames from a video for multi-angle reconstruction.","solutions":["Reduce the input to at most 5 images (e.g. slice the batch: image[:5]) before connecting it","If feeding a 4D tensor, remember each frame counts as one image; select only the key views you need","Use an image batching/selection node upstream to pick specific frames"],"exampleFix":"// before\nrodin_node(images=batch_tensor)  # batch_tensor.shape[0] == 8\n\n// after\nrodin_node(images=batch_tensor[:5])  # at most 5 frames","handlingStrategy":"validation","validationCode":"def flatten_image_count(tensors) -> int:\n    count = 0\n    for t in tensors:\n        if hasattr(t, \"shape\") and len(t.shape) == 4:\n            count += t.shape[0]\n        else:\n            count += 1\n    return count\n\nassert flatten_image_count(image_tensors) <= 5, \"Rodin Gen-2.5: max 5 images\"","typeGuard":"def is_valid_rodin_image_set(tensors: list) -> bool:\n    return flatten_image_count(tensors) <= 5","tryCatchPattern":"try:\n    await rodin_gen25_execute(...)\nexcept ValueError as e:\n    if \"at most 5 images\" in str(e):\n        images = images[:5]  # or surface to user\n    else:\n        raise","preventionTips":["Count batch frames, not connected tensors — each frame of a 4D tensor is one API image","Slice batches to <=5 before connecting","Pick distinct viewpoints rather than consecutive frames for 3D reconstruction"],"tags":["validation","rodin","image-batch","api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}