sgl-project/sglang · error · RuntimeError
Failed to generate MiniMax-H3 video: {str(e)}
Error message
Failed to generate MiniMax-H3 video: {str(e)} What it means
RuntimeError wrapping any exception from sgld_client.generate_video() in the ComfyUI SGLDiffusion MiniMax-H3 node. The underlying cause (network error, server 4xx/5xx, invalid params) is included in the message; this is the node's single failure surface for video generation.
Source
Thrown at python/sglang/multimodal_gen/apps/ComfyUI_SGLDiffusion/nodes.py:780
"audio_flow_shift": audio_flow_shift,
}
request_params = {
"prompt": positive_prompt,
"seconds": int(duration_seconds),
"num_inference_steps": steps,
"output_path": folder_paths.get_temp_directory(),
"extra_fields": extra_fields,
}
if negative_prompt:
request_params["negative_prompt"] = negative_prompt
if seed >= 0:
request_params["seed"] = seed
try:
response = sgld_client.generate_video(**request_params)
except Exception as e:
raise RuntimeError(f"Failed to generate MiniMax-H3 video: {str(e)}")
video_path = response.get("file_path", "")
# H3 aligns the canvas server-side, so the resolved size is only known
# from the response; short_edge and aspect_ratio cannot reconstruct it
resolved_size = response.get("size", "")
if resolved_size:
width, height = (int(v) for v in resolved_size.split("x"))
else:
width = height = short_edge
video = convert_video_to_comfy_video(video_path, height, width)
return (video, video_path)
class SGLDiffusionServerSetLora:
"""Node to set LoRA adapter for SGLang Diffusion server."""
@classmethodView on GitHub (pinned to 0132848349)
Solutions
- Check the wrapped cause in the message: connection errors mean the server is down or URL is wrong — start/reconnect the SGLDiffusionServerModel node
- Inspect server logs for the root cause (OOM, param validation)
- Update the ComfyUI node pack and sglang to matching versions
- Retry with smaller resolution/frame count if the server OOMed
Defensive patterns
Strategy: try-catch
Validate before calling
assert sgld_client.health() == 'ok' before generating
Try / catch
try:
out = node.generate(...)
except RuntimeError as e:
log.error('H3 generation failed: %s', e)
fallback_to_previous_checkpoint_or_retry() Prevention
- Health-check the server node before generation workflows
- Pin node-pack and server versions together
- Wrap generation with retry + backoff for transient server errors
When it happens
Trigger: Any exception thrown by the SGLang Diffusion server HTTP call: server down/unreachable, invalid request params, OOM or generation failure server-side, timeout.
Common situations: Server not started or wrong URL in the server node; server crashed mid-generation; invalid params (bad seed, unsupported resolution/fps); version mismatch between node and server API.
Related errors
- Video generation failed: {error_msg}
- Lost connection to server after {consecutive_errors} consecu
- Network error after {consecutive_errors} consecutive failure
- Video generation timed out after {max_wait_time} seconds
- Failed to generate video: {str(e)}
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/5242278921618bc8.
Report an issue: GitHub.