Nodes/ComfyUI-JM-Gemini-API/JM Gemini Video Generator
ComfyUI Node

JM Gemini Video Generator

Veo 3.1 inside ComfyUI — text-to-video, image-to-video, and first-last frame

By juemingai·Created 9 months ago·Updated 8 months ago· 16
JM Gemini Video Generator
  • first_image
  • last_image
  • video_path
gemini_api_key
prompt
seed0
negative_prompt
modelveo-3.1-generate-preview
aspect_ratio16:9
resolution720p
duration8

Veo is the closed-source video model that still has something open weights don't - the KB is blunt that "for video the gap is larger" and Veo's native audio remains unmatched. JMGeminiVideoGenerator plugs Google's Veo 3.1 and Veo 3.0 into ComfyUI as one node, so you can generate cloud video and then keep doing whatever you'd normally do to it in the graph: extract frames, upscale, composite, save with workflow metadata. You're not replacing local video gen - you're adding a frontier model as another node in the kit.

Be clear-eyed about the trade before you start: video generation over the API is slow and priced per generation. The node polls the operation every 10 seconds with a 20-minute timeout, so a clip taking a couple of minutes is normal, and the community gripes that Veo API output is expensive for what you get (one thread complained the API caps at 720p while the model "is capable of FHD or 4K"). This is not the node for quick A/B iteration.

How it works

It's a wrapper around the google-genai SDK's generate_videos operation API. You hand it a prompt (and optionally images), it kicks off an async operation, polls until done, downloads the result, and saves an .mp4 into ComfyUI/output/. Three modes, chosen by which image inputs you fill:

  • Text-to-video - no images. Prompt, model, aspect ratio, resolution, duration.
  • Image-to-video - connect first_image, describe the motion. (The node sets person_generation: allow_adult here, which is worth knowing if you're animating people.)
  • First-last frame interpolation - connect both first_image and last_image; Veo generates the motion between them. Only works with Veo 3.1 models and 8-second duration - the API rejects aspect_ratio/resolution in this mode anyway, so the node drops them.

The inputs that matter

  • gemini_api_key - required, from AI Studio. Same pay-per-use model as the image node, just pricier per unit.
  • prompt - the scene/motion description. JSON-format prompts are a known community trick for Veo 3.1 if you want repeatable camera moves.
  • negative_prompt - optional, actually sent to the API (Veo supports it, rare in closed video models).
  • model - veo-3.1-generate-preview (default), veo-3.1-fast-generate-preview, or the two stable Veo 3.0 variants.
  • aspect_ratio - 16:9 or 9:16.
  • resolution - 720p (default) or 1080p. 1080p only works with 8-second duration on Veo 3.1 - pair it with 4 or 6 seconds and the API errors.
  • duration - 4, 6, or 8 seconds.
  • seed - decorative, like the pack's other nodes. Never sent to the API.

The output (this trips people up)

The output is video_path, a plain STRING - the path to the saved .mp4 file. It is not a video tensor, so you can't wire it into a video preview node expecting frames. Use it with a text-display node to see the path, or feed the file path downstream (some loader nodes accept it). The mp4 is already on disk in ComfyUI/output/, so in practice you'll often just grab it from there.

Installing

Same shared pack as its siblings:

cd ComfyUI/custom_nodes
git clone https://github.com/synthetai/ComfyUI-JM-Gemini-API
cd ComfyUI-JM-Gemini-API
pip install -r requirements.txt

Restart ComfyUI, or search "ComfyUI-JM-Gemini-API" in ComfyUI Manager. The critical pinned dependency is google-genai==1.52.0; httpx[socks] is there for proxy users (set HTTP_PROXY/HTTPS_PROXY env vars before launching ComfyUI if you're behind a firewall). No model downloads - everything runs in Google's cloud.

Common issues

  • "Timeout after 20 minutes" - Veo is busy or your prompt is heavy. Retry, or drop to the fast variant.
  • 1080p + 4s/6s errors - the documented Veo 3.1 constraint. Use 8s, or 720p.
  • "No video was generated" - the operation reports rai_media_filtered_count, i.e. Google's safety filters ate it. Rewrite the prompt.
  • 720p when you asked for 1080p - this one isn't the node; the API/plan can silently deliver lower than requested. Community signal says to check your plan's actual video caps.

And no, this node does not get you Veo's famous native audio - it generates the video only. If you need sound, generate a reference clip elsewhere and mux it locally. The video is the star; the node just delivers it.

CategoryJM-Gemini

Inputs (10)

NameTypeDefaultDescription
gemini_api_keySTRING
promptSTRING
seedoptINT00–18446744073709550000
negative_promptoptSTRING
modeloptCOMBOveo-3.1-generate-preview4 options: veo-3.1-generate-preview, veo-3.1-fast-generate-preview, veo-3.0-generate-001, veo-3.0-fast-generate-001
aspect_ratiooptCOMBO16:92 options: 16:9, 9:16
resolutionoptCOMBO720p2 options: 720p, 1080p
durationoptCOMBO83 options: 4, 6, 8
first_imageoptIMAGE
last_imageoptIMAGE

Outputs (1)

NameTypeDescription
video_pathSTRING