Nodes/ComfyUI-WanAnimatePlus/WanAnimatePlus BlockSwap
ComfyUI Node

WanAnimatePlus BlockSwap

Run a 14B Wan Animate on a small card by renting your system RAM

By wuwukaka·Created 4 months ago·Updated about a month ago· 409
WanAnimatePlus BlockSwap
    • block_swap_args
    blocks_to_swap20
    offload_img_embfalse
    offload_txt_embfalse
    use_non_blockingfalse
    vace_blocks_to_swap0
    prefetch_blocks0
    block_swap_debugfalse

    Block swapping is the trick that lets a 14B Wan model sample inside VRAM it has no business being in. Instead of keeping every transformer block resident on the GPU, the sampler shuffles blocks to your CPU RAM and back one at a time as it runs. Your system RAM becomes cheap overflow parking, and VRAM only ever holds the blocks being computed right now. It's the difference between "out of memory at 12GB" and "annoyingly slow at 12GB."

    This node is just a settings bundle for that mechanism. Its single output, block_swap_args, plugs into the block_swap_args input on WanAnimatePlus ModelLoader.

    The one number that matters is blocks_to_swap. Default 20, max 48 - and the tooltip tells you why it goes that high: the 14B model has 40 transformer blocks, the 1.3B and 5B have 30, LongCat-video has 48. Swap enough blocks and peak VRAM drops below what the model would otherwise need. There's also vace_blocks_to_swap if you've stacked a VACE extra model (VACE has 15 blocks of its own) - leave it at 0 unless the VACE model itself is what's blowing your budget.

    A couple of refinements worth knowing:

    • prefetch_blocks: prefetches blocks from RAM while others are still computing. This is the "wait, block swapping made it fast?" setting - 1 is usually enough to recover most of the speed you lose to PCIe shuffling. The block_swap_debug toggle exists precisely so you can confirm the prefetch is actually helping on your system instead of guessing.
    • offload_img_emb / offload_txt_emb: push the embedding tensors to the offload device too. Marginal, but free memory when you're scraping the floor.
    • use_non_blocking: uses non-blocking memory transfers. Faster, but reserves more RAM - the kind of toggle you reach for on a 16GB card with 64GB of system RAM and regret on a laptop.

    How much do you actually swap? This is where people misread the node. Swapping 20 of 40 blocks is not "half the VRAM, half the speed." Block swap lowers peak memory, not average, and each swapped block adds a PCIe round-trip per sampling step. Overshoot and your bottleneck becomes the bus, not the GPU. Practical path: start at the default, turn block_swap_debug on, and nudge blocks_to_swap up only until you stop OOMing. Pairing it with the sampler's comfy_chunked RoPE and force_offload on the model loader is the usual low-VRAM recipe.

    Install the pack via ComfyUI Manager (search "WanAnimatePlus") or git clone https://github.com/wuwukaka/ComfyUI-WanAnimatePlus into custom_nodes, then restart. One caveat from the README's own FAQ: the fork expects the original ComfyUI-WanVideoWrapper installed alongside, and you should use the full WanAnimatePlus chain - mixing in original WanVideoWrapper nodes degrades output. If your renders are suddenly crawling after enabling this, drop prefetch_blocks to 0 and check whether your system RAM is actually fast enough to feed the card.

    CategoryWanAnimatePlus

    Inputs (7)

    NameTypeDefaultDescription
    blocks_to_swapINT200–48Number of transformer blocks to swap, the 14B model has 40, while the 1.3B and 5B models have 30 blocks. LongCat-video has 48
    offload_img_embBOOLEANfalseOffload img_emb to offload_device
    offload_txt_embBOOLEANfalseOffload time_emb to offload_device
    use_non_blockingoptBOOLEANfalseUse non-blocking memory transfer for offloading, reserves more RAM but is faster
    vace_blocks_to_swapoptINT00–15Number of VACE blocks to swap, the VACE model has 15 blocks
    prefetch_blocksoptINT00–40Number of blocks to prefetch ahead, can speed up processing but increases memory usage. 1 is usually enough to offset speed loss from block swapping, use the debug option to confirm it for your system
    block_swap_debugoptBOOLEANfalseEnable debug logging for block swapping

    Outputs (1)

    NameTypeDescription
    block_swap_argsBLOCKSWAPARGS