ComfyUI Node
OpenRouter Generate Image
Generate image using OpenRouter API and return as torch.Tensor (h,w,c) and text
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)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | API key for accessing OpenRouter API | |
| model_name | STRING | google/gemini-2.5-flash-image-preview | OpenRouter model name for image generation |
| system_prompt | STRING | System-level prompt that affects the overall image generation style | |
| prompt | STRING | Main prompt content for image generation | |
| temperature | FLOAT | 1.000–2 | Sampling temperature, higher values produce more random outputs |
| top_p | FLOAT | 0.000–1 | Sampling probability threshold, controls output diversity |
| max_tokens | INT | 81920–32768 | Maximum number of tokens in the generated text |
| retry_count | INT | 1 | Number of retries when request fails |
| provider | COMBO | auto | Infrastructure provider preference |
| provider_list | STRING | Provider list (comma separated, e.g: 'openai,azure,together'), empty means use provider | |
| chat_template | STRING | <-system-> {{system_instruction}} <-/system-> <-user-> {{prompt}} <-/user-> | Content template for the image generation prompt |
| proxy_url | STRING | 代理URL,格式: protocol://user:pass@addr:port,支持http,https,socks5,socks5h | |
| seed | INT | -1-1–2147483647 | Random seed for generation (-1 for random) |
| aspect_ratio | COMBO | auto | Aspect ratio for generated images |
| timeout | INT | 00–2147483647 | Timeout for the request in seconds, 0 means no timeout |
| image_size | COMBO | 1k | Image size for the generated image (gemini only for now) |
| imageopt | IMAGE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| historyopt | HISTORY | — | |
| extraopt | STRING | {} | Extra parameters for the request, in JSON format |
| return_textopt | BOOLEAN | true | Whether to request/return text output (controls modalities: image+text vs image only) |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| images | IMAGE | — |
| num_images | INT | — |
| text | STRING | — |
| history | HISTORY | — |