{"record":{"id":"e5bbcce8155a7440","repo":"Comfy-Org/ComfyUI","slug":"video-size-video-size-1024-1024-1f-mb-exce","errorCode":null,"errorMessage":"Video size ({video_size / 1024 / 1024:.1f}MB) exceeds 50MB limit.","messagePattern":"Video size \\((.+?)MB\\) exceeds 50MB limit\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_api_nodes/nodes_grok.py","lineNumber":811,"sourceCode":"            price_badge=IO.PriceBadge(\n                expr=\"\"\"{\"type\":\"usd\",\"usd\": 0.06, \"format\": {\"suffix\": \"/sec\", \"approximate\": true}}\"\"\",\n            ),\n        )\n\n    @classmethod\n    async def execute(\n        cls,\n        model: str,\n        prompt: str,\n        video: Input.Video,\n        seed: int,\n    ) -> IO.NodeOutput:\n        validate_string(prompt, strip_whitespace=True, min_length=1)\n        validate_video_duration(video, min_duration=1, max_duration=8.7)\n        video_stream = video.get_stream_source()\n        video_size = get_fs_object_size(video_stream)\n        if video_size > 50 * 1024 * 1024:\n            raise ValueError(f\"Video size ({video_size / 1024 / 1024:.1f}MB) exceeds 50MB limit.\")\n        initial_response = await sync_op(\n            cls,\n            ApiEndpoint(path=\"/proxy/xai/v1/videos/edits\", method=\"POST\"),\n            data=VideoEditRequest(\n                model=model,\n                video=InputUrlObject(url=await upload_video_to_comfyapi(cls, video)),\n                prompt=prompt,\n                seed=seed,\n            ),\n            response_model=VideoGenerationResponse,\n        )\n        response = await poll_op(\n            cls,\n            ApiEndpoint(path=f\"/proxy/xai/v1/videos/{initial_response.request_id}\"),\n            status_extractor=lambda r: r.status if r.status is not None else \"complete\",\n            response_model=VideoStatusResponse,\n            price_extractor=_extract_grok_price,\n        )","sourceCodeStart":793,"sourceCodeEnd":829,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_api_nodes/nodes_grok.py#L793-L829","documentation":"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.","triggerScenarios":"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.","commonSituations":"High-bitrate source footage from a phone or pro camera, lossless intermediates (ProRes, FFV1), or clips re-encoded at very high quality settings.","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"],"exampleFix":"# before: 8s 4K ProRes clip (~120MB) -> error\n# after: re-encode within the 50MB budget\nffmpeg -i input.mov -t 8 -vf scale=1920:-2 -c:v libx264 -crf 24 -c:a aac output.mp4","handlingStrategy":"validation","validationCode":"import os\nfrom comfy_api_nodes.utils import get_fs_object_size\n\ndef video_under_50mb(video) -> bool:\n    return get_fs_object_size(video.get_stream_source()) <= 50 * 1024 * 1024","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["grok","xai","video-edit","file-size-limit","upload"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}