Nodes/Leon's Utility and API Integration Nodes/πŸ€– Leon Grok Imagine Image API
ComfyUI Node

πŸ€– Leon Grok Imagine Image API

Grok Imagine in ComfyUI β€” xAI's image generator via a dropdown

By l3ony2kΒ·Created about a year agoΒ·Updated 2 months agoΒ· 3
πŸ€– Leon Grok Imagine Image API
  • image
  • image
  • image_url
  • seed
β—„promptA cute cat.β–Ί
β—„modelgrok-imagine-imageβ–Ί
β—„aspect_ratio1:1β–Ί
β—„resolution1Kβ–Ί
β—„output_formatpngβ–Ί
β—„seed0β–Ί
β—„api_urlhttps://api.hyprlab.io/v1/images/generationsβ–Ί
β—„api_keyYOUR_API_KEY_HEREβ–Ί
β—„response_formaturlβ–Ί

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) or grok-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 - 1K or 2K.
  • image - optional array of input images for image-to-image.
  • response_format - url or b64_json; b64_json returns a data URI in the image_url output 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.

CategoryLeon_API

Inputs (10)

NameTypeDefaultDescription
promptSTRINGA cute cat.Text description of the image to generate
modelCOMBOgrok-imagine-imageGrok image generation model
aspect_ratioCOMBO1:1Aspect ratio of the generated image
resolutionCOMBO1KResolution for the generated image
output_formatCOMBOpngFormat of the output image
seedINT00–18446744073709550000Random seed for reproducible results
api_urlSTRINGhttps://api.hyprlab.io/v1/images/generationsAPI URL
api_keySTRINGYOUR_API_KEY_HEREYour HyprLab API key
response_formatCOMBOurlFormat of the response data
imageoptIMAGE_ARRAYArray of input images (optional)

Outputs (3)

NameTypeDescription
imageIMAGEβ€”
image_urlSTRINGβ€”
seedINTβ€”