{"record":{"id":"c5a1d545ece3c21e","repo":"Comfy-Org/ComfyUI","slug":"output-size-width-requested-scale-x-height-r","errorCode":null,"errorMessage":"Output size ({width * requested_scale}x{height * requested_scale} = {output_pixels:,} pixels) exceeds maximum allowed size of {max_output_pixels:,} pixels. Use a smaller input image or lower scale factor.","messagePattern":"Output size \\((.+?)x(.+?) = (.+?) pixels\\) exceeds maximum allowed size of (.+?) pixels\\. Use a smaller input image or lower scale factor\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_magnific.py","lineNumber":200,"sourceCode":"                for candidate in [16, 8, 4, 2]:\n                    if candidate > requested_scale:\n                        continue\n                    scale_output_pixels = input_pixels * candidate * candidate\n                    if scale_output_pixels <= max_output_pixels:\n                        scale = candidate\n                        max_input_pixels = None\n                        break\n                    downscale_ratio = math.sqrt(scale_output_pixels / max_output_pixels)\n                    if downscale_ratio <= 2.0:\n                        scale = candidate\n                        max_input_pixels = max_output_pixels // (candidate * candidate)\n                        break\n\n                if max_input_pixels is not None:\n                    image = downscale_image_tensor(image, total_pixels=max_input_pixels)\n                scale_factor = f\"{scale}x\"\n            else:\n                raise ValueError(\n                    f\"Output size ({width * requested_scale}x{height * requested_scale} = {output_pixels:,} pixels) \"\n                    f\"exceeds maximum allowed size of {max_output_pixels:,} pixels. \"\n                    f\"Use a smaller input image or lower scale factor.\"\n                )\n\n        final_height, final_width = get_image_dimensions(image)\n        actual_scale = int(scale_factor.rstrip(\"x\"))\n        price_usd = _calculate_magnific_upscale_price_usd(final_width, final_height, actual_scale)\n\n        initial_res = await sync_op(\n            cls,\n            ApiEndpoint(path=\"/proxy/freepik/v1/ai/image-upscaler\", method=\"POST\"),\n            response_model=TaskResponse,\n            data=ImageUpscalerCreativeRequest(\n                image=(await upload_images_to_comfyapi(cls, image, max_images=1, total_pixels=None))[0],\n                scale_factor=scale_factor,\n                optimized_for=optimized_for,\n                creativity=creativity,","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_magnific.py#L182-L218","documentation":"Raised by the Magnific upscale node (comfy_api_nodes/nodes_magnific.py:200) when height*width*scale^2 exceeds 25,300,000 output pixels and auto_downscale is disabled. With auto_downscale enabled the node instead picks a lower scale (≤2x downscale of server-upscaled output) and downsizes the input, so this error only fires on the manual path.","triggerScenarios":"Executing the Magnific node with auto_downscale=False and e.g. a 6000x4000 input at 4x (96M pixels > 25.3M), or any large image combined with a high scale factor.","commonSituations":"User disables auto_downscale wanting the full requested scale; upscaling already-large panoramas or max-resolution outputs; stacked upscaler workflows feeding progressively larger inputs.","solutions":["Enable auto_downscale and let the node choose a compliant scale/input size.","Or lower the scale_factor widget (e.g. 4x → 2x).","Or pre-downscale the input image so height*width*scale^2 stays ≤ 25,300,000."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"MAX_OUT_PIXELS = 25_300_000\nh, w = image.shape[-2], image.shape[-3]  # per your tensor layout via get_image_dimensions\nscale = int(scale_factor.rstrip(\"x\"))\nif h * w * scale * scale > MAX_OUT_PIXELS:\n    scale_factor = f\"{int(math.sqrt(MAX_OUT_PIXELS / (h * w)))}x\"  # or enable auto_downscale","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Leave auto_downscale enabled unless you need an exact output size.","Compute h*w*scale^2 before queueing when upscaling large inputs."],"tags":["magnific","upscale","pixel-limit","input-validation","comfy-api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}