Nodes/ComfyUI-WanVideoWrapper/WanVideo MagCache
ComfyUI Node Runs on cloud

WanVideo MagCache

A third caching option, after TeaCache got deprecated

By kijai·Created about a year ago·Updated 2 months ago· 6,651
WanVideo MagCache
    • cache_args
    magcache_thresh0.020
    magcache_K4
    start_step1
    end_step-1
    cache_deviceoffload_device

    If you've read this pack's TeaCache node's own docs, you know it flat out says "deprecated, use... an alternative custom node that's up to date." MagCache is one of the options that sentence is pointing at - a separate caching implementation, ported from Zehong-Ma's original MagCache repo into WanVideoWrapper, doing the same basic job TeaCache used to: skip redundant computation across similar denoising steps to speed up generation.

    The tradeoff hasn't changed, just the implementation

    Every caching scheme for video diffusion is making the same bet: a lot of consecutive denoising steps look nearly identical, so instead of fully recomputing each one, you detect when a step is "close enough" to something already computed and reuse it. The community's own read on this class of technique, from the TeaCache era, still applies here: moderate speedup, minor quality impact, and specifically - people consistently notice that disabling caching improves face consistency at the cost of speed. That's not a TeaCache-specific quirk, it's a property of skipping work at all. If you turn on MagCache and faces start looking a little unstable across a clip, that's the expected cost of the speedup, not a bug particular to this implementation.

    The inputs that matter

    magcache_thresh (default 0.02, range 0–0.3) - the similarity threshold for deciding a step is close enough to skip. Lower is more conservative (fewer skips, safer quality); higher skips more aggressively for more speed at more risk. magcache_K (default 4, range 0–6) - controls how the caching algorithm groups or limits consecutive skips; treat it as a secondary aggressiveness knob alongside the threshold rather than something to tune in isolation. start_step (default 1) and end_step (default -1, meaning "through the end") - the range of sampling steps caching is active over, mirroring the same start/end windowing pattern you'll see on LoRAs and control nodes elsewhere in this pack; caching is generally safer to enable well into the schedule rather than from step zero, which is why the default doesn't start at 0. cache_device (default offload_device, or main_device) - where cached tensors live; offload keeps them off your GPU's active memory, which is the sane default unless you have VRAM to spare and want to squeeze out extra speed.

    Output is a single cache_args (CACHEARGS) - this doesn't do anything by itself. It has to be plugged into the cache_args input on a sampler that accepts it, such as WanVideo Diffusion Forcing Sampler.

    How to install it

    Via ComfyUI Manager, search WanVideoWrapper and install, or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
    

    then restart. No separate model download - this is a runtime technique, not a checkpoint.

    Common issues & troubleshooting

    Built the node but nothing sped up. Confirm cache_args is actually wired into your sampler's cache_args input - like a lot of "args"-style config nodes in this pack, it's inert until connected to something that consumes it.

    Faces drift or wobble across a longer clip. That's the caching tradeoff working as expected, not a broken setting. Whichever caching option you land on across this ecosystem - MagCache here, or the native EasyCache path this pack's now-deprecated TeaCache node points people toward - turning it off entirely is the first thing worth trying when identity consistency actually matters more than render time.

    Not sure whether to reach for this over EasyCache. This pack's own TeaCache node explicitly recommends EasyCache as the native, currently-maintained option; MagCache is a specific third-party technique kijai ported in alongside it, worth trying if EasyCache's particular speed/quality tradeoff isn't landing for your workflow, but not the pack's own default recommendation.

    CategoryWanVideoWrapper

    Inputs (5)

    NameTypeDefaultDescription
    magcache_threshFLOAT0.0200–0.3How strongly to cache the output of diffusion model. This value must be non-negative.
    magcache_KINT40–6The maxium skip steps of MagCache.
    start_stepINT10–9999Step to start applying MagCache
    end_stepINT-1-1–9999Step to end applying MagCache
    cache_deviceCOMBOoffload_deviceDevice to cache to

    Outputs (1)

    NameTypeDescription
    cache_argsCACHEARGS