FLUX.2 SDNQ Loader
The FLUX.2 SDNQ Loader is not the Comfy loader you're used to
- pipeline
If you've been running Klein through the official ComfyUI template, this node looks wrong on purpose. It doesn't read a .safetensors file and it doesn't feed a KSampler. It loads a full diffusers-format FLUX.2 Klein checkpoint through the SDNQ quantization runtime, and it hands back a custom FLUX2_SDNQ_PIPELINE that only the other nodes in this pack can consume. That makes it the hub of the whole pack: no Loader, no generation. Every other node - Text to Image, Image Edit, Adapter Apply - wants its pipeline output on the left side.
Why would you go this route instead of Comfy's native Klein support? Because SDNQ is a different quantization path than the fp8/GGUF/NVFP4 you've seen plastered across every Klein thread. It's an experimental quant runtime, and this pack is betting that loading Klein through it gets you a smaller, cheaper model without abandoning the diffusers pipeline API that the training tools and LoRAs are built around. It's niche, it's early, and it's the entire point of this pack. SDNQ's own name isn't even settled in the wider community yet - mentions on Reddit spiked with the Z-Image quantization talk in late 2025 and stayed thin since. If you want boring and battle-tested, use the native Comfy workflow. If you want to try the SDNQ path, this is the front door.
What it actually does
The loader scans your models/diffusers folder for Klein checkpoints - specifically, folders whose model_index.json declares a Flux2KleinPipeline or the KV-cache variant - and lists what it finds in the model_source dropdown. SDNQ-tagged and FLUX.*klein* folders get sorted to the top. Sampling happens inside the diffusers pipeline, not through Comfy's sampler nodes, so your familiar KSampler/CheckpointLoaderSimple don't apply here at all.
The inputs that matter
For a first run, set model_source and ignore the rest - every other option defaults to auto for good reasons:
- model_source - the discovered diffusers folders. If yours isn't listed, either it isn't in the right format or you need model_source_custom, which accepts a local path or a Hugging Face model id like
black-forest-labs/FLUX.2-klein-4B. - quantized_matmul - the SDNQ switch.
autoenables quantized matmul when the backend supports it: on CUDA that means thetritonpackage has to be installed, on Apple silicon it uses SDNQ's MPS affine path. If triton is missing, auto quietly falls back to unquantized. - device / dtype -
autoprefers MPS, then CUDA, then CPU, and picks bf16 when the GPU can handle it. Leave them alone unless you have a reason. - text_encoder_residency -
autoparks the Qwen3 text encoder off-GPU on MPS and on CUDA/ROCm cards with 24 GB or less. This is the setting that keeps the pack usable on a 12 GB card, so knowing it exists saves you a panic later. - pipeline_variant - plain Klein vs the KV-cache Klein runtime.
autopicks from the model source; only touch it if you're deliberately testing the KV variant.
Output
One output, pipeline (FLUX2_SDNQ_PIPELINE), which wires straight into the pack's Text to Image, Image Edit, and Adapter Apply nodes. You can also feed it to the Clear Caches node, but that's optional.
Install
ComfyUI Manager, search FLUX.2 SDNQ, or:
cd ComfyUI/custom_nodes
git clone https://github.com/GeneralShan/comfyui-flux2-sdnq
Then restart ComfyUI. Two non-negotiable extras the README calls out:
- ComfyUI 0.17.0+ (the pack uses the new extension API)
- Python 3.12+
pip install sdnq diffusers peft- the code hard-fails with "The sdnq package is required to load SDNQ checkpoints" if you skip this
Where people get burned
- The model won't appear in the dropdown. You dropped a single-file checkpoint in
models/checkpoints. This pack needs a diffusers folder undermodels/diffuserswith a propermodel_index.json.huggingface-cli download black-forest-labs/FLUX.2-klein-4B --local-dir ComfyUI/models/diffusers/klein-4b-sdnqis the fastest way there. - "sdnq package is required" - you skipped the pip install. It's not optional.
- A base (50-step) Klein at 4 steps looks mushy. The distilled checkpoints are what this pack is tuned for. Pick the distilled 4B or 9B for generation; keep base for training.
- Windows CUDA feels slow - quantized matmul needs triton, which Windows users often don't have. Either install it or accept the unquantized fallback.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| model_source | COMBO | <manual> | Diffusers model folder discovered under ComfyUI models/diffusers. |
| device | COMBO | auto | Execution device. Auto prefers MPS, then CUDA, then CPU. |
| dtype | COMBO | auto | Floating-point dtype for non-quantized modules. |
| quantized_matmul | COMBO | auto | Enable SDNQ quantized matmul when the backend supports it. Auto uses model-aware defaults. |
| text_encoder_residency | COMBO | auto | Keep loaded, or park after prompt. Auto parks on MPS and <=24 GiB CUDA/ROCm. |
| decode_residency | COMBO | auto | Keep the transformer loaded for decode, or offload it before large PIL decodes. Auto is request-time memory-aware. |
| edit_attention_chunking | COMBO | auto | Chunk plain Klein edit attention. KV suppresses this. |
| edit_attention_query_chunk_size | INT | 10240–8192 | Chunk size for plain Klein edit attention. |
| local_files_only | BOOLEAN | true | Restrict loading to local files only. |
| low_cpu_mem_usage | BOOLEAN | true | Use diffusers low-CPU-memory loading path when available. |
| model_source_custom | STRING | Optional local path or Hugging Face model id that overrides the combo selection. | |
| pipeline_variant | COMBO | auto | Resolve the runtime as the plain Klein pipeline or the KV-cache Klein pipeline. Auto uses model-source heuristics. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| pipeline | FLUX2_SDNQ_PIPELINE | — |