Nodes/comfyUI_Vertex_API/Vertex AI Image (Gemini 3/Imagen)
ComfyUI Node

Vertex AI Image (Gemini 3/Imagen)

Nano Banana inside your graph, without the VRAM bill

By linfen0·Created 10 months ago·Updated 10 months ago· 2
Vertex AI Image (Gemini 3/Imagen)
  • vertex_config
  • image_input
  • image_2
  • image_3
  • image_4
  • generation_config
  • image
  • raw_response
  • generation_config
promptA cinematic shot of a cyberpunk detective
model_namegemini-3-pro-image-preview
aspect_ratio1:1
person_generationALLOW_ADULT
output_resolution1K
output_formatimage/png
negative_prompt
custom_model_name

This is the node people actually install this pack for. It calls Google's Gemini image models - Gemini 3 Pro Image, the model the community knows as Nano Banana Pro - and drops the result back into your graph as a normal IMAGE tensor, as if a local sampler had made it. Under the hood it's an HTTP client with your credentials baked in: your prompt and reference images leave the machine, go to Vertex AI, and come back as PNGs.

That tradeoff is the whole story. There are no weights to download and no GPU required - 4K native output from a model you can't run locally, ever, because Google opens no generator - our closed-source-models doc has the full context on that front. The price is per-image: Nano Banana Pro runs roughly $0.04–0.24 depending on resolution, every image carries an invisible SynthID watermark, and Google's content filter is not negotiable. You use this node for a capability local can't offer, not as a default.

How it works

You feed it a vertex_config (from VertexAIAuth), a prompt, and it POSTs to the Vertex AI :streamGenerateContent endpoint. The interesting parts:

  • Up to 4 reference images - image_input plus image_2, image_3, image_4. Each is base64-encoded inline and sent alongside your text, which gives you a genuine image-to-image path to Gemini's native generation. This is the killer feature - Nano Banana Pro's whole reputation is built on how well it follows reference images.
  • negative_prompt - the code appends it to your prompt as an inline --negative_prompt=... flag rather than a separate API field. Works, but it's blunt.
  • Generation parameters - aspect_ratio (1:1, 16:9, 9:16, 4:3, 3:4, 21:9), output_resolution (1K/2K/4K), output_format (PNG/JPEG), and person_generation (ALLOW_ADULT / ALLOW_ALL / DONT_ALLOW) all go into the imageConfig payload. Set them on the node - they override anything a connected generation_config object carries.

Three outputs: image (the tensor, ready to wire into a preview or save node), raw_response (the full JSON blob from Google, handy for debugging), and generation_config (the payload that was actually sent, so you can inspect or pass it on).

The inputs a beginner actually touches

  • vertex_config - from the Auth node. Non-negotiable.
  • prompt - your text prompt, multiline.
  • model_name - dropdown of Gemini image models.
  • custom_model_name - the escape hatch: type any model string here and it overrides the dropdown.

Installing it

ComfyUI Manager → search comfyUI_Vertex_API, or:

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

Restart ComfyUI, then add VertexAIAuth, run it once so your credentials save, and wire its vertex_config into this node's vertex_config input.

Where people get burned

  • Black 512×512 image, no error - that's the node's "the API returned no image" fallback. Usually a safety block on your prompt, a bad model_name, or a reference image Google rejected. Check the raw_response output; it'll tell you what actually happened.
  • Malformed URL on the service-account path - if you auth with a service account JSON, the code reads a location field out of that file to build the API URL, and a standard Google service-account JSON doesn't have one. The API-key route avoids this entirely, which is why the README recommends it for personal use.
  • Cost creep - each run is a metered call. A session of failed generations is a session of billed generations; check Google Cloud billing before you iterate for an hour.
  • The filter is the model - no amount of prompt trickery undoes Google's refusal. If the prompt wouldn't pass ImageFX, it won't pass here.
CategoryVertexAI

Inputs (14)

NameTypeDefaultDescription
vertex_configVERTEX_CONFIG
promptSTRINGA cinematic shot of a cyberpunk detective
model_nameCOMBOgemini-3-pro-image-preview3 options: gemini-3-pro-image-preview, gemini-3.0-pro-preview, gemini-2.5-flash-image
aspect_ratioCOMBO1:16 options: 1:1, 16:9, 9:16, 4:3, 3:4, 21:9
person_generationCOMBOALLOW_ADULT3 options: ALLOW_ADULT, ALLOW_ALL, DONT_ALLOW
output_resolutionCOMBO1K3 options: 1K, 2K, 4K
output_formatCOMBOimage/png2 options: image/png, image/jpeg
image_inputoptIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
generation_configoptGENERATION_CONFIG
negative_promptoptSTRING
custom_model_nameoptSTRING

Outputs (3)

NameTypeDescription
imageIMAGE
raw_responseSTRING
generation_configGENERATION_CONFIG