{"record":{"id":"86e3d616a6cccf88","repo":"sgl-project/sglang","slug":"failed-to-generate-video-str-e-86e3d6","errorCode":null,"errorMessage":"Failed to generate video: {str(e)}","messagePattern":"Failed to generate video: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/nodes.py","lineNumber":574,"sourceCode":"            request_params[\"enable_teacache\"] = True\n        if num_frames is not None:\n            request_params[\"num_frames\"] = num_frames\n        if image is not None:\n            # If the image is empty, use the size of the image to generate the video\n            if is_empty_image(image):\n                width, height = image.shape[2], image.shape[1]\n                size = f\"{width}x{height}\"\n                request_params[\"size\"] = size\n            else:\n                request_params[\"input_reference\"] = get_image_path(image)\n\n        # Call API\n        try:\n            response = sgld_client.generate_video(**request_params)\n            video_path = response.get(\"file_path\", \"\")\n            video = convert_video_to_comfy_video(video_path, height, width)\n        except Exception as e:\n            raise RuntimeError(f\"Failed to generate video: {str(e)}\")\n\n        return (video, video_path)\n\n\nclass SGLDiffusionGenerateH3:\n    \"\"\"Node to generate joint video and audio with MiniMax-H3.\n\n    H3 denoises a packed video+audio sequence in one pass and routes its\n    conditioning by task rather than by a single reference slot, so it needs\n    its own request shape (`task` / `conditions` / `target`) that the generic\n    video node does not model. The returned MP4 carries both streams.\n    \"\"\"\n\n    TASKS = [\"t2va\", \"fl2va\", \"ref2va\"]\n\n    @classmethod\n    def INPUT_TYPES(cls):\n        return {","sourceCodeStart":556,"sourceCodeEnd":592,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/nodes.py#L556-L592","documentation":"RuntimeError from the ComfyUI video node wrapping any exception from sgld_client.generate_video or from converting the resulting file — includes submit failures, polling errors, job failures, timeouts, and missing/unreadable video files (convert_video_to_comfy_video).","triggerScenarios":"Any stage of video generation failing inside the node: server down, job error, timeout, or the returned file_path missing/invalid so conversion raises.","commonSituations":"Server not running; job timed out or errored server-side; file_path empty in response so video loading fails; codec/container issues in the output file.","solutions":["Read the chained message to identify the stage (submit vs poll vs convert).","If it's a convert failure, verify file_path exists on disk and is a valid video.","Fix the underlying generation error per its own guidance (params, timeouts, server health).","Retry with smaller resolution/seconds to shorten the job."],"exampleFix":"// before\nresponse = sgld_client.generate_video(**request_params)\nvideo = convert_video_to_comfy_video(response.get(\"file_path\", \"\"), height, width)\n// after\nresponse = sgld_client.generate_video(**request_params)\nvideo_path = response.get(\"file_path\")\nif not video_path or not os.path.isfile(video_path):\n    raise RuntimeError(f\"server returned invalid file_path: {response!r}\")\nvideo = convert_video_to_comfy_video(video_path, height, width)","handlingStrategy":"try-catch","validationCode":"import os\n# after call: assert os.path.isfile(response.get('file_path', ''))","typeGuard":"def usable_video_response(r: dict) -> bool:\n    p = r.get('file_path')\n    return bool(p) and os.path.isfile(p)","tryCatchPattern":"try:\n    video, path = node.generate_video(...)\nexcept RuntimeError as e:\n    msg = str(e)\n    if 'timed out' in msg: extend_max_wait_and_retry()\n    elif 'invalid file_path' in msg or 'convert' in msg: inspect_output_file()\n    else: raise","preventionTips":["Health-check the server before video workflows.","Scale max_wait_time with job size.","Verify file_path exists before conversion."],"tags":["comfyui","video-generation","error-wrapping","network"],"backgroundTag":"http-request-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}