Nodes/ComfyUI-Universal-LLM-Suite/πŸš€ Gemini API Runner
ComfyUI Node

πŸš€ Gemini API Runner

Make Gemini Talk (and Read Your Images) Inside ComfyUI

By alice-ai-wonderΒ·Created 4 months agoΒ·Updated 4 months agoΒ· 1
πŸš€ Gemini API Runner
  • gemini_model
  • image_input
  • audio_input
  • response_text
  • response_audio
  • response_thoughts
β—„system_promptβ–Ί
β—„user_promptβ–Ί

The Gemini API Runner is the workhorse of the Universal LLM Suite. Everything else in the pack is setup or display; this is the node that actually calls Google's API, sends your prompt and - if you give it one - an image or an audio clip, and hands back text, thoughts, and an actual voice recording when you've picked the right model.

It belongs to the "LLM as a tool in the graph" pattern, not the frozen text encoder inside your checkpoint. That distinction matters: an API runner like this is a paid service bolted onto your workflow, and it's worth it when the job needs frontier-chat quality - writing dialogue for a video clip, a long structured rewrite, or image analysis with a top-tier VLM. If you just want to turbo-charge your prompts cheaply and privately, a local model is the better fit. If you want Gemini's best, this is the cleanest path in ComfyUI, and Google's free tier makes it the cheapest way to try.

How it works

Three required inputs: gemini_model (the dict straight from the ✨ Gemini Configurator), system_prompt, and user_prompt. Note that both prompt inputs are forceInput in the source - the widgets are meant to be fed from a text node, which is exactly why the pack ships πŸ“ LLM Dual Prompt. You don't type your prompts here; you wire them in.

What happens next depends on the model the configurator selected, and the runner has two completely different code paths:

  • Standard models (gemini-2.5-flash, gemini-3.x, Gemma) go through generate_content(). Your image (if any) gets PNG-encoded into a content part, your audio becomes a WAV part, and for gemini-3 or audio-capable names it configures speech so you get spoken output back.
  • Native-audio / live models (gemini-2.5-flash-native-audio-..., gemini-3.1-flash-live-preview) go through Google's bidirectional Live API. This is asynchronous plumbing: the node sends your text and optionally resamples your audio input to 16 kHz PCM, streams it, and collects the model's 24 kHz PCM response.

Optional image_input (IMAGE) turns the call into a vision call - it takes the first image in the batch. Optional audio_input (AUDIO) feeds a clip to the model, which is how you get the model to listen as well as speak.

Outputs

  • response_text (STRING) - the model's answer.
  • response_audio (AUDIO) - a ComfyUI audio dict. Wire it into πŸ”Š LLM Audio Save & Play to hear it.
  • response_thoughts (STRING) - the model's reasoning, separated out when thinking is enabled on a supporting model.

The traps (both real, both easy to hit)

Silent audio on the default model. The headline voice feature only fires on specific model names. On the default gemini-2.5-flash you get TEXT only, and response_audio comes back as a silent empty dict - the audio-save node will just report "No audio data." Want speech? Pick a gemini-3 model (gets TTS via speech config) or a native-audio model in the configurator.

No images on the voice models. The native-audio/live models reject image_input with a clear error. Vision and voice are mutually exclusive here - choose per run.

One thing this node gets right: it never hard-crashes the workflow. Errors like a bad key come back as text inside response_text, prefixed with "❌". Annoying if you don't read the output, but genuinely handy for debugging.

Install

Same as the rest of the pack: ComfyUI Manager β†’ "Universal LLM Suite", or

cd ComfyUI/custom_nodes/
git clone https://github.com/alice-ai-wonder/ComfyUI-Universal-LLM-Suite

Restart, and it auto-installs google-genai, openai, and librosa on boot. No local model downloads - the compute happens at Google's end, so you need a key from AI Studio and a little patience with billing. It's a young pack with no community footprint yet, so the usual custom-node caution applies: it runs arbitrary Python on load, so give the source a skim before you trust it with anything important.

Category✨ Universal LLM

Inputs (5)

NameTypeDefaultDescription
gemini_modelGEMINI_MODELβ€”
system_promptSTRINGβ€”
user_promptSTRINGβ€”
image_inputoptIMAGEβ€”
audio_inputoptAUDIOβ€”

Outputs (3)

NameTypeDescription
response_textSTRINGβ€”
response_audioAUDIOβ€”
response_thoughtsSTRINGβ€”