Grok Text to Video
A 15-second Grok video from ComfyUI, with zero VRAM spent
- client
- video_url
Grok Text to Video is the node that turns a text prompt into a finished video clip using xAI's grok-imagine-video model - and it does it entirely on xAI's servers. No local model, no VRAM, no waiting through a diffusion pass on your 3060. You type a prompt, pick a duration, and ComfyUI polls until a URL shows up. It's the "paid cloud service in my node graph" trick, and for a lot of people that's exactly what they want.
The community read on Grok's video model is worth knowing before you commit: it's fast and genuinely good at following prompts, but it's a commercial API with heavy content restrictions baked in, and people keep showing up asking how to get "close to Grok videos" locally because of them. If you need unrestricted output, this isn't the tool - that's a local WAN fine-tune job. If you need a clean, prompt-faithful 5-second clip for a storyboard or a draft, it's hard to beat the convenience.
How it works
The node is a thin wrapper over xAI's API via the pack's xai-sdk client. It fires off a generation request, then polls for the result using async waits - which matters because ComfyUI keeps the event loop free while the job cooks, so other nodes in your graph can run in parallel. When the clip is ready you get a video_url string out, not a video tensor. That's the pattern for every video node in this pack: wire the STRING output into the Preview Anything node (also in this pack) to see or download the clip.
The seed widget is a bit of a trap, so read it carefully: it is not sent to the API. It exists only for ComfyUI's cache - leave it on randomize and every queue run is a fresh, re-billed generation; pin it and ComfyUI can serve the cached result without calling xAI again.
The inputs that matter
- prompt - your whole job. Describe motion, subject, and camera. Multiline, so take a sentence or two.
- duration - 1 to 15 seconds. Most people land at 5.
- aspect_ratio - 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3.
- resolution - 480p or 720p. 480p is cheaper-feeling and faster; 720p is the HD option.
- model - defaults to
grok-imagine-video, with a-1.5variant available.
The client input is optional: if you leave it unconnected the key resolves from ComfyUI Settings or grok/config.ini.
Installing it
This is part of the ERPK Collection (eRepublik-Labs/comfyui-nodes-erpk), a monorepo of cloud-API nodes for WaveSpeed, Claude, Gemini, OpenAI, and Grok. Easiest path: ComfyUI Manager → Install Custom Nodes → search erpk → install ERPK Custom Nodes → restart.
Manual install works too:
cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk
pip install -r requirements.txt
You need an xAI API key (the pack declares xai-sdk>=1.14.0). Add it under right-click canvas → ERPK Settings, or Settings → ERPK → API Keys. No model files to download, ever.
Common issues
- "Prompt cannot be empty" - the node refuses to fire with a blank prompt. That's deliberate; xAI would reject it anyway.
- "xAI returned an empty video URL" - usually a mid-generation failure or a billing problem on the API side. Check the xAI console, then re-run.
- "Empty video URL" / stuck polling - generation can take minutes; the client polls on a 10-second-ish loop with a generous timeout. If you cancel mid-poll you'll see a clean interrupt, not a red error.
- Everything is billed - unlike a local sampler, every queue run that isn't cache-hit costs money. Random seed = new bill. Keep that in mind when you're iterating.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Text description of the video to generate. | |
| clientopt | GROK_API_CLIENT | Grok API client from Grok API Client node. Optional: when unconnected, the key is resolved from ComfyUI Settings or grok/config.ini. | |
| modelopt | COMBO | grok-imagine-video | xAI video model. |
| aspect_ratioopt | COMBO | 16:9 | Output aspect ratio. |
| resolutionopt | COMBO | 720p | Output resolution. 480p is faster; 720p is HD. |
| durationopt | INT | 51–15 | Video duration in seconds (1–15). |
| seedopt | INT | -1-1–4294967295 | Seed for ComfyUI cache invalidation only — not forwarded to the API. -1 for random. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video_url | STRING | — |