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

BYOKey Grok Video (xAI)

Grok's video generator as a ComfyUI node — text-to-video or image-to-video

By MeteorAndy·Created 4 months ago·Updated 3 months ago· 0
BYOKey Grok Video (xAI)
  • image
  • output
api_key
base_urlhttps://api.x.ai/v1
modelgrok-imagine-video
prompt
resolution480p
aspect_ratioauto
duration6
seed0
poll_interval10
max_wait600

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) or grok-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) or 720p. Keep 480p for drafts; the 720p renders cost more and take longer.
  • aspect_ratio - auto plus the usual set (16:9, 4:3, 1:1, 9:16…). auto lets 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 for grok-imagine-video-1.5. The image-to-video path is where Grok video is strongest.
  • poll_interval (default 10s) and max_wait (default 600s, up to 3600) - the queue-waiting knobs. Busy periods will make you want a higher max_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.

Categoryapi/byokey/video

Inputs (11)

NameTypeDefaultDescription
api_keySTRING
base_urlSTRINGhttps://api.x.ai/v1
modelCOMBOgrok-imagine-videogrok-imagine-video-1.5 currently always requires an input image.
promptSTRINGText description of the desired video.
resolutionCOMBO480pThe resolution of the output video.
aspect_ratioCOMBOautoThe aspect ratio of the output video.
durationINT61–15The duration of the output video in seconds.
seedINT00–2147483647Seed to determine if node should re-run; actual results are nondeterministic regardless of seed.
imageoptIMAGEOptional starting image for grok-imagine-video. Required for grok-imagine-video-1.5.
poll_intervaloptINT101–120
max_waitoptINT60030–3600

Outputs (1)

NameTypeDescription
outputVIDEO