BYOKey Grok Video (xAI)
Grok's video generator as a ComfyUI node — text-to-video or image-to-video
- image
- output
xAI's Grok does video now, and BYOKey_Grok_Video is the node that puts it in your ComfyUI graph. It talks to api.x.ai/v1 with your own key, generates a video from a text prompt - or from an image, if that's what you want - and hands back a real ComfyUI VIDEO output that plugs into the same preview/save nodes the official API video nodes use. No Comfy proxy, no credit system, your key against xAI directly.
This is a "the model isn't on your machine" case, and there's no local alternative to weigh it against - Grok video has no open weights. Same reasoning as every closed-model node in this pack: if you want this specific model in your workflow, the API is the only door. The interesting wrinkle specific to xAI: the two video models behave differently, and one of them requires an image.
How it works
It mirrors xAI's video API flow: POST a generation request, poll the status endpoint every poll_interval seconds, then download the finished video when the status flips to done. That's the standard submit-and-poll pattern the pack's video nodes share, and it's why the node blocks for a while - it's waiting on xAI's queue. The downloaded file is wrapped in ComfyUI's VIDEO output type, so it behaves like any other video node's result.
The inputs that matter
model-grok-imagine-video(default) orgrok-imagine-video-1.5. The tooltip is the important part: grok-imagine-video-1.5 currently always requires an input image. Don't point it at text-to-video and wonder why it fails.prompt- the text description of the video.resolution-480p(default) or720p. Keep 480p for drafts; the 720p renders cost more and take longer.aspect_ratio-autoplus the usual set (16:9, 4:3, 1:1, 9:16…).autolets xAI match the input image when you're doing image-to-video.duration- 1 to 15 seconds, default 6. Longer = more expensive.image- optional starting frame for the default model; required forgrok-imagine-video-1.5. The image-to-video path is where Grok video is strongest.poll_interval(default 10s) andmax_wait(default 600s, up to 3600) - the queue-waiting knobs. Busy periods will make you want a highermax_wait.
seed, as with xAI's image node, only decides whether the node re-runs - results are nondeterministic regardless.
Output is output (VIDEO). In current ComfyUI, a VIDEO output needs a video preview/save node to actually see anything - the same ones the official API video nodes feed.
Installing it
It ships in the comfyui-byokey pack, which has zero extra dependencies beyond 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/video. No models to download - the generation happens at xAI.
Gotchas
The big trap is model/image mismatch: feed text-only prompts to grok-imagine-video-1.5 and it errors, because that model demands a starting frame. Check the model dropdown before complaining. The other thing to budget for is time - video generation is slow, the node waits synchronously, and if xAI's queue is long your max_wait of 600s can expire mid-run (you'll see the error; just raise it). And cost: video is the most expensive per-call thing in this pack, and Grok's video pricing isn't cheap, so treat it as a finisher, not an experimenter. Standard BYOKey hygiene: your key is saved into the workflow JSON - scrub before sharing. If you're already paying xAI for Grok and want its video output inside ComfyUI, this is the node.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | — | |
| base_url | STRING | https://api.x.ai/v1 | — |
| model | COMBO | grok-imagine-video | grok-imagine-video-1.5 currently always requires an input image. |
| prompt | STRING | Text description of the desired video. | |
| resolution | COMBO | 480p | The resolution of the output video. |
| aspect_ratio | COMBO | auto | The aspect ratio of the output video. |
| duration | INT | 61–15 | The duration of the output video in seconds. |
| seed | INT | 00–2147483647 | Seed to determine if node should re-run; actual results are nondeterministic regardless of seed. |
| imageopt | IMAGE | Optional starting image for grok-imagine-video. Required for grok-imagine-video-1.5. | |
| poll_intervalopt | INT | 101–120 | — |
| max_waitopt | INT | 60030–3600 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | VIDEO | — |