Nodes/ComfyUI-WanAnimatePlus/WanAnimatePlus SetBlockSwap
ComfyUI Node

WanAnimatePlus SetBlockSwap

Trade speed for VRAM, one transformer block at a time

By wuwukaka·Created 4 months ago·Updated about a month ago· 409
WanAnimatePlus SetBlockSwap
  • model
  • block_swap_args
  • model

Wan's 14B model does not fit your VRAM. That's not a bug, it's the price of the weights - and block swapping is the community's favorite way to pay less. The idea: instead of keeping all 40 transformer blocks resident on the GPU, you keep a handful on the card and shuffle blocks in from CPU/VRAM as the forward pass walks through them. You lose some speed, you gain the ability to run a model that technically shouldn't fit. WanAnimatePlus SetBlockSwap is the node that actually applies that configuration to your loaded model.

It's a small, honest pass-through: a WANVIDEOMODEL goes in, an optional BLOCKSWAPARGS bundle goes in, and the same model comes out with the block-swap settings stamped into its transformer options. The heavy lifting - the node that lets you choose how many blocks to swap - is the sibling WanAnimatePlus BlockSwap node, which produces the BLOCKSWAPARGS. Think of BlockSwap as the settings panel and SetBlockSwap as the apply button. You'll usually want both in a low-VRAM workflow.

The settings that actually matter

The knobs live on WanAnimatePlus BlockSwap (they arrive here as the block_swap_args input), and the tooltips tell the story:

  • blocks_to_swap - number of transformer blocks shuffled to CPU memory. The Wan 14B model has 40 blocks; 1.3B and 5B have 30; LongCat-video has 48. Start around 20 and work up until it fits.
  • vace_blocks_to_swap - same idea for the VACE control module's 15 blocks, when you're running a VACE controlnet.
  • prefetch_blocks - how many blocks to pull ahead of the pass. 1 usually cancels out the speed penalty of swapping; raise it only if you have RAM to burn.
  • use_non_blocking, block_swap_debug - a faster-but-RAM-heavier memory transfer flag and a debug logger, respectively.

SetBlockSwap itself has exactly two ports: model and the optional block_swap_args. Leave the latter unconnected and it's a pure pass-through, which is a legitimate way to keep a workflow's cable layout consistent.

When to bother

Block swapping is the classic "16GB and a 14B model" move. It's slower than just having the VRAM, obviously, but it beats OOM-crashing or dropping to a tiny GGUF quant. The official SCAIL-2 / WanAnimatePlus chains run through this same patching mechanism, so if you're following a low-VRAM guide for this pack, BlockSwap → SetBlockSwap is the pair doing the work between the model loader and the sampler.

Install

Part of ComfyUI-WanAnimatePlus, so:

cd ComfyUI/custom_nodes
git clone https://github.com/wuwukaka/ComfyUI-WanAnimatePlus.git

Restart ComfyUI, or use ComfyUI Manager (search "ComfyUI-WanAnimatePlus"). The README also asks that the original ComfyUI-WanVideoWrapper be present, and dependencies (accelerate, diffusers, gguf, etc.) come from the pack's requirements.txt. And the usual pack rule: don't cross WanAnimatePlus nodes with original WanVideoWrapper nodes in one workflow.

One honest note: this node's ancestor in Kijai's WanVideoWrapper is widely battle-tested, and the WanAnimatePlus fork re-exports it unchanged. If you've used block swap on Wan before, you already know exactly what this does - it's just wearing a WanAnimatePlus label so the pack's chains stay isolated.

CategoryWanAnimatePlus

Inputs (2)

NameTypeDefaultDescription
modelWANVIDEOMODEL
block_swap_argsoptBLOCKSWAPARGS

Outputs (1)

NameTypeDescription
modelWANVIDEOMODEL