Comfy-Org/ComfyUI · error · ValueError

Aspect ratio must be between 1:8 and 8:1; got {width}x{heigh

Error message

Aspect ratio must be between 1:8 and 8:1; got {width}x{height}.

What it means

Error "Aspect ratio must be between 1:8 and 8:1; got {width}x{height}." thrown in Comfy-Org/ComfyUI.

Source

Thrown at comfy_api_nodes/nodes_qwen.py:68

def _validate_size(width: int, height: int) -> None:
    if not MIN_AREA <= width * height <= MAX_AREA:
        raise ValueError(
            f"Image area must be between {MIN_AREA} (512x512) and {MAX_AREA} (2560x2560) pixels; "
            f"got {width}x{height} = {width * height}."
        )
    if width > MAX_ASPECT * height or height > MAX_ASPECT * width:
        raise ValueError(f"Aspect ratio must be between 1:8 and 8:1; got {width}x{height}.")


def _fit_to_size(width: int, height: int) -> tuple[int, int]:

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Use an image with an aspect ratio between 1:8 and 8:1.

When it happens

Trigger: Thrown at comfy_api_nodes/nodes_qwen.py:68 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/3207894627bf46a8. Report an issue: GitHub.