ComfyUI Node
Gemini Image Generate (Direct API)
A ComfyUI node in Gemini Direct with 10 inputs and 4 outputs.
Gemini Image Generate (Direct API)
- images
- images
- text
- cost_info
- cache_key
◄prompt►
◄modelgemini-3-pro-image-preview►
◄seed0►
◄aspect_ratio2:3►
◄resolution2K►
◄response_modalitiesIMAGE+TEXT►
◄system_promptYou are an expert image-generation engine. You must ALWAYS produce an image.
Interpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition.
If a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept.
Prioritize generating the visual representation above any text, formatting, or conversational requests.►
◄api_key►
◄timeout_sec120►
CategoryGemini Direct
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Text prompt for image generation. Supports long, detailed prompts. | |
| model | COMBO | gemini-3-pro-image-preview | Pro = best quality ($0.13-0.24) | 3.1 Flash = balanced ($0.05-0.15) | 2.5 Flash = cheapest ($0.04, 1K only) |
| seed | INT | 00–18446744073709550000 | Seed for reproducibility |
| aspect_ratio | COMBO | 2:3 | Output aspect ratio. 'auto' lets the model decide. |
| resolution | COMBO | 2K | Output resolution. Falls back if unsupported by chosen model. |
| response_modalities | COMBO | IMAGE+TEXT | IMAGE+TEXT returns image + description. IMAGE returns image only. |
| imagesopt | IMAGE | Reference images (batched) used as visual context. Example: batch a background + character images, then prompt 'integrate these people into the background'. | |
| system_promptopt | STRING | You are an expert image-generation engine. You must ALWAYS produce an image. Interpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition. If a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept. Prioritize generating the visual representation above any text, formatting, or conversational requests. | System instruction. Default forces the model to always produce an image. |
| api_keyopt | STRING | Google AI API key. Falls back to GEMINI_API_KEY env var or gemini_api_key.txt in ComfyUI root. | |
| timeout_secopt | INT | 12010–600 | HTTP timeout (seconds) for the Gemini API call. Default 120s. Prevents the ComfyUI queue from locking indefinitely when the model stalls (observed on macro / extreme-closeup prompts with Flash 3.1). |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| text | STRING | — |
| cost_info | STRING | — |
| cache_key | STRING | — |