Nodes/comfyui-google-genmedia-custom-nodes/Gemini 3.1 Flash Image (🍌)
ComfyUI Node

Gemini 3.1 Flash Image (🍌)

The speed-quality sweet spot, in graph form

By GoogleCloudPlatformΒ·Created 8 months agoΒ·Updated about a month agoΒ· 47
Gemini 3.1 Flash Image (🍌)
  • image1
  • image2
  • image3
  • image4
  • image5
  • image6
  • Generated Image
β—„modelGEMINI_31_FLASH_IMAGEβ–Ί
β—„promptA vivid landscape painting of a futuristic cityβ–Ί
β—„aspect_ratio16:9β–Ί
β—„image_size1Kβ–Ί
β—„output_mime_typePNGβ–Ί
β—„temperature0.70β–Ί
β—„top_p1.00β–Ί
β—„top_k32β–Ί
β—„harassment_thresholdBLOCK_MEDIUM_AND_ABOVEβ–Ί
β—„hate_speech_thresholdBLOCK_MEDIUM_AND_ABOVEβ–Ί
β—„sexually_explicit_thresholdBLOCK_MEDIUM_AND_ABOVEβ–Ί
β—„dangerous_content_thresholdBLOCK_MEDIUM_AND_ABOVEβ–Ί
β—„system_instructionβ–Ί
β—„gcp_project_idβ–Ί
β—„gcp_regionglobalβ–Ί

The Nano Banana 2 - the "Gemini 3.1 Flash Image" model behind this node - is Google's answer to the classic trade-off. Nano Banana Pro gives you the top-end quality, but it's the expensive flagship. The Flash line is where Google put the speed-quality balance, and this node brings it into ComfyUI as a native IMAGE output you can drop into any existing graph. For fast iteration and reference-image editing, it's usually the one you actually want.

How it works

Same shape as the rest of this pack's image nodes: it calls gemini-3.1-flash-image on Vertex AI, waits for the result, and returns a torch tensor batch. The model does its own thing server-side - prompt understanding, image composition, reference handling - and your GPU only has to display the output. The notable mechanical difference from the older Flash node is what the API now exposes: extreme aspect ratios and an explicit output-size knob.

Inputs that matter

  • prompt - the text description. Default is a futuristic city landscape; replace it.
  • image1 through image6 - up to six reference images for editing or style transfer. More slots than the older Nano Banana node, which tops out at three.
  • image_size - 512px, 1K, 2K, or 4K. The 4K option is new-ish for the Flash tier and worth testing if you want headroom without jumping to Pro pricing.
  • aspect_ratio - this is where Flash 3.1 gets weird and useful: the dropdown goes from 1:8 to 8:1, plus the standard 1:1, 16:9, 9:16 and friends. Google's pano-style ratios let you make banners and tall posters without cropping.
  • output_mime_type - PNG or JPEG.
  • temperature / top_p / top_k - sampling controls; defaults are fine for most work.
  • system_instruction - optional hidden guidance for consistent behavior across runs.

Then the standard tail: four safety-filter dropdowns (all BLOCK_MEDIUM_AND_ABOVE by default), and gcp_project_id plus gcp_region (region defaults to global) - every node in this pack needs your GCP project or it won't authenticate.

Installing it

It's part of the Google GenMedia pack, so the install is identical to every other node here:

cd ComfyUI/custom_nodes
git clone https://github.com/GoogleCloudPlatform/comfyui-google-genmedia-custom-nodes
pip install -r comfyui-google-genmedia-custom-nodes/requirements.txt

Or grab it from ComfyUI Manager by searching comfyui-google-genmedia-custom-nodes. No weights to download - the dependencies are just Google's SDKs. Auth is gcloud auth application-default login, then restart ComfyUI and look under Google AI/GeminiFlashImage.

What to watch for

It's a paid API like everything else in this pack - per-image Vertex AI billing, and 4K costs more than 512px. The safety filters are Google's, so it shares the same censorship ceiling as its siblings. And keep in mind you're at Google's mercy for model availability: the model version behind the dropdown can change or get retired without you touching a thing. For casual, fast image work where Nano Banana Pro's absolute ceiling isn't worth the price, this is the pragmatic pick.

CategoryGoogle AI/GeminiFlashImage

Inputs (21)

NameTypeDefaultDescription
modelCOMBOGEMINI_31_FLASH_IMAGE1 options: GEMINI_31_FLASH_IMAGE
promptSTRINGA vivid landscape painting of a futuristic cityβ€”
aspect_ratioCOMBO16:914 options: 1:1, 1:4, 4:1, 1:8, 8:1, 2:3, +8
image_sizeCOMBO1K4 options: 512px, 1K, 2K, 4K
output_mime_typeCOMBOPNG2 options: PNG, JPEG
temperatureFLOAT0.700–1β€”
top_pFLOAT1.000–1β€”
top_kINT321–64β€”
image1optIMAGEβ€”
image2optIMAGEβ€”
image3optIMAGEβ€”
image4optIMAGEβ€”
image5optIMAGEβ€”
image6optIMAGEβ€”
harassment_thresholdoptCOMBOBLOCK_MEDIUM_AND_ABOVE4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE
hate_speech_thresholdoptCOMBOBLOCK_MEDIUM_AND_ABOVE4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE
sexually_explicit_thresholdoptCOMBOBLOCK_MEDIUM_AND_ABOVE4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE
dangerous_content_thresholdoptCOMBOBLOCK_MEDIUM_AND_ABOVE4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE
system_instructionoptSTRINGβ€”
gcp_project_idoptSTRINGGCP project id where Vertex AI API will query Gemini
gcp_regionoptSTRINGglobalGCP region for Vertex AI API

Outputs (1)

NameTypeDescription
Generated ImageIMAGEβ€”