ComfyUI Node
Grok Generate Image
Generate image using xAI Grok API and return as torch.Tensor (h,w,c) and text
Grok Generate Image
- image
- image1
- image2
- image3
- image4
- history
- image
- text
- history
◄api_key►
◄base_url►
◄model_namegrok-imagine-image►
◄system_prompt—►
◄prompt—►
◄aspect_ratioauto►
◄resolutionauto►
◄n1►
◄response_formaturl►
◄retry_count1►
◄chat_template<-system->
{{system_instruction}}
<-/system->
<-user->
{{prompt}}
<-/user->►
◄proxy_url►
◄seed-1►
◄timeout0►
◄extra{}►
CategoryYogurtNodes/LLM
Inputs (21)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | API key for accessing xAI API | |
| base_url | STRING | Base URL for xAI API (leave blank for official API) | |
| model_name | STRING | grok-imagine-image | xAI image generation model name |
| system_prompt | STRING | System-level prompt that affects the overall image generation style | |
| prompt | STRING | Main prompt content for image generation | |
| aspect_ratio | COMBO | auto | Aspect ratio for generated images |
| resolution | COMBO | auto | Resolution for generated images |
| n | INT | 11–10 | Number of images to generate |
| response_format | COMBO | url | Response format for generated images |
| retry_count | INT | 1 | Number of retries when request fails |
| 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) |
| timeout | INT | 00–2147483647 | Timeout for the request in seconds, 0 means no timeout |
| imageopt | IMAGE | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| historyopt | HISTORY | — | |
| extraopt | STRING | {} | Extra parameters for the request, in JSON format |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| text | STRING | — |
| history | HISTORY | — |