{"record":{"id":"533837d3670d2af7","repo":"Comfy-Org/ComfyUI","slug":"flux-3-supports-at-most-flux3-max-images-field","errorCode":null,"errorMessage":"FLUX 3 supports at most {_FLUX3_MAX_IMAGES} {field_name}, got {len(flat)}.","messagePattern":"FLUX 3 supports at most (.+?) (.+?), got (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_bfl.py","lineNumber":1050,"sourceCode":"    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:\n        _flux3_validate_image(tensor)\n    return flat\n\n\ndef _flux3_parse_times(value: str, image_count: int, duration: int | str) -> list[float]:\n    \"\"\"Parse one keyframe time in seconds per image: increasing, inside the clip.\"\"\"\n    parts = [part.strip() for part in value.split(\",\") if part.strip()]\n    if len(parts) != image_count:\n        raise ValueError(\n            f\"Give one time per keyframe image: got {len(parts)} time(s) for {image_count} image(s).\"\n        )\n    try:\n        times = [float(part) for part in parts]\n    except ValueError as exc:\n        raise ValueError(f\"Keyframe times must be numbers in seconds, comma-separated; got '{value}'.\") from exc\n    if not all(math.isfinite(time) for time in times):\n        raise ValueError(f\"Keyframe times must be finite numbers in seconds; got '{value}'.\")","sourceCodeStart":1032,"sourceCodeEnd":1068,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_bfl.py#L1032-L1068","documentation":"FLUX 3 accepts at most 10 images per field (keyframes or conditioning frames). _flux3_collect_images flattens every Autogrow slot (each possibly a 4D batch) into single images and raises if the total exceeds _FLUX3_MAX_IMAGES before validating dimensions.","triggerScenarios":"Connecting Autogrow image inputs whose flattened frame total exceeds 10, e.g. three slots holding 4-frame batches.","commonSituations":"Assuming the limit is per-slot rather than global; connecting frame-sequence batches intended for other video models.","solutions":["Keep the flattened total at or below 10 images.","Select the most representative keyframes instead of wiring every frame.","Split into sequential generations if more coverage is needed."],"exampleFix":"# before\nflat = flatten(image_slots)  # 14 images -> ValueError\n\n# after\nflat = flatten(image_slots)[:10]","handlingStrategy":"validation","validationCode":"flat = [t for tensor in (images or {}).values() if tensor is not None\n        for t in (list(tensor) if tensor.ndim == 4 else [tensor])]\nassert len(flat) <= 10, f\"FLUX 3 max 10 images, got {len(flat)}\"","typeGuard":"def flux3_image_count_ok(images: dict | None) -> bool:\n    n = 0\n    for t in (images or {}).values():\n        if t is None:\n            continue\n        n += t.shape[0] if t.ndim == 4 else 1\n    return n <= 10","tryCatchPattern":null,"preventionTips":["The 10-image cap counts flattened frames across all slots.","Curate keyframes rather than connecting full sequences.","Split long sequences into multiple generations."],"tags":["bfl","flux3","keyframes","input-validation","autogrow"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}