Gemini Generate Image
Google's image model, piped straight into your ComfyUI graph
- image
- image1
- image2
- image3
- image4
- history
- image
- images
- num_images
- text
- history
- thought
Gemini Generate Image is the pack's flagship cloud node: it calls Google's Gemini API through the official google-genai SDK and hands the result back as a normal ComfyUI IMAGE tensor - plus the model's text output, a thought trace, and the generated images as a list. One node, and you've got Google's image generation inside a local graph, no GPU required.
That last part is the whole pitch. Local sampling needs a serious GPU; Gemini runs in Google's cloud, so a laptop with a weak iGPU can still produce images. It's not a replacement for local diffusion - you're paying per image, subject to API quotas, and at the mercy of Google's safety and availability - but for "I need an image and I have no VRAM," it beats staring at your own hardware. The node also accepts up to five input images (image plus image1–image4), so it doubles as an image editor: send in a photo and prompt a change.
How it works
The node collects any connected input images, converts them to PIL, and sends a generation request to Gemini via the google-genai client. The default model_name is gemini-3-pro-image-preview - note that's the shipped default string, and image models rotate frequently, so if the call fails with a model error, check which image-capable models your key can actually access and set model_name accordingly. Results come back as a [N,H,W,C] tensor batch, with the response text and (if the model provides it) reasoning in the thought output.
Inputs that matter
api_key- or the shared key file /GEMINI_API_KEYenv var.vertex- flip on to route through Google Cloud Vertex AI instead of the consumer API.prompt- the image description;system_promptfor overall style guidance.aspect_ratio-auto,1:1,9:16,16:9,3:4,4:3,3:2,2:3,5:4,4:5,21:9.image_size-1k,2k, or4k(default2k). Bigger is sharper and pricier.seed--1for random, else fixed for reproducibility.thinking_budget/thinking_level- reasoning controls;0disables thinking,-1leaves it unlimited, andthinking_level(OFF/AUTO/LOW/HIGH) is ignored unless the budget is0.disable_safety_settingsandsafety_level- Google filters content by default;safety_leveldefaults toBLOCK_NONEand you can disable the settings entirely. Know your provider's ToS before leaning on these.base_url,proxy_url,timeout- endpoint override, proxy support, and timeout (0 = none).
Outputs
image- first generated image as IMAGE;images- the full list;num_images- count.text- model response text;thought- reasoning trace if the model thinks.history- conversation history for chaining further calls.
Install & key setup
Part of ComfyUI-YogurtNodes; the Gemini nodes need google-genai, which the pack's requirements install:
cd ComfyUI/custom_nodes
git clone https://github.com/yogurt7771/ComfyUI-YogurtNodes.git
cd ComfyUI-YogurtNodes
pip install -r requirements.txt
Restart ComfyUI; the node is under "Yogurt Nodes" → LLM. Keys resolve in this order: the api_key field → api_key.json in custom_nodes/ComfyUI-YogurtNodes/yogurt_nodes/llm/ ({"gemini": "YOUR_KEY"}) → the GEMINI_API_KEY env var. Get a key from Google AI Studio.
Common issues
- "Model not found" - the default
gemini-3-pro-image-previewstring may not match what your key can access. Setmodel_nameto a currently available image model. - "Auth failed" - check the three key sources in priority order.
- "Images are smaller/blockier than I hoped" - bump
image_sizeto4k; watch the cost. - "Content filtered" - check
safety_level/disable_safety_settingsand your prompt wording.
This is the node I'd actually reach for among the pack's cloud options if I had to pick one - Gemini's image models are strong and the node surfaces the interesting extras (aspect ratios, thinking, editing) without burying them. Just keep a close eye on your API bill.
Inputs (29)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | API key for accessing Gemini API | |
| vertex | BOOLEAN | false | Use Vertex AI for Gemini API |
| 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 | — |