XB-BOX - VRAM Calculator
Does your card actually fit that 22B model? This node does the math so you don't have to
- Available_VRAM
Before you queue a 22B video model on a 16GB card, it would be really nice to know whether it's going to fit. XB_VRAM_Calculator is the pack's answer to that exact moment of indecision: it estimates how much VRAM a Wan 2.2 or LTX 2.3 generation will leave you, based on the model, the quantization, and how many transformer layers you're willing to swap to RAM.
The mechanism is dead simple, and it's honest about being an estimate. The source has a hardcoded table of model sizes: LTX-2.3 (22B) at 44GB in FP16/BF16, 22.5GB in FP8, down to 13.5GB as GGUF-Q4; and the Wan 2.2 14B family (I2V, T2V, Animate) at 28GB FP16, 14GB FP8, 9GB at GGUF-Q4. It then computes:
Available = Total_VRAM − System_Overhead − (model_size / total_layers × layers_kept) − LoRA_vram
The "layers kept" bit is where it gets interesting: it assumes block-swap offloads model layers proportionally, so swapping N of 48 layers shrinks the active footprint accordingly. That's the same mental model the pack's XB_WanBlockSwap node uses, and the calculator's output is designed to feed its chunk-visualization sibling.
The inputs you actually touch
- Total_VRAM_GB - your card, default 24.
- System_Overhead_GB - what the OS and ComfyUI's runtime eat before your model loads, default 2.0. Bump it if you're running a browser + streaming everything.
- Main_Video_Model - LTX-2.3 (22B) or one of the three Wan 2.2 14B options.
- Model_Quantization - FP16/BF16, FP8, GGUF-Q8, GGUF-Q6, GGUF-Q4.
- Total_Model_Layers (default 48) and Layers_to_Swap - set the swap count to match your block-swap node.
- LoRA_Plugin_VRAM_GB - how much your LoRA stack adds.
The single output is Available_VRAM (FLOAT). It's a normal number you can wire anywhere, but it's secretly a subclass that also carries the layer-residency info - if you feed it into the pack's XB_ChunkVisualization node, that node reads the extra metadata to show "Reside: X/Y layers" on its preview. Nice touch, and the first time most people realize the calculator isn't just a standalone widget.
Where it's wrong (and you should know)
It's a back-of-envelope model, not a profiler. It ignores context/latent size, batch, and resolution - which for video is a huge chunk of peak VRAM - and the per-layer model assumes uniform layer sizes, which real MoE Wan 2.2 layers aren't. Treat the number as "will it boot and roughly survive," then trust your sampler's actual peak usage. It will not tell you that a 720p 81-frame clip needs 5GB of latent before the model even runs.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
then restart, or search "XB_ToolBox" in ComfyUI Manager. Pure Python/numpy - no extra dependencies.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| Total_VRAM_GB | INT | 244–128 | — |
| System_Overhead_GB | FLOAT | 2.00–64 | — |
| Main_Video_Model | COMBO | LTX-2.3 (22B) | 4 options: LTX-2.3 (22B), WAN2.2-I2V (14B), WAN2.2-T2V (14B), WAN2.2-Animate (14B) |
| Model_Quantization | COMBO | FP8 | 5 options: FP16/BF16, FP8, GGUF-Q8, GGUF-Q6, GGUF-Q4 |
| Total_Model_Layers | INT | 481–200 | — |
| Layers_to_Swap | INT | 00–200 | — |
| LoRA_Plugin_VRAM_GB | FLOAT | 0.00–64 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Available_VRAM | FLOAT | — |