Ask Gemini
A VLM in your graph with zero VRAM
- image_1
- image_2
- image_3
- text
You want a vision-language model in your workflow - something that actually reads an image and answers a question about it - but you don't want to download a 40 GB local VLM, fight with GGUF quants, or burn VRAM your sampler needs. Ask Gemini is the shortcut: it takes a prompt plus up to three images, sends them to Google's API, and hands you back a plain text string. No local model, no GPU load, just an API key and an internet connection. It's a full multimodal model crammed into one node.
How it actually works
Under the hood this is a thin, well-maintained wrapper around google-generativeai. Your images get converted to PIL frames and sent as multimodal content to GenerativeModel.generate_content() - the same call you'd write in plain Python. A few implementation details are worth knowing because they tell you how opinionated the node is:
- It forces
transport="rest", dodging the gRPC install and auth headaches that used to plague the Google SDK. - The API key comes from the
GOOGLE_API_KEYenvironment variable, or theapi_keyinput if you'd rather hardcode it into the node. - The
modeldropdown is where the real choice lives:gemma-3-12b-itandgemma-3-27b-it(Google's open models, served here on the API), the pinnedgemini-2.0-flash-lite-001andgemini-2.0-flash-001, and the currentgemini-2.5-flashandgemini-2.5-pro. The-001suffixes are dated snapshots - Google's way of freezing a version. For 95% of jobs,gemini-2.5-flashis the one: fast, cheap, and smart enough for captioning and image Q&A.
The inputs that matter
You'll set most of these once and forget them:
- prompt - your question or instruction. The default ("Why number 42 is important?") is a leftover; replace it with whatever you actually want to ask about the image.
- image_1 / image_2 / image_3 - the images to send. Each input accepts a batch too, and every frame gets sent individually - feed a video sequence in and caption it all in one pass.
- response_type -
textorjson. Pickingjsonsets the response MIME type, so you can get structured output back and pipe it into a parser node for automation. - system_instruction - a system prompt, e.g. "You are a captioner. Describe only what is visible." This is where you shape the output.
- safety_settings -
BLOCK_NONE,BLOCK_ONLY_HIGH, orBLOCK_MEDIUM_AND_ABOVE. - temperature and num_predict - note the defaults: a negative temperature means "use the model's default," and
0for num_predict means "no limit." They're lazy inputs, so they only trigger the call when you actually connect something.
The single output is text - a STRING that you wire into Show Text, a text-to-file node, or downstream processing.
Installing it
ComfyUI Manager is the easy path: search "ComfyUI-Gemini", install, restart. Or do it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Visionatrix/ComfyUI-Gemini
Then restart ComfyUI. The only real dependency is google-generativeai>=0.8.5 - no model downloads, no weights, no VRAM. Then grab an API key from Google AI Studio (or GCP) and either drop it in the api_key input or set GOOGLE_API_KEY as an environment variable.
Where people get burned
- The free tier has daily caps. Hit your limit and you'll get rate-limit errors mid-workflow. That's exactly why
error_fallback_valueexists - set it to a non-empty string and the node returns it instead of dying when the API hiccups. Careful though: if the fallback is an empty string or unset, the node re-raises the exception instead of passing silently. - The
seedinput is cosmetic. It's in the UI, but the current code never forwards it to the API, so don't plan on reproducible runs. - Regional blocks are real. Gemini's API isn't available everywhere, which is why the
proxyinput exists (the README links to the VixFlows docs explaining when you need one). If you're somewhere Google is blocked and you're getting connection errors, that's your lever. - Safety filtering only goes so far.
BLOCK_NONEdisables the content filter as much as the API allows, but Gemini's stack is aggressively censored at the model level too. Don't design a workflow around NSFW output and expect it to work - it will quietly refuse. Great for the above-board captioning and Q&A stuff, useless for the other stuff. - "It asks for my API key" - you didn't set one. This is the single most common complaint, and it's always the same fix: create the key and set it in the node or the env var.
Where does this shine? Natural-language captioning for LLM-encoder models like Flux and Qwen-Image. Captioning advice usually leans on local VLMs like JoyCaption, but for a quick pass - or when you want actual sentences instead of Danbooru tags - pointing Ask Gemini at a batch of images beats spinning up another local model. It's not a replacement for a fine-tuned captioner; it's the "I just need to know what's in this image" node, and it's very good at being that.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Why number 42 is important? | — |
| safety_settings | COMBO | 3 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE | |
| response_type | COMBO | 2 options: text, json | |
| model | COMBO | 6 options: gemma-3-12b-it, gemma-3-27b-it, gemini-2.0-flash-lite-001, gemini-2.0-flash-001, gemini-2.5-flash, gemini-2.5-pro | |
| api_keyopt | STRING | — | |
| proxyopt | STRING | — | |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| system_instructionopt | STRING | — | |
| error_fallback_valueopt | STRING | — | |
| seedopt | INT | 443685160–2147483648 | — |
| temperatureopt | FLOAT | -0.05-0.05–1 | — |
| num_predictopt | INT | 00–1048576 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | — |