Nodes/ComfyUI_SGLDiffusion_Fix/SGLDiffusion Generate Video
ComfyUI Node

SGLDiffusion Generate Video

Your SGLang server just became a video studio

By endman100·Created 5 months ago·Updated 5 months ago· 0
SGLDiffusion Generate Video
  • sgld_client
  • image
  • video
  • video_path
positive_prompt
negative_prompt
seed1024
steps6
cfg7.0
width1280
height720
num_frames120
fps24
seconds5
enable_teacachefalse

The video twin of the Generate Image node

SGLDiffusion Generate Video is the same trick as its image sibling, aimed at motion: it ships a text-to-video or image-to-video job off to your SGLang Diffusion server over HTTP and pulls back a finished clip. You get ComfyUI's graph on one side and a server (or rented GPU box) doing all the heavy temporal sampling on the other. If you're already running SGLang for images, this node is what lets you reuse that same infrastructure for video without learning a second stack.

It's part of the pack's Server Mode, so it needs the SGLD_CLIENT output from a SGLDiffusion Server Model node wired in. That connection node is the anchor; everything else in server mode hangs off it, and this node hangs off the same wire.

How it works

Mechanically it's simple: prompt plus size, and then the video-specific knobs - seconds, fps, num_frames - get serialized into the server request. The server renders, writes an actual video file to disk, and the node wraps that path into ComfyUI's VIDEO type so it plugs into video preview/save nodes like a normal generation.

Two outputs come back:

  • video - the VIDEO object for the rest of your graph
  • video_path - the file path as a plain string, handy if you want to feed the file elsewhere or check what actually got written

The inputs that matter

  • positive_prompt - required, and empty prompts error out just like the image node.
  • image - leave it disconnected for pure text-to-video; connect a real image for image-to-video. Same trick as the image node: a solid "empty" image is treated as a size reference, not as input frames.
  • seconds / fps / num_frames - defaults are 5 seconds, 24 fps, 120 frames, which line up consistently (5 × 24 = 120). If you change one, think about the others, because the server gets all three. There's real speed in keeping frames low: long clips are where video generation goes from "slow" to "go make coffee."
  • steps - 6 by default, right for distilled video models, too few for base ones.
  • cfg - again default 7.0, again architecture-dependent. Distilled video models want it near 1.
  • seed, width, height, negative_prompt, enable_teacache - same semantics as the image node; TeaCache's block-skipping is where a chunk of SGLang's video speedup comes from.

Install and gotchas

Same shared install as the rest of the pack:

cd ComfyUI/custom_nodes
git clone https://github.com/endman100/ComfyUI_SGLDiffusion_Fix

restart, and - the part people miss - install SGLang separately, since the pack itself ships no requirements.txt:

pip install sglang[diffusion]

Failed to generate video almost always means the server isn't up, isn't reachable, or isn't serving a video-capable pipeline. One honest caveat before you blame anything: video through a remote HTTP server means the generated file has to come back over the network, so a slow link between ComfyUI and the server can make the pipeline feel broken when it's just bandwidth. Check video_path actually got written and check the server logs before you start debugging the node.

CategorySGLDiffusion

Inputs (13)

NameTypeDefaultDescription
sgld_clientSGLD_CLIENT
positive_promptSTRINGText prompt for video generation
negative_promptoptSTRINGNegative prompt to avoid certain elements
imageoptIMAGEinput image to use for image-to-video
seedoptINT1024-1–4294967295
stepsoptINT61–100
cfgoptFLOAT7.01–20
widthoptINT1280256–4096
heightoptINT720256–4096
num_framesoptINT1201–1000
fpsoptINT241–60
secondsoptINT51–60
enable_teacacheoptBOOLEANfalse

Outputs (2)

NameTypeDescription
videoVIDEO
video_pathSTRING