WanVideo Set BlockSwap
Apply block-swap args to a model you already loaded
- model
- block_swap_args
- model
This is the small companion to WanVideoBlockSwap, and it solves a specific plumbing problem: applying block-swap settings to a WANVIDEOMODEL after it's been loaded, rather than at load time through the model loader's own socket. Model in, model out, with the block-swap config applied in between.
If you're wondering why you'd need it - most people don't. The normal path is to wire your BLOCKSWAPARGS straight into WanVideoModelLoader's block_swap_args input and be done. WanVideoSetBlockSwap exists for the graphs where that isn't convenient: when the model comes from somewhere that already produced a WANVIDEOMODEL and you want to set or change its block swapping downstream, without re-running the loader.
How it works
It takes an already-constructed WANVIDEOMODEL and attaches (or overrides) its block-swap arguments, then passes the model along. It's a pass-through with a side effect - the model object is the same, but its memory-placement behavior now reflects the BLOCKSWAPARGS you fed in. Everything downstream (the sampler) uses the updated configuration.
The inputs and outputs that matter
model- theWANVIDEOMODELto modify. Required.block_swap_args(optional) - theBLOCKSWAPARGSfrom a WanVideoBlockSwap node. This is what actually gets applied. Without it, the node has nothing to set.
Output is the same WANVIDEOMODEL, now carrying the block-swap settings, ready for the sampler.
How to install it
Part of the pack. Via ComfyUI Manager: search WanVideo Wrapper, install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/kijai/ComfyUI-WanVideoWrapper
pip install -r ComfyUI-WanVideoWrapper/requirements.txt
then restart. Nothing to download; it operates on a model you've already loaded.
Common issues & troubleshooting
You're not sure whether to use this or the loader socket. Default to the loader socket - wire BLOCKSWAPARGS into WanVideoModelLoader's block_swap_args and skip this node. Reach for WanVideoSetBlockSwap only when the graph structure makes setting block swap at load time awkward, or when you want to apply/adjust it further down the chain.
It doesn't seem to change VRAM use. Make sure a real BLOCKSWAPARGS is connected to block_swap_args - the node is a no-op without it. All the tuning that matters (how many blocks, offloading embeddings, prefetch) lives on the WanVideoBlockSwap node that produces those args, not here.
Setting block swap in two places. If you both wired args into the loader and used this node, you now have two sources of truth for the same setting. Pick one path so it's obvious which config is live.
Still OOM. This node only applies the args; it can't save more VRAM than the settings allow. Raise blocks_to_swap on the source node, use fp8 quantization on the loader, and confirm you have the system RAM to hold the swapped blocks.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| model | WANVIDEOMODEL | — | |
| block_swap_argsopt | BLOCKSWAPARGS | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | WANVIDEOMODEL | — |