Extensions/ComfyUI_NativeBlockSwap
ComfyUI Extension

ComfyUI_NativeBlockSwap

Native block swap node for ComfyUI WAN models (2.1 & 2.2), reduces VRAM by swapping up to 40 transformer blocks to CPU.

By lum3on·Created 7 months ago·Updated 3 months ago· 1
lum3on/ComfyUI_NativeBlockSwap
Nodes1
On cloudLocal install
CategoryComfyUI_NativeBlockSwap
Stars1
Updated3 months ago
Readme

ComfyUI_NativeBlockSwap

Native block swap node for ComfyUI WAN models, reducing VRAM usage by swapping transformer blocks to CPU.

✨ Features:

  • Compatible with WAN 2.1 and WAN 2.2 models (including all variants: VACE, Camera, HuMo, Animate, S2V)
  • Swap up to 40 transformer blocks to CPU (14B model has 40 blocks, 1.3B model has 30 blocks)
  • Optional embedding offloading (text and image embeddings)
  • Non-blocking memory transfer option for faster performance

📦 Installation:

cd ComfyUI/custom_nodes
git clone https://github.com/lum3on/ComfyUI_NativeBlockSwap.git
cd ComfyUI_NativeBlockSwap
python -m pip install -r requirements.txt

Restart ComfyUI after installation. The node appears as native WanvideoBlockswap in the ComfyUI_NativeBlockSwap category.

🎯 Usage:

image

⚙️ Parameters:

  • blocks_to_swap: Number of transformer blocks to offload to CPU (0-40)
  • offload_img_emb: Offload image embeddings to CPU
  • offload_txt_emb: Offload text embeddings to CPU
  • use_non_blocking: Use non-blocking memory transfer (faster but uses more RAM)