Run this model with HF Jobs

Run tonera/Qwen-Image-2.1-Nunchaku on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/tonera/Qwen-Image-2.1-Nunchaku. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/tonera/Qwen-Image-2.1-Nunchaku on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Qwen-Image-2.1-Nunchaku

Language: English | 中文

9.20 GiB less after load (46.4%) · text-to-image 2.69× faster · editing 2.19× faster

FP4 on an RTX 5090, compared with the BF16 transformer.

4-bit weight-and-activation quantization of the Qwen-Image-2.1 transformer, rank 32, for inference with Nunchaku. The repo has two checkpoints: FP4 for Blackwell (50-series) and INT4 for 30- and 40-series GPUs. The VAE stays in BF16. Diffusers components are included, so the repo loads as a pipeline.

Model

  • This repo: tonera/Qwen-Image-2.1-Nunchaku
  • FP4 transformer (Blackwell / 50-series): svdq-fp4_r32-Qwen-Image-2.1-Nunchaku.safetensors
  • INT4 transformer (30- and 40-series): svdq-int4_r32-Qwen-Image-2.1-Nunchaku.safetensors
  • Upstream: Qwen/Qwen-Image-2.1

Qwen-Image-2.1 is a unified text-to-image and image-editing model from Qwen. The visual generator is about 7B parameters, a 32-layer single-stream DiT. The same weights do text-to-image, reference-image editing, and transparent (RGBA) output. The official example uses 40 steps, true_cfg_scale=1, and prefix KV cache.

Samples

A blonde girl holds a wooden sign in her hand, which reads::CreatePPTX.com

BF16 FP4
BF16 FP4

Performance

1024×1024, true_cfg_scale=1, 30 steps, prefix KV cache on, CPU offload off, dtype bfloat16. BF16 and FP4 share the same INT4 text encoder, svdq-int4-Qwen3-VL-8B-Instruct-Nunchaku.safetensors. Measured on an RTX 5090.

Text-to-image

BF16 FP4
Load 9.549s 5.523s 1.73×
Cold inference 11.143s 4.273s 2.61×
Steady inference 10.973s 4.085s 2.69×

Image editing

The condition image is the BF16 sample above. Prompt: Turn the girl's hair black. Other settings match text-to-image.

BF16 FP4
Load 5.366s 4.579s 1.17×
Cold inference 13.349s 6.206s 2.15×
Steady inference 13.043s 5.964s 2.19×

Memory

BF16 FP4 Saved
Allocated after load 19.83 GiB 10.63 GiB 9.20 GiB (46.4%)
Reserved after load 19.89 GiB 10.68 GiB 9.22 GiB (46.3%)
Text-to-image peak allocated 26.44 GiB 17.23 GiB 9.22 GiB (34.8%)
Text-to-image peak reserved 27.92 GiB 18.46 GiB 9.46 GiB (33.9%)
Edit peak allocated 28.45 GiB 17.24 GiB 11.21 GiB (39.4%)
Edit peak reserved 30.47 GiB 18.46 GiB 12.01 GiB (39.4%)

Quality

Same FP4 run on an RTX 5090, 25 images each, compared with the BF16 transformer under the same settings. Higher PSNR and SSIM are closer. Lower LPIPS is closer. p90 is the 90th percentile of that metric.

Task Metric Mean p50 p90 Best Worst
Text-to-image PSNR ↑ 22.54 22.03 27.32 29.34 13.99
Text-to-image SSIM ↑ 0.877 0.896 0.964 0.974 0.599
Text-to-image LPIPS ↓ 0.164 0.162 0.299 0.041 0.435
Image editing PSNR ↑ 19.94 20.15 24.05 27.64 14.19
Image editing SSIM ↑ 0.752 0.764 0.890 0.918 0.527
Image editing LPIPS ↓ 0.147 0.113 0.281 0.040 0.348

Use in ComfyUI

Install the Vitoom Nunchaku plugin. ComfyUI 0.44 or newer is required, started with --enable-manager. Installing the plugin also installs a matching nunchaku wheel.

  1. Open ComfyUI and click Manage Extensions in the top-right corner.
  2. Search for Vitoom Nunchaku and click Install.
  3. Restart ComfyUI.

Place this repository's transformer in ComfyUI/models/diffusion_models: svdq-fp4_r32-Qwen-Image-2.1-Nunchaku.safetensors for RTX 50 series, svdq-int4_r32-Qwen-Image-2.1-Nunchaku.safetensors for RTX 30 and 40 series. Place the text encoder svdq-int4-Qwen3-VL-8B-Instruct-Nunchaku.safetensors in ~/weights or ComfyUI/models/text_encoders. Place the VAE qwen_image_2.1_vae_bf16.safetensors in ComfyUI/models/vae.

Drag example_workflows/qwen_image21.json from the plugin onto the canvas, or open it from the workflow templates. Connect Vitoom Nunchaku DiT Loader to KSampler, and Vitoom Nunchaku Text Encoder to TextEncodeQwenImage21. For editing, connect the reference image to the encode node's image_1 and write <image1> in the prompt. For LoRA, open example_workflows/qwen_image21_lora.json. The example KSampler uses 25 steps; the numbers in this card use 30 steps and CFG 1.

Use in Python

Installation

Nunchaku must provide NunchakuQwenImage21Transformer2DModel, and Diffusers must provide QwenImage21Pipeline (after 2026-09-18, including PR #14804). Prebuilt wheels are in tonera/vitoom-nunchaku.

pip install "git+https://github.com/huggingface/diffusers.git"

python -m pip uninstall -y torch torchvision torchaudio nunchaku
python -m pip install "torch==2.14.*" "torchvision==0.29.*" --index-url https://download.pytorch.org/whl/cu130

# Pick the wheel that matches your Python, CUDA, and PyTorch from tonera/vitoom-nunchaku
hf download tonera/vitoom-nunchaku \
  nunchaku-1.4.0+cu13.0torch2.14-cp311-cp311-linux_x86_64.whl \
  --local-dir ./wheels

python -m pip install ./wheels/nunchaku-1.4.0+cu13.0torch2.14-cp311-cp311-linux_x86_64.whl

Usage

import torch
from diffusers import QwenImage21Pipeline
from PIL import Image
from nunchaku import NunchakuQwenImage21Transformer2DModel
from nunchaku.utils import get_precision

REPO = "tonera/Qwen-Image-2.1-Nunchaku"
NAME = "Qwen-Image-2.1-Nunchaku"

transformer = NunchakuQwenImage21Transformer2DModel.from_pretrained(
    f"{REPO}/svdq-{get_precision()}_r32-{NAME}.safetensors",
    torch_dtype=torch.bfloat16,
    device="cuda",
)
pipe = QwenImage21Pipeline.from_pretrained(
    REPO,
    transformer=transformer,
    torch_dtype=torch.bfloat16,
)
pipe.to("cuda")

image = pipe(
    prompt="A blonde girl holds a wooden sign in her hand, which reads::CreatePPTX.com",
    width=1024,
    height=1024,
    num_inference_steps=30,
    true_cfg_scale=1.0,
    use_kv_cache=True,
    generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]
image.save("qwen21-w4a4.png")

ref = Image.open("input.png").convert("RGB")
edited = pipe(
    prompt="Turn the girl's hair black",
    image=ref,
    width=1024,
    height=1024,
    num_inference_steps=30,
    true_cfg_scale=1.0,
    use_kv_cache=True,
    generator=torch.Generator(device="cuda").manual_seed(42),
).images[0]
edited.save("qwen21-edit-w4a4.png")

Acknowledgments

License

These quantized weights are derived from Qwen/Qwen-Image-2.1 and follow the Qwen Research License. license: other in the model-card metadata is only a placeholder for the Hugging Face license field. The license linked above is what applies.

Downloads last month
725
Safetensors
Model size
7B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for tonera/Qwen-Image-2.1-Nunchaku

Quantized
(192)
this model

Collection including tonera/Qwen-Image-2.1-Nunchaku