Nodes/ComfyUI CogVideoX Wrapper/CogVideoX FasterCache
ComfyUI Node Runs on cloud

CogVideoX FasterCache

Speed up CogVideoX by reusing work

By kijai·Created 2 years ago·Updated 12 months ago· 1,549
CogVideoX FasterCache
    • fastercache
    start_step15
    hf_step30
    lf_step40
    cache_devicemain_device
    num_blocks_to_cache42

    Video generation is slow, and FasterCache is one of the ways to make CogVideoX less slow. It's a caching technique: across the many denoising steps, a lot of the transformer's internal work barely changes from one step to the next, so FasterCache stashes those intermediate results and reuses them instead of recomputing. Fewer full computations, faster generation, a little quality given up in exchange. You wire it into the sampler and it works during the run.

    It sits in the same family as TeaCache and the other "skip redundant work" tricks people stack on video models. The pitch across all of them is identical: real speedups, minor quality cost, and the cost shows up first in fine detail and temporal consistency. FasterCache splits its handling into high-frequency and low-frequency components, which is why it has separate step controls for each.

    The inputs that matter

    All required, and the defaults are a working configuration - most people leave them alone:

    • start_step (default 15) - when caching kicks in. The early denoising steps build the overall structure, so caching stays off until step 15 to avoid corrupting the foundation. Start caching too early and you damage composition.
    • hf_step (default 30) and lf_step (default 40) - the step thresholds for the high-frequency and low-frequency parts of the cache. These govern when each kind of cached feature gets reused. The defaults are tuned; only touch them if you're deliberately trading more speed for more quality loss.
    • num_blocks_to_cache (default 42) - how many transformer blocks participate. More blocks cached means more speedup and more potential drift.
    • cache_device - where the cached tensors live. main_device keeps them on the GPU (fastest, uses VRAM); offload_device moves them off to save memory if you're tight.

    The output, fastercache (a FASTERCACHEARGS bundle), connects to the fastercache slot on CogVideo Sampler. That's its only home.

    How to install it

    Bundled with the wrapper:

    • 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

    Faces and fine detail get mushy. That's the tradeoff, and it's the same story with every cache in this space - reusing skipped work occasionally reuses something that should have changed, and faces are where you spot it first. If identity or detail matters more than speed for a given render, turn FasterCache off. Caching is the first thing to disable when quality wobbles, not the last.

    No speedup, or things got worse. If you pushed start_step down or num_blocks_to_cache up chasing speed, you likely overshot into quality territory. Go back to the defaults - they're a deliberate balance. And don't stack every acceleration trick at once; FasterCache plus a TeaCache plus aggressive step-cutting compounds the quality loss faster than it compounds the speedup.

    VRAM went up. Cached tensors have to live somewhere. If cache_device is main_device, they're on your GPU. Switch it to offload_device to trade a little speed for the memory back.

    CategoryCogVideoWrapper

    Inputs (5)

    NameTypeDefaultDescription
    start_stepINT150–1024
    hf_stepINT300–1024
    lf_stepINT400–1024
    cache_deviceCOMBOmain_deviceThe device to use for the cache, main_device is on GPU and uses a lot of VRAM
    num_blocks_to_cacheINT420–1024Number of transformer blocks to cache, 5b model has 42 blocks, tradeoff between speed and memory

    Outputs (1)

    NameTypeDescription
    fastercacheFASTERCACHEARGS