Vertex AI Generate Image
Gemini image generation, inside your local ComfyUI graph — if you can stomach the GCP setup
- image
- image1
- image2
- image3
- image4
- history
- image
- images
- num_images
- text
- history
- thought
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 pathimages- the full list, when the model returns more than onenum_images- how many came back, so the rest of the graph can adapttext- Gemini's accompanying text (Gemini image models return a caption/description alongside the image)history- conversation history, for chaining editsthought- 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_idandlocation- 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_promptsets the overall style.image_size(default2k) andaspect_ratio(defaultauto) - Gemini-native output settings.2kis 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.
Inputs (30)
| Name | Type | Default | Description |
|---|---|---|---|
| credentials | STRING | Credentials JSON for accessing Vertex AI | |
| project_id | STRING | Google Cloud project ID | |
| location | STRING | Vertex AI location/region | |
| model_name | STRING | gemini-3-pro-image-preview | Gemini model name |
| system_prompt | STRING | System-level prompt that affects the overall conversation style | |
| prompt | STRING | Main prompt content input by the user | |
| temperature | FLOAT | 1.000–10 | Sampling temperature, higher values produce more random outputs |
| top_p | FLOAT | 0.000–1 | Sampling probability threshold, controls output diversity |
| top_k | INT | 00–2147483647 | Number of highest probability tokens to consider during sampling |
| max_output_tokens | INT | 327680–2147483647 | Maximum number of tokens in the generated text |
| retry_count | INT | 1 | Number of retries when request fails |
| disable_safety_settings | BOOLEAN | false | Whether to disable safety settings, if true, the safety settings will not be set |
| disable_system_prompt | BOOLEAN | false | Whether to disable the system prompt, if true, the system prompt will sent as a user prompt |
| safety_level | COMBO | BLOCK_NONE | Safety level for the generated text |
| thinking_budget | INT | 0 | Thinking 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_template | STRING | <-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user-> | Content template for the generated text |
| proxy_url | STRING | 代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h | |
| seed | INT | -1-1–2147483647 | 随机种子,设置为-1时随机种子 |
| aspect_ratio | COMBO | auto | Aspect ratio for the generated image |
| image_size | COMBO | 2k | Image size for the generated image |
| thinking_level | COMBO | OFF | Thinking level for the model, if thinking budget is not 0, this parameter will be ignored |
| base_url | STRING | Base URL for Gemini API | |
| timeout | INT | 00–2147483647 | Timeout for the request in seconds, 0 means no timeout |
| imageopt | IMAGE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| historyopt | HISTORY | — | |
| extraopt | STRING | {} | Extra parameters for the request, in JSON format |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| images | IMAGE | — |
| num_images | INT | — |
| text | STRING | — |
| history | HISTORY | — |
| thought | STRING | — |