XB-BOX - 📦 模型加载大全V1
Model, CLIP, eight LoRA slots, VAE, Sage, block swap — in one node
- MODEL
- CLIP
- VAE
A normal ComfyUI loading setup is five nodes - UNET loader, CLIP loader, VAE loader, and a LoRA loader per LoRA. XB_ModelLoaderV1 is the pack's "model loading encyclopedia": one node that loads your UNet, CLIP, up to eight LoRAs, and VAE, then optionally applies SageAttention and block-swap VRAM tricks, and hands you all three (MODEL, CLIP, VAE) from a single spot.
The pitch is graph cleanup. If you're assembling a video model like Wan or LTX, the loader tangle eats a third of your canvas. This collapses it into one tall node and - the genuinely useful part - adds a keyword filter so you don't scroll through two hundred checkpoint names to find the one in your wan/ subfolder.
How it works
Underneath it's a thin shell over ComfyUI's official UNETLoader, CLIPLoader, VAELoader, and LoraLoader. The shell adds three things:
model_typekeyword filtering. Typewanand every model/CLIP/VAE/LoRA dropdown only lists files inside a subfolder whose path containswan. The dropdowns literally can't show anything until you type a keyword.- Eight LoRA slots, each with an
_onboolean and a_strengthfloat, applied in sequence to the loaded model and CLIP. - SageAttention + block swap.
sage_presetpatches attention with SageAttention (the KJNodes-derived accelerator - auto mode or the built-inM/N/GROUP/WAVE/WARPconfigs), andblocks_to_swapoffloads the first N transformer blocks to system RAM to claw back VRAM.
The inputs that matter
- model_type - the keyword gate. Everything else is gated behind it, and that's the first thing that confuses people.
- model / clip / vae - dropdowns, each filtered by keyword.
- clip_type - 28 options from the official CLIPLoader (wan, ltxv, stable_diffusion, sd3…). This is the one to get right - a wrong clip_type is the classic "black output / garbage conditioning" failure.
- clip_device -
defaultorcpu. Pushing CLIP to CPU frees VRAM at the cost of slower encoding; useful on cramped cards. - model_weight_dtype -
defaultor the fp8 options (fp8_e4m3fn,fp8_e4m3fn_fast,fp8_e5m2). fp8 is how 12B+ models fit. - lora_1..8 with
_on/_strengthtoggles. - sage_preset -
关闭(off) is the default and the right place to start. - blocks_to_swap - 0 = off. Each block offloaded costs speed.
Outputs: MODEL, CLIP, VAE.
The folder gotcha
The keyword filter only lists models that live in a subfolder matching the keyword. A model sitting directly in models/diffusion_models/ - no subfolder - will never appear, no matter what you type. So the practical rule: keep your Wan models in models/diffusion_models/wan/, your LTX in ltx/, etc. If a dropdown says "无匹配模型" and you know the file exists, it's almost always a folder-structure problem, not a scan problem. Model files are picked from diffusion_models, CLIPs from text_encoders, and LoRAs from loras, all filtered the same way.
Install & troubleshooting
cd ComfyUI/custom_nodes
git clone https://github.com/WJLUOXIAO/XB_ToolBox.git
# or: ComfyUI Manager → "XB_ToolBox"
No pip deps for the loader itself. Two real-world warnings: SageAttention needs the sageattention package installed for 自动/built-in modes - if it's missing, the pack silently falls back to passing the model through, so you think you're getting a speedup you aren't. And block swap on a model whose blocks are already offloaded elsewhere (e.g. a GGUF loader with its own swap) can double-pay. Keep blocks_to_swap at 0 until you actually OOM, then raise it one block at a time - every block you swap is time you'll never get back.
Inputs (33)
| Name | Type | Default | Description |
|---|---|---|---|
| model_type | STRING | 输入关键字(如 wan/flux/sd),只显示匹配子文件夹中的模型 | |
| model | COMBO | 1 options: (请先输入模型类型) | |
| model_weight_dtype | COMBO | default | 4 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2 |
| clip | COMBO | 1 options: (请先输入模型类型) | |
| clip_type | COMBO | stable_diffusion | 28 options: stable_diffusion, stable_cascade, sd3, stable_audio, mochi, ltxv, +22 |
| clip_device | COMBO | default | 2 options: default, cpu |
| lora_1 | COMBO | 1 options: 无 | |
| lora_1_on | BOOLEAN | true | — |
| lora_1_strength | FLOAT | 1.00-100–100 | — |
| vae | COMBO | 1 options: (请先输入模型类型) | |
| sage_preset | COMBO | 关闭 | 9 options: 关闭, 自动, 内置模式 A (128x128x32), 内置模式 B (128x64x96), 内置模式 C (128x16x16), 内置模式 D (64x64x16), +3 |
| blocks_to_swap | INT | 00–200 | — |
| lora_2 | COMBO | 1 options: 无 | |
| lora_2_on | BOOLEAN | false | — |
| lora_2_strength | FLOAT | 1.00-100–100 | — |
| lora_3 | COMBO | 1 options: 无 | |
| lora_3_on | BOOLEAN | false | — |
| lora_3_strength | FLOAT | 1.00-100–100 | — |
| lora_4 | COMBO | 1 options: 无 | |
| lora_4_on | BOOLEAN | false | — |
| lora_4_strength | FLOAT | 1.00-100–100 | — |
| lora_5 | COMBO | 1 options: 无 | |
| lora_5_on | BOOLEAN | false | — |
| lora_5_strength | FLOAT | 1.00-100–100 | — |
| lora_6 | COMBO | 1 options: 无 | |
| lora_6_on | BOOLEAN | false | — |
| lora_6_strength | FLOAT | 1.00-100–100 | — |
| lora_7 | COMBO | 1 options: 无 | |
| lora_7_on | BOOLEAN | false | — |
| lora_7_strength | FLOAT | 1.00-100–100 | — |
| lora_8 | COMBO | 1 options: 无 | |
| lora_8_on | BOOLEAN | false | — |
| lora_8_strength | FLOAT | 1.00-100–100 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| CLIP | CLIP | — |
| VAE | VAE | — |