Nodes/comfyui-byokey/BYOKey Grok Image (xAI)
ComfyUI Node

BYOKey Grok Image (xAI)

XAI's Grok image model in your graph — the one with the least filtering

By MeteorAndy·Created 4 months ago·Updated 3 months ago· 0
BYOKey Grok Image (xAI)
    • output
    api_key
    base_urlhttps://api.x.ai/v1
    modelgrok-imagine-image-quality
    prompt
    aspect_ratio1:1
    number_of_images1
    seed0
    resolution1K

    Grok is xAI's image generation, and if you follow this space at all you know its reputation: it's the least restrictive mainstream image model - the one with "Spicy Mode," the one that does things the other closed APIs refuse. The KB's history is blunt that this is both the draw and the brand risk. BYOKey_Grok_Image is the node that calls xAI's API (api.x.ai/v1) with your own key and hands back a ComfyUI IMAGE. No Comfy proxy, no credit system, just your key against xAI directly.

    So what's it for? If you generate content the other closed APIs filter out, Grok is the only frontier option, and inside ComfyUI this node is how that generation joins the rest of your pipeline - preview it, upscale it, feed it to image-to-video. If you don't need that specific property, there's nothing special here beyond a solid photorealistic image model.

    How it works

    It's a plain POST to the xAI image endpoint with your prompt, model, aspect_ratio, and count. The returned images decode back into an IMAGE tensor (and if you ask for more than one, they batch along the image dimension). Generation happens on xAI's servers; your machine just does the HTTP and the tensor plumbing.

    The inputs that matter

    • model - three choices: grok-imagine-image-quality (default), grok-imagine-image-pro, and plain grok-imagine-image. Quality vs. pro is the usual speed/quality trade; the default is the sensible starting point.
    • prompt - your generation prompt. This is where Grok's looser filtering actually shows up, for better or worse.
    • aspect_ratio - a long dropdown from 1:1 through 16:9, 9:16, 9:19.5 (the phone-banner ratios are in there), up to 1:2 and beyond. Default 1:1.
    • number_of_images - 1 to 10 per call. Handy for cheap batches, but watch your budget (below).
    • resolution - 1K (default) or 2K when you need more detail.
    • seed - the honest footnote again: it only controls whether the node re-runs; actual results are nondeterministic regardless.

    Output is output (IMAGE), wired into whatever your workflow does next.

    Installing it

    It ships in the comfyui-byokey pack with zero extra dependencies - just ComfyUI's bundled torch/aiohttp/PIL/numpy/av. Install via ComfyUI Manager (search "byokey") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MeteorAndy/comfyui-byokey.git
    

    Restart and it's under api/byokey/image. No model downloads, no GPU required.

    Gotchas

    Cost and policy are the two things to keep in mind. Batching 10 images per call multiplies your per-call spend instantly - use number_of_images for drafts you actually want, not for fishing. And the content-policy thing cuts both ways: Grok is less filtered, but "less filtered" is a moving target and xAI's moderation has tightened and loosened over time per the KB's coverage. The filtering follows the model, so don't assume anything you can't get from Grok's API today will work tomorrow. Standard BYOKey hygiene applies: your key lives in the widget and gets saved into workflow JSON, so scrub it before sharing, and - this category of paste-your-key node has a documented malware history - skim the open source if you're cautious. If you need Grok's specific mix of photorealism and permissiveness inside ComfyUI, this is the node.

    Categoryapi/byokey/image

    Inputs (8)

    NameTypeDefaultDescription
    api_keySTRING
    base_urlSTRINGhttps://api.x.ai/v1
    modelCOMBOgrok-imagine-image-quality3 options: grok-imagine-image-quality, grok-imagine-image-pro, grok-imagine-image
    promptSTRINGThe text prompt used to generate the image
    aspect_ratioCOMBO1:113 options: 1:1, 2:3, 3:2, 3:4, 4:3, 9:16, +7
    number_of_imagesINT11–10Number of images to generate
    seedINT00–2147483647Seed to determine if node should re-run; actual results are nondeterministic regardless of seed.
    resolutionoptCOMBO1K2 options: 1K, 2K

    Outputs (1)

    NameTypeDescription
    outputIMAGE