Nodes/ComfyUI-Magic-Assistant/🔮 Magic Nunchaku FLUX.2 Klein Loader
ComfyUI Node

🔮 Magic Nunchaku FLUX.2 Klein Loader

Run FLUX.2 Klein on a 30-series card without the official nunchaku node

By shigjfg·Created 8 months ago·Updated 11 days ago· 37
🔮 Magic Nunchaku FLUX.2 Klein Loader
    • MODEL
    model_name
    device_id0
    data_typebfloat16

    FLUX.2 Klein is the model that made decent local generation possible for people who aren't holding a 4090 - 9B is fast, 4B even more so, and it's a flow-matching model that wants just a handful of steps (4–8 on the distilled tier, CFG 1). The catch is that running it well has meant the Nunchaku stack, a quantization library that uses the INT4/INT8 hardware paths on RTX 30- and 40-series cards. That stack was built for Qwen and Z-Image before anyone had Klein support wired up.

    This node closes that gap. It loads the Nunchaku-quantized FLUX.2 Klein transformers from tonera's repos - FLUX.2-klein-9B-Nunchaku, the klein9bkv variant, and klein4b - and the README's claim is a 3–4x speedup over earlier klein9b quantization routes, with a strong recommendation for 30-series and 40-series owners. Community reports broadly agree that Klein is the quick one among the 2026 edit models; the whole point of going the Nunchaku route is that those cards have the hardware units to make INT4 actually fast.

    How it works

    The clever bit is in the mechanism, and it's worth understanding because it explains the weird first-run ritual. The standalone nunchaku pip package ships wrappers for the models it knows about, and FLUX.2 Klein's wrapper wasn't among them when this node was written. So the loader patches your existing nunchaku install, dropping in the missing wrappers/klein.py wrapper whose source is embedded right in this custom node. That's why the first-run flow is: click ⚙️ Settings → let it check the environment → download and install the wheel. It's not downloading a model, it's fixing the missing piece in nunchaku itself.

    Inputs are thin on purpose: model_name (a dropdown of the .safetensors files in your diffusion_models/ folder - drop the tonera file there), device_id, and data_type with the tooltip doing the real work: bfloat16 for Ada/Hopper cards, float16 for 20-series GPUs. Output is a single MODEL. The idea, per the README, is literally "replace your UNET/loader node with this one and go."

    Wiring it with LoRA

    Klein LoRA support exists but it's a two-node job: this loader plus the pack's Magic Power LoRA Loader with Klein mode enabled in its settings. The LoRA path goes through nunchaku's native API so it modifies the quantized weights directly rather than un-quantizing anything. Not your workflow's bottleneck? Skip it.

    Gotchas

    • ComfyUI 0.29.0+ required. The V1.4.0 update migrated this node to the new CoreModelPatcher and load_device/offload_device APIs. On an older ComfyUI it will not work, and the changelog is explicit about it.
    • The environment embedding is not optional. First time, and after a pack update, re-run Settings → Embed to Environment. The changelog has fixed this embedding path more than once, so when Klein fails to load, "re-embed" is step one of every real fix.
    • Pick the right variant. The community consensus on Klein in mid-2026: 9B over the KV variant for quality unless your GPU is old, and 4B when VRAM is the wall. All three share the same environment files, so switching variants doesn't mean re-embedding.

    Installing

    It's part of the Magic-Assistant pack:

    cd ComfyUI/custom_nodes/
    git clone https://github.com/shigjfg/ComfyUI-Magic-Assistant.git
    cd ComfyUI-Magic-Assistant && pip install -r requirements.txt
    

    Restart ComfyUI, upgrade to 0.29.0+ if you're behind, download a tonera safetensors into models/diffusion_models/, and hit the ⚙️ settings button before your first run. That order matters.

    Category✨ Magic Assistant

    Inputs (3)

    NameTypeDefaultDescription
    model_nameCOMBONunchaku FLUX.2 Klein model (.safetensors)
    device_idINT00–0GPU device ID
    data_typeCOMBObfloat16bfloat16 for Ada/Hopper+; use float16 for 20-series GPUs

    Outputs (1)

    NameTypeDescription
    MODELMODEL