Nodes/ComfyUI-SimpleChat/Gemini Image Gen
ComfyUI Node

Gemini Image Gen

Ask Gemini to draw the image, right inside ComfyUI

By Moeblack·Created 9 months ago·Updated 7 months ago· 8
Gemini Image Gen
  • config
  • vars
  • IMAGE
  • text
prompt
aspect_ratio1:1
size1K

Most of this pack talks to LLMs and gets text back. Gemini Image Gen is the exception: it talks to Gemini's image models - gemini-2.5-flash-image (the "Nano Banana" line) or gemini-3-pro-image-preview - and gets an actual IMAGE back, dropped straight into your graph as a standard ComfyUI tensor. No local weights, no VRAM, no diffusers install. If you have a Gemini API key, you have an image generator.

It's not a Stable Diffusion replacement and it's not trying to be. Gemini's image model is much stronger at natural-language instruction, text rendering, and following "make the background this, keep the character that" requests than most local diffusion pipelines - and much weaker if what you want is a specific anime checkpoint's style. Reach for it when you want a fast, coherent image from a paragraph of description, or as a planning tool that sketches a concept before your local sampler does the final pass.

The inputs

  • config - required, and it must be a Gemini provider config. Feed it an OpenAI config and the node refuses with "Gemini Image Gen requires Gemini provider."
  • prompt - your description. Mustache {{var}} templating applies, so you can template it from other nodes.
  • aspect_ratio - 1:1 (default), 16:9, 9:16, 4:3, 3:4, 5:4, 4:5.
  • size - 1K (default), 2K, or 4K. Bigger costs more tokens; 1K is the sensible default for concept work.
  • vars - optional Mustache variables.

Outputs: IMAGE (the generated image, ready for VAE Decode/SaveImage) and text (the model's caption or notes, if any). If generation fails and no image comes back, it returns a blank black 512×512 image rather than erroring - so always check what actually rendered before you save.

How it behaves

The request goes through the same API Config provider layer as chat, just with the image-generation endpoint. Aspect ratio is passed to the API, and the image comes back already at the requested size. It's one API call - no iteration, no refiner, no --q mystery flag. Simple, and honestly refreshing after a decade of diffusion parameter golf.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/Moeblack/ComfyUI-SimpleChat

Restart, or use Manager and search "ComfyUI-SimpleChat". Only dependency is aiohttp. You need a Gemini API key from Google AI Studio, and the model name has to be a Gemini image model - the node's own description names gemini-2.5-flash-image or gemini-3-pro-image-preview, which you'll find via the Refresh Models button on API Config.

Gotchas

The image lands in your graph but is generated remotely - anything you describe leaves your machine, and Gemini's image output has its own content policy that will refuse some prompts outright. The size/aspect_ratio choices are Gemini's, not arbitrary; asking for 4K on a free-tier key can bump against rate limits. And remember the failure path: a blank image instead of an error means the generation silently failed, so check the text output for the model's excuse before blaming the node.

CategorySimpleChat/Gemini

Inputs (5)

NameTypeDefaultDescription
configSIMPLECHAT_CONFIG
promptSTRING
varsoptSIMPLECHAT_VARS
aspect_ratiooptCOMBO1:17 options: 1:1, 16:9, 9:16, 4:3, 3:4, 5:4, +1
sizeoptCOMBO1K3 options: 1K, 2K, 4K

Outputs (2)

NameTypeDescription
IMAGEIMAGE
textSTRING