Nodes/Vantage-Nodes/Vantage Wan Video Block Swap
ComfyUI Node

Vantage Wan Video Block Swap

Run a 40-block Wan video model on a smaller card by swapping blocks to RAM

By vantagewithai·Created 8 months ago·Updated about a month ago· 25
Vantage Wan Video Block Swap
  • model
  • MODEL
blocks_to_swap20
offload_img_embfalse
offload_txt_embfalse
use_non_blockingfalse

Wan's 14B video model is the reason a lot of people do local video at all - and the reason a lot of them are watching VRAM warnings. This node is a VRAM management trick borrowed from kijai's ComfyUI-WanVideoWrapper: it offloads part of the model's transformer blocks to system RAM while the sampler runs, letting a card that can't fit all 40 blocks still run the thing. Block swapping, not quantization.

The mechanism is worth understanding because it changes where memory lives, not how much there is. Wan 2.1's 14B model has 40 transformer blocks; the 1.3B has 30. This node hooks the model's load and moves the first N blocks (blocks_to_swap) to the offload device (your RAM), keeping the rest on the GPU. During sampling the blocks shuffle back and forth as needed - slower than having it all resident, but it turns "won't fit" into "runs, but takes longer." It's the same trade you make with GGUF quants, one level deeper.

What it needs

  • model - your Wan MODEL, straight from a Wan loader.
  • blocks_to_swap - how many of the leading blocks to push to RAM. Default 20 (half of the 14B's 40). The tooltip spells out the block counts per size. Start around half and tune by watching VRAM headroom; more swapped = more RAM used, less VRAM used, more swapping traffic.
  • offload_img_emb / offload_txt_emb - also push the image/text embedding tensors to RAM. Extra headroom for the tightest fits; costs speed.
  • use_non_blocking - non-blocking memory transfer when offloading. Faster, but it reserves more RAM for the in-flight copies. On a RAM-capped system, leave it off.

One output: MODEL, the same model with the load callback attached. Wire it into your sampler exactly where the original model would go.

Why you'd use it

You're on a 10–12GB card and the 14B Wan in fp16 is a no-go. Your alternatives: a GGUF quant (which this pack's VantageGGUFLoader covers), or block swap. They're not mutually exclusive - block swap is a pure ComfyUI-side memory shuffle, so it stacks with quantized weights for the really tight fits. Where it genuinely shines is keeping more of the model in GPU memory than a heavy quant would, at the cost of runtime. The initial swap-in step shows a progress bar while blocks get shuffled, so it looks intentional rather than frozen.

Install

Part of Vantage-Nodes:

cd ComfyUI/custom_nodes
git clone https://github.com/vantagewithai/Vantage-Nodes.git
pip install -r requirements.txt

or ComfyUI Manager → search "Vantage-Nodes" → Install → restart. It needs no extra models - it just rearranges the ones you already load.

Common issues

  • System RAM pressure - swapping 20+ blocks into RAM is memory-hungry on the RAM side. If your machine slows to a crawl or you hit RAM errors, lower blocks_to_swap or turn off use_non_blocking.
  • No visible speedup on a big card - correct: this node exists for cards that can't hold the model, not to make full-VRAM runs faster. On a roomy GPU, leave the model alone.
  • Only for Wan - it checks for the WAN21 model base. Feeding it a non-Wan model does nothing (or nothing useful); this isn't a generic swap for any transformer.
CategoryVantage/Wan/WanBlockSwap

Inputs (5)

NameTypeDefaultDescription
modelMODEL
blocks_to_swapINT200–40Number of transformer blocks to swap, the 14B model has 40, while the 1.3B model has 30 blocks
offload_img_embBOOLEANfalseOffload img_emb to offload_device
offload_txt_embBOOLEANfalseOffload txt_emb to offload_device
use_non_blockingBOOLEANfalseUse non-blocking memory transfer for offloading, reserves more RAM but is faster

Outputs (1)

NameTypeDescription
MODELMODEL