Nodes/ComfyUI-YogurtNodes/Gemini Generate Image
ComfyUI Node

Gemini Generate Image

Generate image using Gemini API and return as torch.Tensor (h,w,c) and text

By yogurt7771·Created 2 years ago·Updated 2 months ago· 0
Gemini Generate Image
  • image
  • image1
  • image2
  • image3
  • image4
  • history
  • image
  • images
  • num_images
  • text
  • history
  • thought
api_key
vertexfalse
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{}
CategoryYogurtNodes/LLM

Inputs (29)

NameTypeDefaultDescription
api_keySTRINGAPI key for accessing Gemini API
vertexBOOLEANfalseUse Vertex AI for Gemini API
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