π€ Leon Grok Imagine Image API
Grok Imagine in ComfyUI β xAI's image generator via a dropdown
- image
- image
- image_url
- seed
Leon Grok2 Image API - display name "Leon Grok Imagine Image API" - is the node that puts xAI's Grok image generator into a ComfyUI graph. Model dropdown, aspect ratio, resolution, and you're done. It's another thin wrapper in the pack's pattern: pick a model, write a prompt, get an RGBA tensor back. The honest framing: this is for trying Grok's output without leaving ComfyUI, not for anything your existing FLUX or SDXL stack can't already do locally. But as hosted-model wrappers go, it's about as frictionless as they come.
Two things set this node apart from the pack's other generation nodes. First, it's one of the few that takes an optional image array (image, an IMAGE_ARRAY socket) for image-to-image work - though the tooltip is coy and just says "Array of input images (optional)". Second, the resolution choice is a plain 1K or 2K toggle, which is refreshingly simple next to the Imagen node's ratio-only menu.
How it works
Same base-class plumbing as the rest of the pack: JSON POST to https://api.hyprlab.io/v1/images/generations with a Bearer token, 5-attempt exponential-backoff retry, download and convert the response to an RGBA tensor. The HyprLab API key is required (default placeholder YOUR_API_KEY_HERE).
The inputs that matter:
model-grok-imagine-image(default) orgrok-imagine-image-pro. Pro is the higher-fidelity tier; the base one is the default for a reason.aspect_ratio- a wide menu:1:1,3:4,4:3,9:16,16:9,2:3,3:2,21:9,9:21.resolution-1Kor2K.image- optional array of input images for image-to-image.response_format-urlorb64_json;b64_jsonreturns a data URI in theimage_urloutput instead of a hosted URL.
Outputs: image, image_url, seed.
Installing it
Pack-wide install, nothing special:
cd ComfyUI/custom_nodes
git clone https://github.com/l3ony2k/comfyui-leon-nodes
pip install -r requirements.txt
Restart ComfyUI, or use ComfyUI Manager and search "Leon". Light dependencies, no models to download - Grok's models run on xAI's (or rather HyprLab's resold) infrastructure.
Where people get burned
The usual pack pitfalls apply: placeholder key means slow 401s (the retry backoff is merciless), and this routes through HyprLab, which has essentially zero public community footprint - your troubleshooting resources are the tooltips and provider docs. Don't expect the image-array input to be well-documented, because it isn't. And manage expectations on moderation: Grok's image stack is as filtered as any closed model. If you just want to see what Grok Imagine makes, this is the fastest way to do it inside ComfyUI; if you need reproducibility and control, keep using the local models.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | A cute cat. | Text description of the image to generate |
| model | COMBO | grok-imagine-image | Grok image generation model |
| aspect_ratio | COMBO | 1:1 | Aspect ratio of the generated image |
| resolution | COMBO | 1K | Resolution for the generated image |
| output_format | COMBO | png | Format of the output image |
| seed | INT | 00β18446744073709550000 | Random seed for reproducible results |
| api_url | STRING | https://api.hyprlab.io/v1/images/generations | API URL |
| api_key | STRING | YOUR_API_KEY_HERE | Your HyprLab API key |
| response_format | COMBO | url | Format of the response data |
| imageopt | IMAGE_ARRAY | Array of input images (optional) |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | β |
| image_url | STRING | β |
| seed | INT | β |