Nodes/comfyui_soze_gemini/Vertex Gemini (Soze)
ComfyUI Node

Vertex Gemini (Soze)

Nano Banana, Billed to Your Own Google Cloud Project

By SozeInc·Created 9 months ago·Updated 19 days ago· 0
Vertex Gemini (Soze)
  • images
  • frames
  • audio
  • text
  • image
◄promptCreate a vivid word-picture representation of this image include elements that characterize the subject, costume, prop elemts, the action, the background, layout and composition elements present on the scene, be sure to mention the style and mood of the scene. Like it would a film director or director of photography►
◄operation_modegenerate_images►
◄model_namegemini-3.1-flash-image►
◄temperature0.80►
◄thinking_levelminimal►
◄media_resolution1K►
◄video►
◄system_prompt►
◄seed0►
◄sequential_generationfalse►
◄batch_count1►
◄aspect_rationone►
◄external_api_key►
◄bypassfalse►
◄chat_modefalse►
◄clear_historyfalse►
◄structured_outputfalse►
◄max_images6►
◄max_output_tokens8192►
◄use_random_seedfalse►
◄api_call_delay1.0►
◄auth_modeauto►
◄vertex_project►
◄vertex_location►

What this node is, and who it's actually for

Gemini's image models - the Nano Banana line - have no weights you can download, ever. So if you want them inside ComfyUI, you call them. Two obvious doors: Comfy's own official Partner Nodes, on prepaid credits through your Comfy account, or a third-party pack pointed at a reseller. This node is a third door: your own Google Cloud project, via Vertex AI.

That's the pitch: same model, same behaviour, but the request lands on aiplatform.googleapis.com under your GCP project, billed to your account, under your quotas and region. Already have Cloud credits, or an org that wants service accounts and audit logs? This is your version.

On the pack: one person's port of the well-known ComfyUI-IF_Gemini by ImpactFrames, updated for the Gemini 3 API with OpenRouter support stripped out. "vertex ai" appears in about nine Reddit threads over the past year, so you won't google your way out of trouble - you'll read the source.

How it works

Soze_VertexGemini subclasses the pack's AI Studio node and overrides exactly three things: credential resolution, client construction, and passing per-node credential overrides through. Everything else - prompt assembly, batching, image extraction, error strings - is inherited unchanged.

The client is the same google-genai SDK, just built with vertexai=True. Google's SDK treats an API key and a project/location pair as mutually exclusive, so auth_mode picks which one it hands over: express uses VERTEX_API_KEY and ignores region (express keys always hit the global endpoint), adc uses project + location with Application Default Credentials, and auto (default) prefers the express key and falls back to ADC.

Credentials live in their own variables (env vars, shell rc, or a .env next to the node), so they never collide with a GEMINI_API_KEY already wired up for the AI Studio node in the same graph. Images come back as inline bytes, concatenated into one batch - a batch_count of 4 gives you a single IMAGE output with four frames, not four outputs.

The inputs you'll actually touch

  • prompt - and change it immediately. The shipped default is a "describe this image like a director of photography" instruction, left over from analysis, while the default operation_mode is generate_images. You'll get a picture of nothing in particular.
  • operation_mode - generate_images, analysis, or generate_text. Same node, but the text output means something completely different in each.
  • model_name - four image-capable IDs (gemini-3.1-flash-image is the default, and is Nano Banana 2; gemini-3-pro-image is Nano Banana Pro with 4K output) plus three text models. These IDs differ from AI Studio's - the ...-preview suffixes are gone. Ask for a text model in generate_images mode and the node silently swaps in gemini-3.1-flash-image instead of failing, which is worth remembering when the output surprises you.
  • images - reference images for style/consistency work, capped by max_images (default 6) and resized per media_resolution.
  • video, frames, audio - the multimodal analysis inputs. video is a path string to a local file, not a Comfy video object: it's uploaded through the Files API and polled until ready. Files carrying subtitle or data streams can get rejected, so the node remuxes them with ffmpeg when it can - keep ffmpeg/ffprobe on PATH and save yourself the mystery error.
  • aspect_ratio and media_resolution - the latter pulls double duty in image mode: sent as image_size and as the cap on reference-image resizing (1K→1024px, 4K→4096). In the text modes it's inert; the code just logs it.
  • thinking_level - none sends no thinking config; the rest map to Gemini 3's reasoning level, or an integer token budget on older SDKs. The README quotes 4096/16384 for medium/high, the shipped code maps medium→8192 and high→dynamic. Trust the code.
  • batch_count / sequential_generation / api_call_delay - batch makes N independent paid calls; sequential chains them, feeding each step's text back as the next prompt. The one-second delay is there for a reason; don't zero it and then wonder about rate limits.
  • external_api_key, vertex_project, vertex_location - per-node credential overrides, so both styles can stay configured and you pick per run.

Outputs are text and image. The text output carries the model's answer in generate_text/analysis, and in image mode it's a status report - model used, seed, resolution, and on failure the finish reason and safety ratings. Wire image into Save Image or a Preview, text into anything that eats strings.

Installing it

ComfyUI Manager, search the pack title comfyui_soze_gemini, or:

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

Restart ComfyUI afterwards. No model download - there's no model. The dependency that matters is google-genai; the google-generativeai in requirements.txt is legacy and never imported. Then credentials, express mode:

export VERTEX_API_KEY="your-express-key"

or ADC, which is the more "real Vertex" path:

gcloud auth application-default login
export VERTEX_PROJECT_ID="your-project-id"
export VERTEX_LOCATION="global"

Then, and this is the step people skip, find out what your project can actually reach:

cd ComfyUI/custom_nodes/ComfyUI_Soze_Gemini
python list_vertex_models.py

It prints the endpoint you resolved to and lists the models, flagging the image-capable ones.

Where people get burned

404 NOT_FOUND "was not found or your project does not have access to it." Two causes, both common: the Gemini 3.x image models are global-endpoint only, so a VERTEX_LOCATION of us-central1 404s them, or your project isn't allowlisted. Set the location to global or use an express key, then run the diagnostic script instead of guessing.

Errors come back as text, not exceptions. No key, quota exceeded, safety block - you get a grey 1024×1024 placeholder image and the reason in the text output. Read that first; it usually names the problem outright, finish_reason included.

The README's "Verify API Key" button isn't on this node. The web extension only attaches to the AI Studio node, and the endpoint behind the button checks GEMINI_API_KEY anyway. On Vertex, list_vertex_models.py is your verification.

And the standing one: BLOCK_NONE safety settings are requested, but the filter lives in the model, so they buy you nothing. Prompts Google refuses are refused, and your reference images left the machine. That's the deal with every API node in ComfyUI.

CategorySoze Nodes

Inputs (27)

NameTypeDefaultDescription
promptSTRINGCreate a vivid word-picture representation of this image include elements that characterize the subject, costume, prop elemts, the action, the background, layout and composition elements present on the scene, be sure to mention the style and mood of the scene. Like it would a film director or director of photography—
operation_modeCOMBOgenerate_images3 options: analysis, generate_text, generate_images
model_nameCOMBOgemini-3.1-flash-image7 options: gemini-3.1-flash-image, gemini-3.1-flash-lite-image, gemini-3-pro-image, gemini-2.5-flash-image, gemini-3.1-pro-preview, gemini-3-flash-preview, +1
temperatureFLOAT0.800–1—
thinking_levelCOMBOminimal5 options: none, minimal, low, medium, high
media_resolutionCOMBO1K3 options: 1K, 2K, 4K
imagesoptIMAGE—
videooptSTRING—
framesoptIMAGE—
audiooptAUDIO—
system_promptoptSTRING—
seedoptINT00–4294967295—
sequential_generationoptBOOLEANfalse—
batch_countoptINT11–20—
aspect_ratiooptCOMBOnone11 options: none, 1:1, 2:3, 3:2, 3:4, 4:3, +5
external_api_keyoptSTRING—
bypassoptBOOLEANfalse—
chat_modeoptBOOLEANfalse—
clear_historyoptBOOLEANfalse—
structured_outputoptBOOLEANfalse—
max_imagesoptINT61–16—
max_output_tokensoptINT81921–32768—
use_random_seedoptBOOLEANfalse—
api_call_delayoptFLOAT1.00–60—
auth_modeoptCOMBOauto3 options: auto, express, adc
vertex_projectoptSTRING—
vertex_locationoptSTRING—

Outputs (2)

NameTypeDescription
textSTRING—
imageIMAGE—