Gemini 3.1 Flash Image (π)
The speed-quality sweet spot, in graph form
- image1
- image2
- image3
- image4
- image5
- image6
- Generated Image
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, or4K. 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:8to8:1, plus the standard1:1,16:9,9:16and friends. Google's pano-style ratios let you make banners and tall posters without cropping. - output_mime_type -
PNGorJPEG. - 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.
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | GEMINI_31_FLASH_IMAGE | 1 options: GEMINI_31_FLASH_IMAGE |
| prompt | STRING | A vivid landscape painting of a futuristic city | β |
| aspect_ratio | COMBO | 16:9 | 14 options: 1:1, 1:4, 4:1, 1:8, 8:1, 2:3, +8 |
| image_size | COMBO | 1K | 4 options: 512px, 1K, 2K, 4K |
| output_mime_type | COMBO | PNG | 2 options: PNG, JPEG |
| temperature | FLOAT | 0.700β1 | β |
| top_p | FLOAT | 1.000β1 | β |
| top_k | INT | 321β64 | β |
| image1opt | IMAGE | β | |
| image2opt | IMAGE | β | |
| image3opt | IMAGE | β | |
| image4opt | IMAGE | β | |
| image5opt | IMAGE | β | |
| image6opt | IMAGE | β | |
| harassment_thresholdopt | COMBO | BLOCK_MEDIUM_AND_ABOVE | 4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE |
| hate_speech_thresholdopt | COMBO | BLOCK_MEDIUM_AND_ABOVE | 4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE |
| sexually_explicit_thresholdopt | COMBO | BLOCK_MEDIUM_AND_ABOVE | 4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE |
| dangerous_content_thresholdopt | COMBO | BLOCK_MEDIUM_AND_ABOVE | 4 options: BLOCK_NONE, BLOCK_ONLY_HIGH, BLOCK_MEDIUM_AND_ABOVE, BLOCK_LOW_AND_ABOVE |
| system_instructionopt | STRING | β | |
| gcp_project_idopt | STRING | GCP project id where Vertex AI API will query Gemini | |
| gcp_regionopt | STRING | global | GCP region for Vertex AI API |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Generated Image | IMAGE | β |