Nodes/ComfyUI-YogurtNodes/OpenRouter Generate Image
ComfyUI Node

OpenRouter Generate Image

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

By yogurt7771·Created 2 years ago·Updated 2 months ago· 0
OpenRouter Generate Image
  • image
  • image1
  • image2
  • image3
  • image4
  • history
  • image
  • images
  • num_images
  • text
  • history
api_key
model_namegoogle/gemini-2.5-flash-image-preview
system_prompt
prompt
temperature1.00
top_p0.00
max_tokens8192
retry_count1
providerauto
provider_list
chat_template<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->
proxy_url
seed-1
aspect_ratioauto
timeout0
image_size1k
extra{}
return_texttrue
CategoryYogurtNodes/LLM

Inputs (24)

NameTypeDefaultDescription
api_keySTRINGAPI key for accessing OpenRouter API
model_nameSTRINGgoogle/gemini-2.5-flash-image-previewOpenRouter model name for image generation
system_promptSTRINGSystem-level prompt that affects the overall image generation style
promptSTRINGMain prompt content for image generation
temperatureFLOAT1.000–2Sampling temperature, higher values produce more random outputs
top_pFLOAT0.000–1Sampling probability threshold, controls output diversity
max_tokensINT81920–32768Maximum number of tokens in the generated text
retry_countINT1Number of retries when request fails
providerCOMBOautoInfrastructure provider preference
provider_listSTRINGProvider list (comma separated, e.g: 'openai,azure,together'), empty means use provider
chat_templateSTRING<-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user->Content template for the image generation prompt
proxy_urlSTRING代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h
seedINT-1-1–2147483647Random seed for generation (-1 for random)
aspect_ratioCOMBOautoAspect ratio for generated images
timeoutINT00–2147483647Timeout for the request in seconds, 0 means no timeout
image_sizeCOMBO1kImage size for the generated image (gemini only for now)
imageoptIMAGE
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
historyoptHISTORY
extraoptSTRING{}Extra parameters for the request, in JSON format
return_textoptBOOLEANtrueWhether to request/return text output (controls modalities: image+text vs image only)

Outputs (5)

NameTypeDescription
imageIMAGE
imagesIMAGE
num_imagesINT
textSTRING
historyHISTORY