{"record":{"id":"9a139c233cd73eb3","repo":"Comfy-Org/ComfyUI","slug":"the-maximum-number-of-generated-images-plus-the-nu","errorCode":null,"errorMessage":"The maximum number of generated images plus the number of reference images cannot exceed 15.","messagePattern":"The maximum number of generated images plus the number of reference images cannot exceed 15\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":727,"sourceCode":"        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,\n            ApiEndpoint(path=BYTEPLUS_IMAGE_ENDPOINT, method=\"POST\"),\n            response_model=ImageTaskCreationResponse,\n            data=Seedream4TaskCreationRequest(\n                model=model,","sourceCodeStart":709,"sourceCodeEnd":745,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L709-L745","documentation":"When sequential_image_generation is 'auto', Seedream requires total images (generated max_images + n_input_images references) to stay at or below 15. The node enforces this client-side because the API rejects the combination.","triggerScenarios":"sequential_image_generation == 'auto' and n_input_images + max_images > 15 - e.g. 12 reference images plus 4 generated images.","commonSituations":"High max_images widget value combined with a large reference batch; sequential mode left on 'auto' while scaling up generation count.","solutions":["Lower the max_images (number of generated images) widget so references + generated <= 15.","Reduce the number of reference images.","If you genuinely need more, run multiple generations - the cap is per request."],"exampleFix":"// before\nmax_images: 6, image batch: 12 references, sequential_image_generation: 'auto'\n// after\nmax_images: 3, image batch: 12 references, sequential_image_generation: 'auto'","handlingStrategy":"validation","validationCode":"n_refs = len(reference_images) if reference_images is not None else 0\nif sequential_image_generation == 'auto':\n    max_images = min(max_images, 15 - n_refs)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat references + generated <= 15 as a hard budget when sequential mode is auto.","When using many references, drop the generation-count widget accordingly."],"tags":["comfyui","bytedance","seedream","limits","validation","batch"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}