Grok Video Extend
Keep the clip going past its natural ending
- client
- video_url
The video you generated is five seconds long and the shot deserves eight. Grok Video Extend is the continuation: hand it the URL of an existing video and it appends new content to it - up to 15 seconds per call - using xAI's video model. It's the natural sequel to Grok Reference to Video: generate a clip, then keep it going, then keep it going again.
Mechanically it's an append operation, not a regen. You give it a source video (must be a public HTTPS URL - xAI's servers fetch it), a duration to add, and optionally a prompt steering what the new content is. The model watches the tail of your clip and continues the scene, so continuity of subject and motion is the whole point.
Inputs
- video_url - required. Public HTTPS URL of the source. The obvious pairing: chain
video_urlfrom a GrokRefToVideo (or Grok Text-to-Video) output, which gives you exactly that URL. - duration - required. Seconds to append, 1–15, default 5. Each extend call appends this much.
- prompt - optional. Guides the extended content ("the camera slowly pulls back").
- model -
grok-imagine-videodefault. - seed - cache-invalidation only, same deal as the ref-to-video node: not sent to the API, -1 forces a fresh billed run.
Output: video_url - a new URL for the extended clip. Feed it straight into Preview Anything to watch it, or chain it back into another GrokVideoExtend to keep looping.
Install and gotchas
Part of the ERPK Collection, needs xai-sdk>=1.14.0:
cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk && pip install -r requirements.txt
Restart (or ComfyUI Manager → search erpk), xAI key under Settings > ERPK > API Keys. Paid per call - and remember each append is a separate generation, so a 5+5+5 chain is three billed jobs, not one.
The recurring failure is URL availability: a local file path, a localhost link, or a link that requires auth will fail because xAI fetches it server-side. The pack's own video nodes hand you public URLs, so chaining them is the safe path. And if the extension looks like a hard cut rather than a continuation, the prompt is your fix - "seamlessly continue the action" beats an empty prompt when the model has freedom about what happens next.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| video_url | STRING | Public HTTPS URL of the source video to extend. | |
| duration | INT | 51–15 | Duration in seconds to append (1–15). |
| 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. | |
| promptopt | STRING | Optional prompt to guide the extended content. | |
| modelopt | COMBO | grok-imagine-video | xAI video model. |
| 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 | — |