---
title: "Bringing Nunchaku 4-bit Diffusion Inference to Diffusers"
description: "Diffusers can now load SVDQuant/Nunchaku 4-bit (W4A4) diffusion checkpoints natively via from_pretrained(), with CUDA kernels fetched from the Hub through the kernels package instead of compiled locally."
url: "https://swe.quest/articles/bringing-nunchaku-4-bit-diffusion-inference-to-diffusers-c0f307e158fa29ca"
canonical: "https://huggingface.co/blog/nunchaku-diffusers"
source: "Hugging Face"
published: "2026-07-23"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 11
tags: ["inference","performance","python","hardware"]
---

# Bringing Nunchaku 4-bit Diffusion Inference to Diffusers

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2026-07-23, 11 min read, Deep dive. Original: [https://huggingface.co/blog/nunchaku-diffusers](https://huggingface.co/blog/nunchaku-diffusers)

## Summary

Diffusers can now load SVDQuant/Nunchaku 4-bit (W4A4) diffusion checkpoints natively via from\_pretrained(), with CUDA kernels fetched from the Hub through the kernels package instead of compiled locally. Nunchaku Lite patches stock nn.Linear modules with SVDQ W4A4 layers for attention/MLP projections and AWQ W4A16 layers for modulation layers. Because it skips architecture-specific fused kernels, it is slower than the original Nunchaku engine. On an RTX PRO 6000 it still gives about a 1.35x speedup and up to 50% lower peak VRAM versus BF16, rising to 1.8x with torch.compile. The companion diffuse-compressor toolkit calibrates, quantizes, packages and publishes new models, and model-specific adapters handle structural rewrites such as fused QKV.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Python](https://swe.quest/tags/python.md) (Languages)
- [Hardware](https://swe.quest/tags/hardware.md) (Infrastructure)

## Prerequisites

- diffusion transformers
- model quantization basics ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))
- PyTorch nn.Linear
- CUDA GPU generations ([easy posts on Hardware](https://swe.quest/tags/hardware.md?difficulty=easy))

## Keywords

SVDQuant, Nunchaku, Diffusers, NVFP4, AWQ, bitsandbytes, torch.compile, FLUX.2

## Related posts

- [Exploring Quantization Backends in Diffusers](https://swe.quest/articles/exploring-quantization-backends-in-diffusers-11e0d1ba0cf15851.md): Hugging Face · 2025-05-21 · Medium · 11 min read · Inference & serving, Computer vision, Python, Performance engineering
  Hugging Face Diffusers supports several quantization backends (bitsandbytes, torchao, Quanto, GGUF and native FP8 layerwise casting) that shrink large diffusion models such as Flux-dev, whose full BF16 pipeline needs about 31 GB.
- [Diffusers welcomes Stable Diffusion 3.5 Large](https://swe.quest/articles/diffusers-welcomes-stable-diffusion-3-5-large-23c0b39797ac94ee.md): Hugging Face · 2024-10-22 · Medium · 6 min read · Computer vision, Inference & serving, Model training, Python
  Stable Diffusion 3.5 Large (8B) and a timestep-distilled Turbo variant are now usable in Diffusers.
- [Memory-efficient Diffusion Transformers with Quanto and Diffusers](https://swe.quest/articles/memory-efficient-diffusion-transformers-with-quanto-and-diffusers-3c257e9814771482.md): Hugging Face · 2024-07-30 · Medium · 9 min read · Inference & serving, Computer vision, Performance engineering, Python
  Weight quantization with Quanto cuts the GPU memory of Transformer-based diffusion pipelines (PixArt-Sigma, Stable Diffusion 3, Aura Flow) with little quality loss and a modest latency cost.
- [(LoRA) Fine-Tuning FLUX.1-dev on Consumer Hardware](https://swe.quest/articles/lora-fine-tuning-flux-1-dev-on-consumer-hardware-310a6094e7391e33.md): Hugging Face · 2025-06-19 · Hard · 11 min read · Model training, Computer vision, Python
  FLUX.1-dev can be LoRA fine-tuned on a single consumer GPU by combining QLoRA (4-bit NF4 base transformer via bitsandbytes), 8-bit AdamW, gradient checkpointing, cached VAE latents and precomputed CLIP/T5 text embeddings, so that only the quantized transformer plus adapters sit in GPU memory.
- [State of open video generation models in Diffusers](https://swe.quest/articles/state-of-open-video-generation-models-in-diffusers-9770186e8fdb5a0a.md): Hugging Face · 2025-01-27 · Medium · 16 min read · Inference & serving, Computer vision, Video & media, Performance engineering, Model training
  Open video generation models such as HunyuanVideo, CogVideoX, LTX-Video, Mochi-1 and Allegro share a common architecture: T5-style text encoders, a DiT-based denoiser over 3D spatio-temporal tokens, a spatially and temporally compressing VAE, and a scheduler.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
