Comfy-Org/ComfyUI · error · ValueError

Gemini did not generate a video. Try rephrasing your prompt,

Error message

Gemini did not generate a video. Try rephrasing your prompt, shortening the requested duration, or reducing the number of input images/videos.

What it means

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.

Source

Thrown at comfy_api_nodes/nodes_gemini.py:268


async def get_video_from_interaction(
    interaction: GeminiInteraction, cls: type[IO.ComfyNode] | None = None
) -> InputImpl.VideoFromFile:
    for step in interaction.steps or []:
        if step.type != "model_output":
            continue
        for content in step.content or []:
            if content.type != "video":
                continue
            if content.data:
                return InputImpl.VideoFromFile(BytesIO(base64.b64decode(content.data)))
            if content.uri:
                return await download_url_to_video_output(content.uri, cls=cls)
    model_message = get_text_from_interaction(interaction).strip()
    if model_message:
        raise ValueError(f"Gemini did not generate a video. Model response: {model_message}")
    raise ValueError(
        "Gemini did not generate a video. Try rephrasing your prompt, "
        "shortening the requested duration, or reducing the number of input images/videos."
    )


def create_video_parts(video_input: Input.Video) -> list[GeminiPart]:
    """Convert a single video input to Gemini API compatible parts (inline MP4/H.264)."""
    base_64_string = video_to_base64_string(
        video_input, container_format=Types.VideoContainer.MP4, codec=Types.VideoCodec.H264
    )
    return [
        GeminiPart(
            inlineData=GeminiInlineData(
                mimeType=GeminiMimeType.video_mp4,
                data=base_64_string,
            )
        )
    ]

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Retry the exact same request — empty interactions are frequently transient.
  2. Shorten the requested video duration.
  3. Reduce the number of attached input images and videos.
  4. Rephrase the prompt to be a direct video generation instruction.
  5. If it persists, switch modality/inputs so the model returns text explaining the failure (see the sibling error that includes Model response).
Defensive patterns

Strategy: retry

Try / catch

for attempt in range(2):
    try:
        video = await get_video_from_interaction(interaction, cls=cls)
        break
    except ValueError as e:
        if attempt == 1 or "did not generate a video" not in str(e):
            raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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