{"record":{"id":"c2a2c081df55772f","repo":"Comfy-Org/ComfyUI","slug":"maximum-image-resolution-for-the-selected-model-is","errorCode":null,"errorMessage":"Maximum image resolution for the selected model is {max_pixels / 1_000_000:.2f}MP, but {mp_provided:.2f}MP provided.","messagePattern":"Maximum image resolution for the selected model is (.+?)MP, but (.+?)MP provided\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bytedance.py","lineNumber":716,"sourceCode":"                break\n\n        if w is None or h is None:\n            w, h = width, height\n\n        out_num_pixels = w * h\n        mp_provided = out_num_pixels / 1_000_000.0\n        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(","sourceCodeStart":698,"sourceCodeEnd":734,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bytedance.py#L698-L734","documentation":"Upper resolution bound for Seedream: 10,404,496 pixels (10.4MP) for seedream-5-0 models and 16,777,216 pixels (16.8MP) otherwise. Requests above the model's cap are rejected client-side with the cap and the requested megapixels in the message.","triggerScenarios":"w*h exceeds max_pixels for the selected model - e.g. 5000x5000 (25MP) on seedream-5-0, or any size above 4096x4096 on other Seedream models.","commonSituations":"Users requesting max-resolution wallpaper/print sizes; switching from a non-5.0 model (16.8MP cap) to 5.0 (10.4MP cap) without shrinking the canvas.","solutions":["Reduce width*height to within the cap reported in the message (10.4MP for 5.0, 16.8MP otherwise).","Pick a preset within limits.","Upscale locally after generation if you need more pixels."],"exampleFix":"// before\nmodel: 'seedream-5-0-260128', width: 5000, height: 5000\n// after\nmodel: 'seedream-5-0-260128', width: 3264, height: 3188","handlingStrategy":"validation","validationCode":"cap = 10_404_496 if 'seedream-5-0' in model else 16_777_216\nif width * height > cap:\n    scale = (cap / (width * height)) ** 0.5\n    width, height = int(width * scale), int(height * scale)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember seedream-5.0 has a lower ceiling (10.4MP) than other Seedream models (16.8MP).","For print-size outputs, generate at cap and upscale locally."],"tags":["comfyui","bytedance","seedream","image-size","limits","validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}