Nodes/ComfyUI-AnyLLM/Google Gemini (AnyLLM)
ComfyUI Node

Google Gemini (AnyLLM)

Put a real Gemini model — including Nano Banana — inside your ComfyUI graph

By Akkisdiary·Created 8 months ago·Updated 4 months ago· 1
Google Gemini (AnyLLM)
  • images
  • text
  • images
modelgemini-3-flash-preview
api_key
response_imagesfalse
prompt

Google Gemini (AnyLLM) is a thin API bridge: it lets a node in your graph talk to Google's Gemini models over the network instead of running anything locally. The node class is GoogleGemini, it ships in the small Akkisdiary/ComfyUI-AnyLLM pack, and there's a second node in the pack - Get Environment Variable (AnyLLM) - that feeds it an API key.

The name is doing a lot of work, so let's be clear about what this isn't. It isn't a local model, it doesn't need a GPU, and it won't help you with uncensored content - everything goes through Google's API, safety filters included. What it is is the fastest way to give a ComfyUI workflow actual reading comprehension, or to generate images natively with Gemini's image models instead of running a diffusion checkpoint locally.

Why you'd reach for it

Two genuinely useful patterns, neither of which needs any of the heavyweight local-LLM node packs:

  • Vision in, text out. Feed your freshly rendered image into the images input, write "caption this, then critique the composition" in the prompt, and wire the text output back into the graph - an auto-captioning loop, a feedback pass that nudges your next prompt, or a description saved alongside the render.
  • Native image generation. The model dropdown includes gemini-2.5-flash-image and gemini-3-pro-image-preview - Nano Banana and Nano Banana Pro under the hood: 4K output on Pro, decent text rendering, SynthID watermarks, real money per image. Flip response_images on and the node decodes what Gemini returns straight into a ComfyUI IMAGE tensor you can feed a save node.

How it works

The node uses Google's official google-genai SDK (pinned to 1.56.0 in the pack's requirements.txt), so you're not depending on some hand-rolled API client. Under the hood it converts every ComfyUI IMAGE tensor to PNG bytes and sends them as content parts alongside your text prompt, then calls client.models.generate_content. When response_images is true it sets response_modalities=["TEXT", "IMAGE"], telling the model it may answer with images. Any image parts that come back are decoded back into tensors.

Two implementation details worth knowing because they bite: if the model returns no images, the node passes through your input images - or, if you gave it none, a blank 64x64 image - so the images output always has something to wire into. And if you leave the prompt empty, it sends "Hello" rather than erroring.

The inputs that actually matter

The full input list from the schema: model (a dropdown), api_key, prompt, images (optional IMAGE), and response_images (boolean). Outputs are text (STRING) and images (IMAGE). Of those, a beginner sets three:

  • model - a five-choice dropdown. gemini-3-flash-preview is the sensible default for text/vision work; switch to gemini-2.5-flash-image or gemini-3-pro-image-preview for generation with response_images on.
  • api_key - connect this from Get Environment Variable (AnyLLM), set to GOOGLE_API_KEY. That keeps the key out of your workflow JSON, which gets shared around. The pack passes keys only at runtime and never stores them; it also raises immediately if the key is missing or empty, so a broken setup fails loudly on the node.
  • response_images - off by default. On, if the model supports it.

Installing it

Via ComfyUI Manager, search for ComfyUI-AnyLLM (if it's not in the registry yet, use Manager's "Install via Git URL" and paste the repo URL). Or manually:

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

Then restart ComfyUI. Dependencies are light - google-genai, numpy, pillow - no model downloads, no heavy weights. You do need a Google API key from aistudio.google.com, and Gemini is a paid API; a feedback loop that calls a vision model on every generation is a quiet way to spend a few cents per workflow run. Watch the bill if you're looping.

Common issues

  • "Google API key is required" - the api_key input is empty. The node failing loudly here is by design; wire up the env-var node or paste a key directly.
  • "google-genai is not installed" - you skipped the pip step, or you installed into a different Python environment than the one ComfyUI runs in. If you use a venv or a portable build, that's where requirements need to go.
  • Model ignores response_images - plain text models don't generate images; capabilities differ per model, as the README warns. Use the image-suffixed models for generation.

One honest caveat, and it's about the pack, not the node: ComfyUI-AnyLLM is brand new - zero community track record, no reputation anywhere I can find. Custom nodes execute arbitrary Python on import with full user-level access, and this ecosystem's history includes the LLMVISION malware incident, so the standing advice applies: skim the source before you trust any fresh pack. This one is a short, legible wrapper - a two-minute read of nodes/google_gemini.py - but it's exactly the kind of small, useful, low-fame pack you glance at rather than install blind.

CategoryAnyLLM/Google

Inputs (5)

NameTypeDefaultDescription
modelCOMBOgemini-3-flash-preview5 options: gemini-3-flash-preview, gemini-3-pro-preview, gemini-2.5-flash-lite, gemini-2.5-flash-image, gemini-3-pro-image-preview
imagesoptIMAGE
api_keyoptSTRING
response_imagesoptBOOLEANfalse
promptoptSTRING

Outputs (2)

NameTypeDescription
textSTRING
imagesIMAGE