Nodes/ComfyUI-YogurtNodes/Vertex AI Generate Image
ComfyUI Node

Vertex AI Generate Image

Gemini image generation, inside your local ComfyUI graph — if you can stomach the GCP setup

By yogurt7771·Created 2 years ago·Updated 9 days ago· 1
Vertex AI Generate Image
  • image
  • image1
  • image2
  • image3
  • image4
  • history
  • image
  • images
  • num_images
  • text
  • history
  • thought
credentials
project_id
location
model_namegemini-3-pro-image-preview
system_prompt
prompt
temperature1.00
top_p0.00
top_k0
max_output_tokens32768
retry_count1
disable_safety_settingsfalse
disable_system_promptfalse
safety_levelBLOCK_NONE
thinking_budget0
chat_template<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->
proxy_url
seed-1
aspect_ratioauto
image_size2k
thinking_levelOFF
base_url
timeout0
extra{}

Here's the pitch: a node in your ComfyUI graph that generates images from Gemini's latest image model (gemini-3-pro-image-preview by default) and hands the result back as a real torch tensor that your local pipeline can keep processing - upscale it, VAE it, composite it, whatever. Local generation meets cloud generation on one canvas. That's genuinely useful for editing workflows where you want a model that isn't a checkpoint you have VRAM for. The catch, and it's a real one: this is Vertex AI, not a plain Gemini API key, which means Google Cloud service-account credentials and a project setup before it does anything.

How it works

The node calls Gemini through the google-genai SDK (that's the google-genai dependency in the pack's requirements) and returns the image as a torch.Tensor. Outputs:

  • image - the generated image as an IMAGE tensor you can wire straight into a VAE decode or upscale path
  • images - the full list, when the model returns more than one
  • num_images - how many came back, so the rest of the graph can adapt
  • text - Gemini's accompanying text (Gemini image models return a caption/description alongside the image)
  • history - conversation history, for chaining edits
  • thought - the model's reasoning trace when thinking is enabled

Optional image through image4 inputs turn it into an editing node: feed in an image and the prompt describes the edit. That's the real strength here - "change the lighting" against a rendered frame, using a frontier model, then feed the result back into your local graph.

The inputs that actually matter

  • credentials - the Vertex AI credentials JSON. This is the wall most people hit. It's a Google Cloud service-account key, not an AI Studio API key.
  • project_id and location - your GCP project and the Vertex AI region it lives in. All three are required and there's no default.
  • prompt (multiline) - what you want. system_prompt sets the overall style.
  • image_size (default 2k) and aspect_ratio (default auto) - Gemini-native output settings. 2k is the big one; drop it if you want faster returns.
  • seed (default -1) - random seed; set a fixed value for reproducibility, which matters when you're using this as a node in a pipeline you iterate on.

The defaults are worth noticing: safety_level ships as BLOCK_NONE and disable_safety_settings defaults to false, so out of the box it runs with minimal filtering. Google's platform still applies its own content rules on the API side, but the node isn't adding an extra censorship layer on top. If you want tighter filtering, change safety_level.

The honest cost

Vertex AI is a cloud API with a billing account behind it. Every generation costs money, and you're putting your GCP credentials inside your ComfyUI graph - a real security consideration in a tool that, as the ecosystem's history with malicious nodes shows, executes whatever a custom node imports. Don't share a workflow containing your credentials JSON with strangers, and don't leave a public ComfyUI instance reachable while this node is configured. It's not a reason to avoid the node; it's a reason to be deliberate about it.

Installing and setting up

Install the pack once via ComfyUI Manager (search "ComfyUI-YogurtNodes") or:

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

Then you need a Google Cloud project with Vertex AI enabled, a service-account key (JSON) with permission to call it, and the project ID + region. Paste the JSON into credentials, fill project_id and location. If you'd rather use a plain Gemini API key from AI Studio, that's what the pack's separate Gemini Generate Image node is for - this one is specifically the Vertex path, and the tooltips make that split explicit.

Common issues

Every failure here is a config failure. "401 / permission denied" - the service account lacks Vertex AI access; add the role in GCP. "Invalid region" - location has to be a region where the model is available (us-central1 is the usual starting point, though check current availability). Empty credentials - the node has nothing to authenticate with. And if you get timeouts, that's what timeout (default 0 = no limit) and retry_count exist for. Start with the smallest image_size, one seed, and confirm you get one image back before building anything ambitious on top of it.

CategoryYogurtNodes/LLM

Inputs (30)

NameTypeDefaultDescription
credentialsSTRINGCredentials JSON for accessing Vertex AI
project_idSTRINGGoogle Cloud project ID
locationSTRINGVertex AI location/region
model_nameSTRINGgemini-3-pro-image-previewGemini model name
system_promptSTRINGSystem-level prompt that affects the overall conversation style
promptSTRINGMain prompt content input by the user
temperatureFLOAT1.000–10Sampling temperature, higher values produce more random outputs
top_pFLOAT0.000–1Sampling probability threshold, controls output diversity
top_kINT00–2147483647Number of highest probability tokens to consider during sampling
max_output_tokensINT327680–2147483647Maximum number of tokens in the generated text
retry_countINT1Number of retries when request fails
disable_safety_settingsBOOLEANfalseWhether to disable safety settings, if true, the safety settings will not be set
disable_system_promptBOOLEANfalseWhether to disable the system prompt, if true, the system prompt will sent as a user prompt
safety_levelCOMBOBLOCK_NONESafety level for the generated text
thinking_budgetINT0Thinking budget for the model, if set to -1, the model will not limit thinking budget, if set to 0, the model will disable thinking
chat_templateSTRING<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->Content template for the generated text
proxy_urlSTRING代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h
seedINT-1-1–2147483647随机种子,设置为-1时随机种子
aspect_ratioCOMBOautoAspect ratio for the generated image
image_sizeCOMBO2kImage size for the generated image
thinking_levelCOMBOOFFThinking level for the model, if thinking budget is not 0, this parameter will be ignored
base_urlSTRINGBase URL for Gemini API
timeoutINT00–2147483647Timeout for the request in seconds, 0 means no timeout
imageoptIMAGE
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
historyoptHISTORY
extraoptSTRING{}Extra parameters for the request, in JSON format

Outputs (6)

NameTypeDescription
imageIMAGE
imagesIMAGE
num_imagesINT
textSTRING
historyHISTORY
thoughtSTRING