📦 SDNQ模型加载器 Magic SDNQ Model Loader
The low-VRAM SDNQ model loader
- clip
- vae
- model
- clip
- vae
SDNQ is the quantization format of the moment for running big models on small cards - the community's shorthand is "like svdquant, but faster to quantize and gentler on lower-spec GPUs" - and it's one of the few quantization routes that genuinely targets the 8–16GB VRAM crowd. Magic SDNQ Loader is a standalone loader that wraps an SDNQ model into ComfyUI's familiar MODEL + CLIP + VAE triple, so you can use an SDNQ-quantized FLUX, FLUX.2, Qwen-Image, or Z-Image like any checkpoint. No single-big-monolithic-sampler setup required.
The pack's design decision is what makes it feel normal: instead of a combined loader-plus-sampler blob, it splits into this loader and a separate Magic SDNQ K Sampler, with loading and sampling logic that mirrors ComfyUI's official nodes. The README is explicit that this is built on the comfyui-sdnq main branch (by EnragedAntelope) and supports all adapted models, not a single architecture. The one boundary: image models only - no video, at least for now.
Inputs that matter
model_selection- a dropdown of known SDNQ repos (FLUX.1-dev, FLUX.1-schnell, FLUX.2-dev, FLUX.2-klein 4B/9B, Qwen-Image variants, Z-Image, and more), plus--Custom Model--for anything else.custom_repo_or_pathtakes a HuggingFace repo ID or local path when you pick Custom.dtype- bfloat16 / float16 / float32memory_mode- the tooltips are the guide:gpufor 24GB+,balanced(CPU offload, 12–16GB),lowvram(sequential offload, ~8GB)auto_download- on by default; if the model isn't cached it pulls from HuggingFaceenable_vae_tiling- VAE tiles big images to save VRAMuse_torch_compile- read this one: first compile takes 30–60 seconds, then 2–3x faster afterward; on 12GB the tooltip says turn it off to avoid OOMuse_xformers- faster attention (10–45%) with a graceful fallback to SDPA if xFormers isn't installed
Outputs are model, clip, vae - the standard triple, so your conditioning and VAE decode wiring doesn't change at all.
The body-only trick
The optional clip and vae inputs are where the VRAM win gets bigger. Connect both and, for FLUX-family models, the loader loads only the transformer body (~5GB) from the SDNQ folder and uses your external CLIP and VAE - less VRAM, and per the README, potentially better quality and speed. Connect only one and it errors deliberately; connect neither and it does a full-package load. That "both or neither" rule is the one thing people hit first, so remember it.
Installing - the part everyone skips
This is where the pack's README splits from the usual "clone and go":
cd ComfyUI/custom_nodes/
git clone https://github.com/shigjfg/ComfyUI-Magic-Assistant.git
cd ComfyUI-Magic-Assistant
pip install -r requirements.txt
pip install -r requirements-sdnq.txt # adds sdnq + huggingface-hub
The requirements-sdnq.txt file installs sdnq and huggingface-hub, and the README also points you at the SDNQ technical source repo's tutorial for the diffusers/transformers environment. The good news: the pack lazy-loads SDNQ, so if you skip this step the rest of the pack still works - the SDNQ nodes just error when you try to use them. Models themselves come from the Disty0 SDNQ HuggingFace collection (auto-downloaded), and there's a local SDNQ models directory if you'd rather manage files yourself.
Troubleshooting
import sdnqfails → you didn't runrequirements-sdnq.txt. That's the #1 error.- OOM during first compile →
use_torch_compileoff. - "Please connect both external CLIP and VAE" → yes, it's intentional. Both or nothing.
- Slow first load → torch compile is compiling. Let it finish once.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| model_selection | COMBO | FLUX.1-dev-SDNQ-uint4 | 16 options: --Custom Model--, FLUX.1-dev-SDNQ-uint4, FLUX.1-schnell-SDNQ-uint4, FLUX.1-Krea-dev-SDNQ-uint4, FLUX.1-Kontext-dev-SDNQ-uint4, FLUX.2-dev-SDNQ-uint4, +10 |
| custom_repo_or_path | STRING | — | |
| dtype | COMBO | bfloat16 | 3 options: bfloat16, float16, float32 |
| memory_mode | COMBO | balanced | gpu=全显存(24GB+), balanced=CPU卸载(12-16GB), lowvram=顺序卸载(8GB) |
| auto_download | BOOLEAN | true | 模型未缓存时自动从 HuggingFace 下载 |
| enable_vae_tiling | BOOLEAN | true | 大图时 VAE 分块处理省显存 |
| use_quantized_matmul | BOOLEAN | true | — |
| use_torch_compile | BOOLEAN | true | 首次编译需30-60秒但后续快2-3倍。12GB显存建议关闭以避免OOM |
| use_xformers | BOOLEAN | true | xFormers 注意力 (10-45% 加速)。未安装时回退到 SDPA |
| clipopt | CLIP | 连接后仅加载模型本体(~5GB),使用此外部 CLIP,省显存 | |
| vaeopt | VAE | 连接后仅加载模型本体(~5GB),使用此外部 VAE,省显存 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| clip | CLIP | — |
| vae | VAE | — |