Nodes/ERPK Collection/Grok Video Extend
ComfyUI Node

Grok Video Extend

Keep the clip going past its natural ending

By eRepublik-Labs·Created 11 months ago·Updated 21 days ago· 1
Grok Video Extend
  • client
  • video_url
video_url
duration5
prompt
modelgrok-imagine-video
seed-1

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_url from 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-video default.
  • 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.

CategoryERPK/Grok/Video

Inputs (6)

NameTypeDefaultDescription
video_urlSTRINGPublic HTTPS URL of the source video to extend.
durationINT51–15Duration in seconds to append (1–15).
clientoptGROK_API_CLIENTGrok API client from Grok API Client node. Optional: when unconnected, the key is resolved from ComfyUI Settings or grok/config.ini.
promptoptSTRINGOptional prompt to guide the extended content.
modeloptCOMBOgrok-imagine-videoxAI video model.
seedoptINT-1-1–4294967295Seed for ComfyUI cache invalidation only — not forwarded to the API. -1 for random.

Outputs (1)

NameTypeDescription
video_urlSTRING