ComfyUI Node Runs on cloud

CogVideo Sampler

The node that actually makes the video

By kijai·Created 2 years ago·Updated 12 months ago· 1,549
CogVideo Sampler
  • model
  • positive
  • negative
  • samples
  • image_cond_latents
  • context_options
  • controlnet
  • tora_trajectory
  • fastercache
  • feta_args
  • teacache_args
  • samples
num_frames49
steps50
cfg6.00
seed0
schedulerCogVideoXDDIM
denoise_strength1.00

This is the engine room. Everything else in a CogVideoX workflow - loading the model, encoding your prompt, encoding a start image, tuning caches - exists to feed this node. It takes the model and your conditioning, runs the denoising loop, and outputs a latent that CogVideo Decode turns into actual frames. If you only understand one node in the pack, make it this one.

Mechanically it's the same diffusion-sampling idea you know from image workflows, just over a stack of video frames: start from noise, denoise over N steps guided by your prompt, land on a clean latent. What's different is that it's denoising time as well as space, so all the video-specific machinery - context windows, temporal caches, motion trajectories - hangs off the optional inputs here.

The inputs that matter

The required ones are where a beginner should focus:

  • num_frames (default 49) - the length of your clip in frames. CogVideoX is happiest around its native 49; push it much higher and you'll want the context-options node to keep quality from falling apart.
  • steps (default 50) - denoising steps. More steps, more refinement, more time. 50 is generous; you can often drop to 30-ish without much loss.
  • cfg (default 6) - how hard the model chases your prompt versus doing its own thing. 6 is a solid middle. Too high and motion gets stiff and over-cooked; too low and it drifts off-prompt. This is the dial you'll tune most.
  • scheduler (default CogVideoXDDIM) - the sampling algorithm. The CogVideoXDDIM and CogVideoXDPMScheduler options are tuned for this model; the others (Euler, DPM++, DDIM, LCM, etc.) are there to experiment with. Start with the default.
  • positive / negative - the CONDITIONING from your CogVideo TextEncode nodes. seed does what it always does.

The optional inputs are the plug board for the rest of the pack. image_cond_latents takes the output of CogVideo ImageEncode for image-to-video. samples plus denoise_strength enable video-to-video (feed an existing latent and denoise partially). context_options connects the long-video windowing node, controlnet the ControlNet apply node, tora_trajectory a Tora motion path, and fastercache / feta_args / teacache_args the three acceleration-and-quality helpers. Wire in only what your workflow uses; they're all optional.

The one output, samples (a LATENT), goes straight into CogVideo Decode.

How to install it

Part of the CogVideoX wrapper - nothing node-specific to install:

  • ComfyUI Manager - search ComfyUI-CogVideoXWrapper, install, restart.
  • Manual - cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-CogVideoXWrapper, then pip install -r ComfyUI-CogVideoXWrapper/requirements.txt, restart.

Common issues & troubleshooting

Out of memory during sampling. This is where the VRAM cost lands hardest. Fix it upstream at the loader (fp8 quantization, CPU offload) rather than here, and consider dropping num_frames or resolution. Long clips via context_options also raise peak memory.

It's painfully slow. 50 steps on a video model is a lot. Drop steps, and wire in a cache node - CogVideoX FasterCache or a TeaCache - through the optional inputs. On the attention side, SageAttention (set at the loader) is the other big lever.

Stiff or over-cooked motion. Usually cfg too high. Bring it down toward 6 or below. And remember: with speed tricks like caching, faces and fine motion are the first things to wobble, so if identity drifts, try turning the cache off before blaming the sampler.

I2V ignores the image. You loaded a plain text-to-video model, or forgot to connect image_cond_latents. Image-to-video needs an -I2V model and the encoded latents wired into that optional slot.

CategoryCogVideoWrapper

Inputs (17)

NameTypeDefaultDescription
modelCOGVIDEOMODEL
positiveCONDITIONING
negativeCONDITIONING
num_framesINT491–1024
stepsINT50
cfgFLOAT6.000–30
seedINT00–18446744073709550000
schedulerCOMBOCogVideoXDDIM12 options: DPM++, Euler, Euler A, PNDM, DDIM, CogVideoXDDIM, +6
samplesoptLATENTinit Latents to use for video2video process
image_cond_latentsoptLATENTLatent to use for image2video conditioning
denoise_strengthoptFLOAT1.000–1
context_optionsoptCOGCONTEXT
controlnetoptCOGVIDECONTROLNET
tora_trajectoryoptTORAFEATURES
fastercacheoptFASTERCACHEARGS
feta_argsoptFETAARGS
teacache_argsoptTEACACHEARGS

Outputs (1)

NameTypeDescription
samplesLATENT