Nodes/ComfyUI Gemini Expanded API/Configure Gemini Video Input
ComfyUI Node

Configure Gemini Video Input

Configure Gemini Video Input

By silveroxides·Created about a year ago·Updated 3 days ago· 5
Configure Gemini Video Input
  • video
  • video_config
fps1
pad_at_startfalse
duration_aware_paddingfalse

You generated a clip in ComfyUI and now you want Gemini to watch it - describe what happens, critique the motion, or turn it into a prompt for the next pass. That's what this little node is for. It takes the native video already sitting in your graph and turns it into something Google's Gemini API can ingest. It's a thin helper, honest about it, and it does one job well: it doesn't call the API, doesn't hold a key, doesn't even encode the video itself. It just sets up the video side of the request so the pack's main text node can finish the job.

How it works. SSL_GeminiVideoConfig takes a ComfyUI VIDEO plus your settings and packs them into a video_config output (type GEMINI_VIDEO_CONFIG). You wire that into the video input on the Expanded Gemini Text/Image node. The heavy lifting happens later, inside the text node's execute: your clip gets re-encoded to MP4/H.264 with audio embedded, sampled at the FPS you chose, and uploaded to Gemini as an inline video part before your images and prompt are sent. And it must fit - the normalized clip has to come out under 100 MB or the call is refused. Yes, your footage leaves the machine and hits Google's moderation. That's the price of an API model, and this pack is unapologetically that.

The inputs that matter. Four of them, and honestly only two you'll touch at first:

  • video - the native ComfyUI video, the kind that comes out of a native video loader or generator node. Not raw frames.
  • fps (default 1, 1–24) - "frames per second sampled by Gemini for video understanding." This is the knob that decides both quality and your bill, because every sampled frame costs tokens. A 5-second clip at 1 fps is 5 frames; at 24 fps it's 120. For "did the motion look natural" questions, 1–2 fps is plenty. Push higher only when you genuinely need frame-level detail and can pay for it.
  • pad_at_start (default false) - prepends black video and silence for half one sampling interval. A blank beat before motion starts, useful if Gemini keeps fixating on whatever's in your first frame.
  • duration_aware_padding (default false) - only meaningful with pad_at_start on. Instead of the fixed half-interval pad, it derives the padding from the video's fractional-second duration, rounded down to native frames. This is comparison-testing territory - keeping clip lengths identical when you're diffing Gemini's answers across settings. Leave both paddings off until you have a concrete reason.

The output. One video_config socket. It feeds the text node's video input, and it also plays nice with the pack's caching if you enable use_cache on the key-config node.

Install. Same routine as the whole pack:

cd ComfyUI/custom_nodes
git clone https://github.com/silveroxides/ComfyUI_Gemini_Expanded_API.git
cd ComfyUI_Gemini_Expanded_API
pip install -r requirements.txt

Then restart ComfyUI. Or search "ComfyUI Gemini Expanded API" in ComfyUI Manager. No model files to download - this is an API pack. Dependencies are light (google-genai>=2.17.0, numpy, torch, Pillow), but the code is built on ComfyUI's newer native extension API (comfy_api.latest, IO.Video), so keep ComfyUI current. You also need a Gemini API key from Google AI Studio and a Configure Gemini API Key node somewhere in the graph - this node carries the video, not the credentials.

Where people get burned. The video node's own message isn't the error - the text node catches serialization failures and returns Error processing input video: ... as text output instead of raising, usually a clip over 100 MB after H.264 normalization or a video type ComfyUI couldn't re-encode. And if you see the pack's signature 'NoneType' object has no attribute 'parts' error, that's Google's content policy refusing your clip or prompt - the README is explicit about it, so test with benign footage first. One more: if Gemini's answers seem to miss the action, check your fps before blaming the model. At the default 1 fps it literally only sees one frame per second.

CategoryAPI/Gemini

Inputs (4)

NameTypeDefaultDescription
videoVIDEO
fpsINT11–24Frames per second sampled by Gemini for video understanding.
pad_at_startBOOLEANfalsePrepend black video and silence for half one Gemini sampling interval.
duration_aware_paddingBOOLEANfalseUse the video's fractional-second duration, rounded down to native video frames, as the start padding duration.

Outputs (1)

NameTypeDescription
video_configGEMINI_VIDEO_CONFIG