Vantage Wan Video Block Swap
Run a 40-block Wan video model on a smaller card by swapping blocks to RAM
- model
- MODEL
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_swapor turn offuse_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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| blocks_to_swap | INT | 200–40 | Number of transformer blocks to swap, the 14B model has 40, while the 1.3B model has 30 blocks |
| offload_img_emb | BOOLEAN | false | Offload img_emb to offload_device |
| offload_txt_emb | BOOLEAN | false | Offload txt_emb to offload_device |
| use_non_blocking | BOOLEAN | false | Use non-blocking memory transfer for offloading, reserves more RAM but is faster |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |