Nodes/XB_ToolBox/XB-BOX - 📦 模型加载大全V1
ComfyUI Node

XB-BOX - 📦 模型加载大全V1

Model, CLIP, eight LoRA slots, VAE, Sage, block swap — in one node

By wjluoxiao·Created 5 months ago·Updated 6 days ago· 302
XB-BOX - 📦 模型加载大全V1
    • MODEL
    • CLIP
    • VAE
    model_type
    model
    model_weight_dtypedefault
    clip
    clip_typestable_diffusion
    clip_devicedefault
    lora_1
    lora_1_ontrue
    lora_1_strength1.00
    vae
    sage_preset关闭
    blocks_to_swap0
    lora_2
    lora_2_onfalse
    lora_2_strength1.00
    lora_3
    lora_3_onfalse
    lora_3_strength1.00
    lora_4
    lora_4_onfalse
    lora_4_strength1.00
    lora_5
    lora_5_onfalse
    lora_5_strength1.00
    lora_6
    lora_6_onfalse
    lora_6_strength1.00
    lora_7
    lora_7_onfalse
    lora_7_strength1.00
    lora_8
    lora_8_onfalse
    lora_8_strength1.00

    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:

    1. model_type keyword filtering. Type wan and every model/CLIP/VAE/LoRA dropdown only lists files inside a subfolder whose path contains wan. The dropdowns literally can't show anything until you type a keyword.
    2. Eight LoRA slots, each with an _on boolean and a _strength float, applied in sequence to the loaded model and CLIP.
    3. SageAttention + block swap. sage_preset patches attention with SageAttention (the KJNodes-derived accelerator - auto mode or the built-in M/N/GROUP/WAVE/WARP configs), and blocks_to_swap offloads 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 - default or cpu. Pushing CLIP to CPU frees VRAM at the cost of slower encoding; useful on cramped cards.
    • model_weight_dtype - default or the fp8 options (fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2). fp8 is how 12B+ models fit.
    • lora_1..8 with _on / _strength toggles.
    • 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.

    CategoryXB_ToolBox/Model_Loader

    Inputs (33)

    NameTypeDefaultDescription
    model_typeSTRING输入关键字(如 wan/flux/sd),只显示匹配子文件夹中的模型
    modelCOMBO1 options: (请先输入模型类型)
    model_weight_dtypeCOMBOdefault4 options: default, fp8_e4m3fn, fp8_e4m3fn_fast, fp8_e5m2
    clipCOMBO1 options: (请先输入模型类型)
    clip_typeCOMBOstable_diffusion28 options: stable_diffusion, stable_cascade, sd3, stable_audio, mochi, ltxv, +22
    clip_deviceCOMBOdefault2 options: default, cpu
    lora_1COMBO1 options:
    lora_1_onBOOLEANtrue
    lora_1_strengthFLOAT1.00-100–100
    vaeCOMBO1 options: (请先输入模型类型)
    sage_presetCOMBO关闭9 options: 关闭, 自动, 内置模式 A (128x128x32), 内置模式 B (128x64x96), 内置模式 C (128x16x16), 内置模式 D (64x64x16), +3
    blocks_to_swapINT00–200
    lora_2COMBO1 options:
    lora_2_onBOOLEANfalse
    lora_2_strengthFLOAT1.00-100–100
    lora_3COMBO1 options:
    lora_3_onBOOLEANfalse
    lora_3_strengthFLOAT1.00-100–100
    lora_4COMBO1 options:
    lora_4_onBOOLEANfalse
    lora_4_strengthFLOAT1.00-100–100
    lora_5COMBO1 options:
    lora_5_onBOOLEANfalse
    lora_5_strengthFLOAT1.00-100–100
    lora_6COMBO1 options:
    lora_6_onBOOLEANfalse
    lora_6_strengthFLOAT1.00-100–100
    lora_7COMBO1 options:
    lora_7_onBOOLEANfalse
    lora_7_strengthFLOAT1.00-100–100
    lora_8COMBO1 options:
    lora_8_onBOOLEANfalse
    lora_8_strengthFLOAT1.00-100–100

    Outputs (3)

    NameTypeDescription
    MODELMODEL
    CLIPCLIP
    VAEVAE