{"record":{"id":"e296cd76aca3b1ad","repo":"Comfy-Org/ComfyUI","slug":"maximum-of-max-num-of-images-reference-images-ar","errorCode":null,"errorMessage":"Maximum of {max_num_of_images} reference images are supported, but {n_input_images} received.","messagePattern":"Maximum of (.+?) reference images are supported, but (.+?) received\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":723,"sourceCode":"        if (\"seedream-4-5\" in model or \"seedream-5-0\" in model) and out_num_pixels < 3686400:\n            raise ValueError(\n                f\"Minimum image resolution for the selected model is 3.68MP, \" f\"but {mp_provided:.2f}MP provided.\"\n            )\n        if \"seedream-4-0\" in model and out_num_pixels < 921600:\n            raise ValueError(\n                f\"Minimum image resolution that the selected model can generate is 0.92MP, \"\n                f\"but {mp_provided:.2f}MP provided.\"\n            )\n        max_pixels = 10_404_496 if \"seedream-5-0\" in model else 16_777_216\n        if out_num_pixels > max_pixels:\n            raise ValueError(\n                f\"Maximum image resolution for the selected model is {max_pixels / 1_000_000:.2f}MP, \"\n                f\"but {mp_provided:.2f}MP provided.\"\n            )\n        n_input_images = get_number_of_images(image) if image is not None else 0\n        max_num_of_images = 14 if model == \"seedream-5-0-260128\" else 10\n        if n_input_images > max_num_of_images:\n            raise ValueError(\n                f\"Maximum of {max_num_of_images} reference images are supported, but {n_input_images} received.\"\n            )\n        if sequential_image_generation == \"auto\" and n_input_images + max_images > 15:\n            raise ValueError(\n                \"The maximum number of generated images plus the number of reference images cannot exceed 15.\"\n            )\n        reference_images_urls = []\n        if n_input_images:\n            for i in image:\n                validate_image_aspect_ratio(i, (1, 3), (3, 1))\n            reference_images_urls = await upload_images_to_comfyapi(\n                cls,\n                image,\n                max_images=n_input_images,\n                mime_type=\"image/png\",\n            )\n        response = await sync_op(\n            cls,","sourceCodeStart":705,"sourceCodeEnd":741,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L705-L741","documentation":"Seedream caps reference (input) images: 14 for model id 'seedream-5-0-260128', 10 for all others. get_number_of_images counts the input batch, and exceeding the cap raises before any upload begins.","triggerScenarios":"The image input batch contains more images than max_num_of_images for the selected model - e.g. 12 reference images on a non-260128 model.","commonSituations":"Batch of reference/character images wired via an image batch node; model switched from seedream-5-0-260128 (14) to another variant (10) leaving an oversized batch.","solutions":["Trim the reference batch to at most 10 images (or 14 on seedream-5-0-260128).","Split into multiple generations if all references matter.","Curate references - Seedream quality typically degrades with near-cap counts anyway."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"cap = 14 if model == 'seedream-5-0-260128' else 10\nif len(reference_images) > cap:\n    reference_images = reference_images[:cap]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Count the reference batch against the model cap (10, or 14 on seedream-5-0-260128) before wiring.","Curate references down to the few that matter - quality beats quantity."],"tags":["comfyui","bytedance","seedream","limits","batch","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}