Nodes/ComfyUI-Gemini-Direct/Gemini Image Generate (Direct API)
ComfyUI Node

Gemini Image Generate (Direct API)

A ComfyUI node in Gemini Direct with 10 inputs and 4 outputs.

By jeremieLouvaert·Created 5 months ago·Updated 26 days ago· 2
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)

NameTypeDefaultDescription
promptSTRINGText prompt for image generation. Supports long, detailed prompts.
modelCOMBOgemini-3-pro-image-previewPro = best quality ($0.13-0.24) | 3.1 Flash = balanced ($0.05-0.15) | 2.5 Flash = cheapest ($0.04, 1K only)
seedINT00–18446744073709550000Seed for reproducibility
aspect_ratioCOMBO2:3Output aspect ratio. 'auto' lets the model decide.
resolutionCOMBO2KOutput resolution. Falls back if unsupported by chosen model.
response_modalitiesCOMBOIMAGE+TEXTIMAGE+TEXT returns image + description. IMAGE returns image only.
imagesoptIMAGEReference images (batched) used as visual context. Example: batch a background + character images, then prompt 'integrate these people into the background'.
system_promptoptSTRINGYou 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_keyoptSTRINGGoogle AI API key. Falls back to GEMINI_API_KEY env var or gemini_api_key.txt in ComfyUI root.
timeout_secoptINT12010–600HTTP 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)

NameTypeDescription
imagesIMAGE
textSTRING
cost_infoSTRING
cache_keySTRING