Nodes/ERPK Collection/Grok Video Edit
ComfyUI Node

Grok Video Edit

Edit an existing video by describing the change

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

Grok Video Edit is the "video-to-video" node in the ERPK Grok set: you hand it a source video URL and a text instruction - "make it night time," "change the character's jacket to red" - and xAI's grok-imagine-video model rewrites the footage to match. It's the video equivalent of the image-edit nodes everyone's used to, and it means you can iterate on footage without re-generating from scratch.

Set expectations before you wire it up, though. This is a hosted API model, so you're editing at whatever fidelity the model chooses - the output is capped at 720p per xAI, and it inherits the source clip's duration, aspect ratio, and resolution. If you're hoping for precise, per-pixel frame control (mask a specific region, keep the rest untouched), that's a recurring complaint in the community and honestly not what this is built for - API video edits are whole-scene semantic changes. For a coherent restyle or a subject change, it's genuinely handy.

How it works

The node calls xAI's video-edit endpoint with your prompt and video_url, then polls until the edited clip is done. Out comes a video_url STRING, the same as every other video node in the pack - wire it into Preview Anything to watch or download it. The client input is optional; unconnected, the API key resolves from Settings or grok/config.ini.

The inputs that matter

  • video_url - the source clip, and it must be a public HTTPS URL. A local file path won't work; xAI's servers need to fetch it. Anything the pack's video nodes or Preview Anything hand you works.
  • prompt - the editing instruction. Be explicit about what changes and what stays; the model is better at "change the sky from blue to sunset orange, keep everything else the same" than at vague "improve it."
  • model - defaults to grok-imagine-video; the -1.5 variant is available.

The seed widget is cache control only - it's not forwarded to the API. Randomize means a fresh, billed generation each queue run; a fixed value lets ComfyUI reuse a cached result.

Installing it

This ships in the ERPK Collection (eRepublik-Labs/comfyui-nodes-erpk), a monorepo of Grok/WaveSpeed/Claude/Gemini/OpenAI nodes. ComfyUI Manager: search erpk → install ERPK Custom Nodes → restart. Or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk
pip install -r requirements.txt

Grok nodes need xai-sdk>=1.14.0 and an xAI API key (Settings → ERPK → API Keys). No model downloads.

Common issues

  • "video_url cannot be empty" - self-explanatory, but the usual hidden cause is a private URL. The source must be fetchable by xAI's servers, so a signed S3 link or localhost path fails.
  • Output capped at 720p - that's xAI's limit on this endpoint, not a misconfiguration. Plan around it if you need 1080p+ deliverables.
  • Edit does too much / not enough - these models read the whole scene. Anchor the prompt with "only change X, keep Y identical" phrasing, and iterate; you're billed per edit, so cheap reruns are not the norm.
  • Source URL expires - if you grabbed a temporary URL from a previous run, it may have expired by the time you queue. Re-preview to get a fresh one.
CategoryERPK/Grok/Video

Inputs (5)

NameTypeDefaultDescription
promptSTRINGEditing instructions describing the desired changes.
video_urlSTRINGPublic HTTPS URL of the source video to edit.
clientoptGROK_API_CLIENTGrok API client from Grok API Client node. Optional: when unconnected, the key is resolved from ComfyUI Settings or grok/config.ini.
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