Comfy-Org/ComfyUI · error · ValueError
Maximum image resolution for the selected model is {max_pixe
Error message
Maximum image resolution for the selected model is {max_pixels / 1_000_000:.2f}MP, but {mp_provided:.2f}MP provided. What it means
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.
Source
Thrown at comfy_api_nodes/nodes_bytedance.py:716
break
if w is None or h is None:
w, h = width, height
out_num_pixels = w * h
mp_provided = out_num_pixels / 1_000_000.0
if ("seedream-4-5" in model or "seedream-5-0" in model) and out_num_pixels < 3686400:
raise ValueError(
f"Minimum image resolution for the selected model is 3.68MP, " f"but {mp_provided:.2f}MP provided."
)
if "seedream-4-0" in model and out_num_pixels < 921600:
raise ValueError(
f"Minimum image resolution that the selected model can generate is 0.92MP, "
f"but {mp_provided:.2f}MP provided."
)
max_pixels = 10_404_496 if "seedream-5-0" in model else 16_777_216
if out_num_pixels > max_pixels:
raise ValueError(
f"Maximum image resolution for the selected model is {max_pixels / 1_000_000:.2f}MP, "
f"but {mp_provided:.2f}MP provided."
)
n_input_images = get_number_of_images(image) if image is not None else 0
max_num_of_images = 14 if model == "seedream-5-0-260128" else 10
if n_input_images > max_num_of_images:
raise ValueError(
f"Maximum of {max_num_of_images} reference images are supported, but {n_input_images} received."
)
if sequential_image_generation == "auto" and n_input_images + max_images > 15:
raise ValueError(
"The maximum number of generated images plus the number of reference images cannot exceed 15."
)
reference_images_urls = []
if n_input_images:
for i in image:
validate_image_aspect_ratio(i, (1, 3), (3, 1))
reference_images_urls = await upload_images_to_comfyapi(View on GitHub (pinned to 1c6d8d45b3)
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.
Example fix
// before model: 'seedream-5-0-260128', width: 5000, height: 5000 // after model: 'seedream-5-0-260128', width: 3264, height: 3188
Defensive patterns
Strategy: validation
Validate before calling
cap = 10_404_496 if 'seedream-5-0' in model else 16_777_216
if width * height > cap:
scale = (cap / (width * height)) ** 0.5
width, height = int(width * scale), int(height * scale) Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Minimum image resolution for the selected model is 3.68MP, b
- Minimum image resolution that the selected model can generat
- Custom size out of range: {w}x{h}. Both width and height mus
- Maximum of {max_num_of_images} reference images are supporte
- The maximum number of generated images plus the number of re
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/c2a2c081df55772f.
Report an issue: GitHub.