{"record":{"id":"e6dcce28122326cf","repo":"Comfy-Org/ComfyUI","slug":"the-current-maximum-number-of-supported-videos-is","errorCode":null,"errorMessage":"The current maximum number of supported videos is {OMNI_MAX_VIDEOS}.","messagePattern":"The current maximum number of supported videos is (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_gemini.py","lineNumber":1658,"sourceCode":"            ],\n            is_api_node=True,\n            price_badge=IO.PriceBadge(\n                expr='{\"type\":\"usd\",\"usd\":0.101,\"format\":{\"suffix\":\"/second\",\"approximate\":true}}'\n            ),\n        )\n\n    @classmethod\n    async def execute(cls, model: dict, seed: int) -> IO.NodeOutput:\n        prompt = model.get(\"prompt\") or \"\"\n        validate_string(prompt, strip_whitespace=True, min_length=1)\n        model_id = OMNI_MODELS[model[\"model\"]]\n\n        images = [t for t in (model.get(\"images\") or {}).values() if t is not None]\n        videos = [v for v in (model.get(\"videos\") or {}).values() if v is not None]\n        if sum(get_number_of_images(t) for t in images) > OMNI_MAX_IMAGES:\n            raise ValueError(f\"The current maximum number of supported images is {OMNI_MAX_IMAGES}.\")\n        if len(videos) > OMNI_MAX_VIDEOS:\n            raise ValueError(f\"The current maximum number of supported videos is {OMNI_MAX_VIDEOS}.\")\n        for video in videos:\n            validate_video_duration(video, max_duration=10)\n\n        parts: list[GeminiInteractionTextPart | GeminiInteractionMediaPart] = []\n        if images or videos:\n            # The Interactions API accepts video only inline or as a Files API URI, not as an HTTP URL.\n            media_parts = await build_gemini_media_parts(\n                cls, [], [], videos, url_budget=0, max_inline_bytes=GEMINI_INTERACTIONS_MAX_INLINE_BYTES\n            )\n            video_inline_bytes = sum(len(p.inlineData.data) for p in media_parts)\n            media_parts += await build_gemini_media_parts(\n                cls, images, [], [], max_inline_bytes=GEMINI_INTERACTIONS_MAX_INLINE_BYTES - video_inline_bytes\n            )\n            parts.extend(to_interaction_media_part(p) for p in media_parts)\n        parts.append(GeminiInteractionTextPart(text=prompt))\n        interaction = await sync_op(\n            cls,\n            ApiEndpoint(path=GEMINI_INTERACTIONS_ENDPOINT, method=\"POST\"),","sourceCodeStart":1640,"sourceCodeEnd":1676,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_gemini.py#L1640-L1676","documentation":"The omni node's video cap: at most OMNI_MAX_VIDEOS = 3 video inputs may be connected. Each connected video socket counts once regardless of length, and each video is separately validated to ≤10 s duration (validate_video_duration). This guard runs before the interaction request is assembled.","triggerScenarios":"Executing the Gemini omni node with more than 3 non-None entries in model['videos'] — e.g. four LoadVideo outputs wired into four video sockets.","commonSituations":"Story-boarding workflows that wire in many short clips; users assuming the video cap matches the image cap (14); combining reference clips plus a style clip plus source footage exceeding three.","solutions":["Disconnect videos until at most 3 remain; pick the most informative clips.","Concatenate excess clips into one video upstream (then confirm each still passes the 10 s duration check).","Move some content to images if the 14-image budget has room."],"exampleFix":"# before\nmodel['videos'] = {'v1': a, 'v2': b, 'v3': c, 'v4': d}  # 4 videos -> raises\n\n# after\nmodel['videos'] = {'v1': a, 'v2': b, 'v3': concat(c, d)}","handlingStrategy":"validation","validationCode":"OMNI_MAX_VIDEOS = 3\nvideos = [v for v in (model.get(\"videos\") or {}).values() if v is not None]\nassert len(videos) <= OMNI_MAX_VIDEOS, f\"{len(videos)} videos connected; limit is 3\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wire at most 3 video inputs into the omni node.","Concatenate extra clips upstream (keeping each within the 10 s duration cap).","Remember videos are capped at 3 while images allow 14 — budgets differ."],"tags":["gemini","interactions-api","input-validation","limit","video","omni","comfy-api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}