Comfy-Org/ComfyUI · error · ValueError
Video size ({video_size / 1024 / 1024:.1f}MB) exceeds 50MB l
Error message
Video size ({video_size / 1024 / 1024:.1f}MB) exceeds 50MB limit. What it means
Thrown by the Grok video edit node when the local video file (measured via get_fs_object_size on the stream source) exceeds 50 MB. The video is uploaded to the ComfyAPI proxy and then forwarded to xAI's /v1/videos/edits endpoint, which enforces a 50 MB upload cap. The check runs after validate_video_duration (1-8.7 s) and before the upload, so it fails fast without wasting bandwidth.
Source
Thrown at comfy_api_nodes/nodes_grok.py:811
price_badge=IO.PriceBadge(
expr="""{"type":"usd","usd": 0.06, "format": {"suffix": "/sec", "approximate": true}}""",
),
)
@classmethod
async def execute(
cls,
model: str,
prompt: str,
video: Input.Video,
seed: int,
) -> IO.NodeOutput:
validate_string(prompt, strip_whitespace=True, min_length=1)
validate_video_duration(video, min_duration=1, max_duration=8.7)
video_stream = video.get_stream_source()
video_size = get_fs_object_size(video_stream)
if video_size > 50 * 1024 * 1024:
raise ValueError(f"Video size ({video_size / 1024 / 1024:.1f}MB) exceeds 50MB limit.")
initial_response = await sync_op(
cls,
ApiEndpoint(path="/proxy/xai/v1/videos/edits", method="POST"),
data=VideoEditRequest(
model=model,
video=InputUrlObject(url=await upload_video_to_comfyapi(cls, video)),
prompt=prompt,
seed=seed,
),
response_model=VideoGenerationResponse,
)
response = await poll_op(
cls,
ApiEndpoint(path=f"/proxy/xai/v1/videos/{initial_response.request_id}"),
status_extractor=lambda r: r.status if r.status is not None else "complete",
response_model=VideoStatusResponse,
price_extractor=_extract_grok_price,
)View on GitHub (pinned to 1c6d8d45b3)
Solutions
- Re-encode the video at a lower bitrate so the file is under 50 MB (e.g. ffmpeg -crf 23 H.264) while keeping duration within 1-8.7 s
- Reduce resolution/framerate of the clip before feeding it to the node
- Trim the clip to the shortest segment that still conveys the edit
Example fix
# before: 8s 4K ProRes clip (~120MB) -> error # after: re-encode within the 50MB budget ffmpeg -i input.mov -t 8 -vf scale=1920:-2 -c:v libx264 -crf 24 -c:a aac output.mp4
Defensive patterns
Strategy: validation
Validate before calling
import os
from comfy_api_nodes.utils import get_fs_object_size
def video_under_50mb(video) -> bool:
return get_fs_object_size(video.get_stream_source()) <= 50 * 1024 * 1024 Prevention
- Standardize on a compressed mezzanine format (H.264 crf 23) before API video nodes
- Budget ~6 MB/s of bitrate for the max 8.7 s edit duration
When it happens
Trigger: Running Grok video edit on a video longer than ~8.7 s is blocked earlier, but a short, high-bitrate clip (e.g. 8 s of 4K ProRes/high-Mbps H.264) whose file size exceeds 50 MB.
Common situations: High-bitrate source footage from a phone or pro camera, lossless intermediates (ProRes, FFV1), or clips re-encoded at very high quality settings.
Related errors
- The prompt references @Image{idx}, but only {total_images} r
- The prompt references @Audio{idx}, but 'voice_{idx}' is set
- The prompt references @Audio{idx}, but only voices 1..{len(v
- The pro model supports only 1 input image.
- A maximum of 3 input images is supported.
AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14).
Data as JSON: /api/errors/e5bbcce8155a7440.
Report an issue: GitHub.