{"record":{"id":"400d7f10106abe14","repo":"Comfy-Org/ComfyUI","slug":"output-size-output-width-x-output-height-out","errorCode":null,"errorMessage":"Output size ({output_width}x{output_height} = {output_pixels:,} pixels) exceeds maximum allowed size of {MAX_PIXELS_GENERATIVE:,} pixels ({MAX_MP_GENERATIVE}MP). Enable auto_downscale or use a smaller input image or a lower upscale factor.","messagePattern":"Output size \\((.+?)x(.+?) = (.+?) pixels\\) exceeds maximum allowed size of (.+?) pixels \\((.+?)MP\\)\\. Enable auto_downscale or use a smaller input image or a lower upscale factor\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_hitpaw.py","lineNumber":153,"sourceCode":"                    scale_output_pixels = input_pixels * candidate * candidate\n                    if scale_output_pixels <= MAX_PIXELS_GENERATIVE:\n                        scale = candidate\n                        max_input_pixels = None\n                        break\n                    # Check if we can downscale input by at most 2x to fit\n                    downscale_ratio = math.sqrt(scale_output_pixels / MAX_PIXELS_GENERATIVE)\n                    if downscale_ratio <= 2.0:\n                        scale = candidate\n                        max_input_pixels = MAX_PIXELS_GENERATIVE // (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                upscale_factor = scale\n            else:\n                output_width = width * requested_scale\n                output_height = height * requested_scale\n                raise ValueError(\n                    f\"Output size ({output_width}x{output_height} = {output_pixels:,} pixels) \"\n                    f\"exceeds maximum allowed size of {MAX_PIXELS_GENERATIVE:,} pixels ({MAX_MP_GENERATIVE}MP). \"\n                    f\"Enable auto_downscale or use a smaller input image or a lower upscale factor.\"\n                )\n\n        initial_res = await sync_op(\n            cls,\n            ApiEndpoint(path=\"/proxy/hitpaw/api/photo-enhancer\", method=\"POST\"),\n            response_model=TaskCreateResponse,\n            data=ImageEnhanceTaskCreateRequest(\n                model_name=f\"{model}_{upscale_factor}x\",\n                img_url=await upload_image_to_comfyapi(cls, image, total_pixels=None),\n            ),\n            wait_label=\"Creating task\",\n            final_label_on_success=\"Task created\",\n        )\n        if initial_res.code != 200:\n            raise ValueError(f\"Task creation failed with code {initial_res.code}: {initial_res.message}\")","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_hitpaw.py#L135-L171","documentation":"Thrown by Hitpaw photo enhancement when width*height*scale^2 exceeds MAX_PIXELS_GENERATIVE and auto_downscale is disabled. With auto_downscale=True the node instead walks candidate scales [4,2,1] and optionally downscales the input by up to 2x to fit; the error is the explicit refusal path when the user wants no automatic shrinking. The message states the computed output size and the exact pixel cap.","triggerScenarios":"Large input combined with upscale_factor 2/4 such that output pixels exceed the cap; e.g. a 6000x6000 image with 4x selected. Only raised when auto_downscale=False.","commonSituations":"Users upscaling already-high-resolution outputs from generation pipelines, or chaining enhancers where a previous 4x pass feeds this one.","solutions":["Enable auto_downscale — the node picks the largest fitting scale (and at most a 2x input downscale) automatically","Lower upscale_factor to 1 or 2 so output stays under the cap","Pre-downscale the input image so input_pixels * scale^2 fits within MAX_PIXELS_GENERATIVE"],"exampleFix":"# before\nauto_downscale = False; upscale_factor = 4  # 8000x8000 input -> error\n# after\nauto_downscale = True  # node auto-selects a fitting scale, e.g. 2x or 1x","handlingStrategy":"validation","validationCode":"from comfy_api_nodes.utils import get_image_dimensions\nfrom comfy_api_nodes.nodes_hitpaw import MAX_PIXELS_GENERATIVE\n\ndef enhance_output_fits(image, scale: int) -> bool:\n    h, w = get_image_dimensions(image)\n    return h * w * scale * scale <= MAX_PIXELS_GENERATIVE","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Leave auto_downscale enabled for unattended pipelines","Check input megapixels before selecting 4x — the cap is on output pixels"],"tags":["hitpaw","upscaler","pixel-limit","auto-downscale","input-validation"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}