ComfyUI Node

Grok Generate

Animate a still image with Grok's video model, from inside ComfyUI

By alchemine·Created about a year ago·Updated 2 days ago· 2
Grok Generate
  • image
  • video
prompt
duration5
resolution
modelgrok-imagine-video-1.5-preview
filename_prefixgrok/GrokVideo
poll_interval5
timeout600
access_token
refresh_token
client_id

GrokGenerate turns a single image into a short video clip using x.ai's Grok Imagine image-to-video model, and it does it entirely from inside your ComfyUI graph. You feed it an image tensor, optionally a motion description, and it polls the cloud until the clip is done, then saves the mp4 into your output folder and shows it inline on the node. No leaving ComfyUI, no command line, no manual downloading.

This is the node to reach for when you want a 5–15 second animated version of a generated still - a character turning to camera, hair catching wind, a slow zoom. If you're in the anime/Illustrious workflow world this pack lives in, it's a very natural "last step" after you've gotten the perfect frame.

How it works

The node takes your image tensor, encodes it to a data URL, and posts it to the Grok video generation API with a request body built from your inputs - prompt, duration, resolution, model. Then it polls the job status every poll_interval seconds until the clip is ready (or timeout is hit), downloads the resulting mp4, and saves it under your ComfyUI output directory at filename_prefix (default grok/GrokVideo).

Credentials are the fiddly part, and they work the same on every Grok node in this pack: pass access_token, refresh_token, and client_id as node inputs, or leave them empty and the node reads GROK_ACCESS_TOKEN / GROK_REFRESH_TOKEN / GROK_CLIENT_ID from your environment (a .env file in the pack directory works). If the access token is stale, it auto-refreshes on a 401/403 using the refresh token. If that refresh itself fails, the refresh token or client_id has been revoked - you have to re-authenticate at x.ai. Nothing fails at load time; you only get the error dialog when you actually run the node.

The output is a video (a native VIDEO type, not frames) with an inline preview, plus audio, and the file lands in output/grok/.

Inputs that matter

  • image - your source frame. The one required input you can't skip.
  • prompt - motion/scene description. Optional, but a clip without one tends to be a static wiggle; describe the motion.
  • duration (1–15, default 5) - clip length in seconds.
  • resolution - 720p or 480p. 720p takes longer; 480p is the "I just want to see it move" option.
  • timeout (default 600) - how long to poll before giving up. Cloud video gen is slow; don't be stingy.

Install

Part of ComfyUI-Alchemine-Pack:

cd ComfyUI/custom_nodes
git clone https://github.com/alchemine/comfyui-alchemine-pack
pip install -r requirements.txt

Or via ComfyUI Manager (search "ComfyUI-Alchemine-Pack"). The only Python dependency is python-dotenv; the heavy lifting happens in the cloud, which is why there are no model downloads. Your three Grok tokens are the real prerequisite.

Common issues

The standard failure is Grok token refresh failed (...). That means the refresh token or client_id is expired or revoked - re-authenticate with x.ai and update your .env values, then restart ComfyUI so the env reloads. A close second: hitting the token limit / rate limit on x.ai's side during a big batch, which surfaces as a non-2xx response on submit. And timeout matters more than people think - a 15-second 720p clip can legitimately exceed the 600-second default on a busy day; bump it before you blame the node.

CategoryAlcheminePack/Grok

Inputs (11)

NameTypeDefaultDescription
imageIMAGE
promptSTRING
durationINT51–15
resolutionCOMBO2 options: 720p, 480p
modelSTRINGgrok-imagine-video-1.5-preview
filename_prefixSTRINGgrok/GrokVideo
poll_intervaloptINT51–60
timeoutoptINT60030–3600
access_tokenoptSTRING
refresh_tokenoptSTRING
client_idoptSTRING

Outputs (1)

NameTypeDescription
videoVIDEO