{"record":{"id":"728479870e9ef67f","repo":"Comfy-Org/ComfyUI","slug":"image-aspect-ratio-is-too-extreme-width-x-height","errorCode":null,"errorMessage":"Image aspect ratio is too extreme ({width}x{height}); FLUX 3 accepts at most {_FLUX3_MAX_IMAGE_ASPECT}:1.","messagePattern":"Image aspect ratio is too extreme \\((.+?)x(.+?)\\); FLUX 3 accepts at most (.+?):1\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bfl.py","lineNumber":1033,"sourceCode":"        )\n        return IO.NodeOutput(await download_url_to_image_tensor(response.result[\"sample\"]))\n\n\n_FLUX3_ASPECT_RATIOS = [\"auto\", \"21:9\", \"2:1\", \"16:9\", \"4:3\", \"1:1\", \"3:4\", \"9:16\"]\n_FLUX3_MIN_DURATION = 5\n_FLUX3_MAX_DURATION = 20\n_FLUX3_DURATIONS = [\"auto\"] + [str(i) for i in range(_FLUX3_MIN_DURATION, _FLUX3_MAX_DURATION + 1)]\n_FLUX3_RESOLUTIONS = {\"720p\": \"hd\", \"1080p\": \"fhd\"}\n_FLUX3_MAX_IMAGES = 10\n_FLUX3_MIN_IMAGE_SIDE = 256\n_FLUX3_MAX_IMAGE_ASPECT = 64\n\n\ndef _flux3_validate_image(image: torch.Tensor) -> None:\n    validate_image_dimensions(image, min_width=_FLUX3_MIN_IMAGE_SIDE, min_height=_FLUX3_MIN_IMAGE_SIDE)\n    height, width = image.shape[-3], image.shape[-2]\n    if max(width, height) > _FLUX3_MAX_IMAGE_ASPECT * min(width, height):\n        raise ValueError(\n            f\"Image aspect ratio is too extreme ({width}x{height}); \"\n            f\"FLUX 3 accepts at most {_FLUX3_MAX_IMAGE_ASPECT}:1.\"\n        )\n\n\ndef _flux3_collect_images(images: dict | None, field_name: str) -> list[torch.Tensor]:\n    \"\"\"Flatten Autogrow slots (each possibly batched) into single images and validate them.\"\"\"\n    flat: list[torch.Tensor] = []\n    for tensor in (images or {}).values():\n        if tensor is None:\n            continue\n        if tensor.ndim == 4:\n            flat.extend(tensor[i] for i in range(tensor.shape[0]))\n        else:\n            flat.append(tensor)\n    if len(flat) > _FLUX3_MAX_IMAGES:\n        raise ValueError(f\"FLUX 3 supports at most {_FLUX3_MAX_IMAGES} {field_name}, got {len(flat)}.\")\n    for tensor in flat:","sourceCodeStart":1015,"sourceCodeEnd":1051,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bfl.py#L1015-L1051","documentation":"FLUX 3 video rejects reference images whose aspect ratio exceeds 64:1 (after also requiring each side >= 256px). The helper reads height/width from the tensor's last two dims and raises before any API call when max(side)/min(side) > _FLUX3_MAX_IMAGE_ASPECT.","triggerScenarios":"Passing an extremely wide or tall keyframe/first-frame image (e.g. 8192x64 panorama or a slit strip) into a FLUX 3 video node.","commonSituations":"Feeding film-strip or sprite-sheet concatenations as a single image; letterboxed content with huge transparent borders; upstream resize nodes configured with extreme stretching.","solutions":["Crop or resize the image so the longer side is at most 64x the shorter side (e.g. center-crop to a sane ratio).","If the image is actually multiple frames, split it into individual frames instead of passing a strip.","Check for accidental dimension swaps (HxW vs WxH) in upstream processing."],"exampleFix":"# before\nimg = panorama  # 8192 x 96 -> ValueError\n\n# after\nfrom PIL import Image\nimg = center_crop(img, target_ratio=16/9)","handlingStrategy":"validation","validationCode":"h, w = image.shape[-3], image.shape[-2]\nassert max(h, w) <= 64 * min(h, w), f\"aspect too extreme {w}x{h}\"","typeGuard":"def flux3_aspect_ok(image: torch.Tensor) -> bool:\n    h, w = image.shape[-3], image.shape[-2]\n    return max(h, w) <= 64 * min(h, w) and min(h, w) >= 256","tryCatchPattern":null,"preventionTips":["Split film strips into individual frames instead of one huge image.","Validate dimensions before wiring images into FLUX 3 nodes.","Watch for accidental H/W swaps in resize logic."],"tags":["bfl","flux3","aspect-ratio","input-validation","image"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}