{"record":{"id":"0c01223de9840137","repo":"Comfy-Org/ComfyUI","slug":"gemini-did-not-generate-a-video-try-rephrasing-yo","errorCode":null,"errorMessage":"Gemini did not generate a video. Try rephrasing your prompt, shortening the requested duration, or reducing the number of input images/videos.","messagePattern":"Gemini did not generate a video\\. Try rephrasing your prompt, shortening the requested duration, or reducing the number of input images/videos\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_gemini.py","lineNumber":268,"sourceCode":"\n\nasync def get_video_from_interaction(\n    interaction: GeminiInteraction, cls: type[IO.ComfyNode] | None = None\n) -> InputImpl.VideoFromFile:\n    for step in interaction.steps or []:\n        if step.type != \"model_output\":\n            continue\n        for content in step.content or []:\n            if content.type != \"video\":\n                continue\n            if content.data:\n                return InputImpl.VideoFromFile(BytesIO(base64.b64decode(content.data)))\n            if content.uri:\n                return await download_url_to_video_output(content.uri, cls=cls)\n    model_message = get_text_from_interaction(interaction).strip()\n    if model_message:\n        raise ValueError(f\"Gemini did not generate a video. Model response: {model_message}\")\n    raise ValueError(\n        \"Gemini did not generate a video. Try rephrasing your prompt, \"\n        \"shortening the requested duration, or reducing the number of input images/videos.\"\n    )\n\n\ndef create_video_parts(video_input: Input.Video) -> list[GeminiPart]:\n    \"\"\"Convert a single video input to Gemini API compatible parts (inline MP4/H.264).\"\"\"\n    base_64_string = video_to_base64_string(\n        video_input, container_format=Types.VideoContainer.MP4, codec=Types.VideoCodec.H264\n    )\n    return [\n        GeminiPart(\n            inlineData=GeminiInlineData(\n                mimeType=GeminiMimeType.video_mp4,\n                data=base_64_string,\n            )\n        )\n    ]","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_gemini.py#L250-L286","documentation":"Raised when a Gemini Interactions API response produced no video content parts and the model returned no text either — the interaction completed but is completely empty of usable output. Because there is no model message to surface, the error falls back to generic remediation advice about prompt phrasing, duration, and input count. It comes from get_video_from_interaction after all steps' content entries were scanned without finding type 'video' with data or a URI.","triggerScenarios":"Interaction steps exist but every model_output step has empty or non-video content (no content.data, no content.uri) AND get_text_from_interaction().strip() returns ''. Common with very long requested durations, heavy multi-image/video inputs that exhaust limits, or provider-side generation failures that yield an empty response.","commonSituations":"Requesting 8s+ videos with many reference inputs; upstream API incidents returning empty interactions; prompts at the edge of the safety filter that produce neither video nor explanation; first-call flakiness with newly released video models.","solutions":["Retry the exact same request — empty interactions are frequently transient.","Shorten the requested video duration.","Reduce the number of attached input images and videos.","Rephrase the prompt to be a direct video generation instruction.","If it persists, switch modality/inputs so the model returns text explaining the failure (see the sibling error that includes Model response)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt in range(2):\n    try:\n        video = await get_video_from_interaction(interaction, cls=cls)\n        break\n    except ValueError as e:\n        if attempt == 1 or \"did not generate a video\" not in str(e):\n            raise","preventionTips":["Retry once on empty interactions — they are frequently transient.","Keep total inline media well under the 90 MiB interactions cap.","Attach fewer reference images/videos than the maximum to leave headroom."],"tags":["gemini","video-generation","interactions-api","retryable","comfy-api-nodes"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}