Downloads · 30 days
478
19% of all-time downloads
stuqiu/nunchaku-qwen-image-edit-2511
nunchaku-qwen-image-edit-2511 is a image-to-image model from stuqiu. Use it when you need one image transformed into another. It is set up for diffusers. The card lists the license as apache-2.0.
4-bit SVDQuant of Qwen/Qwen-Image-Edit-2511 for the nunchaku inference engine. Same file layout and usage as the official nunchaku-tech/nunchaku-qwen-image-edit
Downloads · 30 days
478
19% of all-time downloads
All-time downloads
2.5K
Public
Repo size
25.1 GB
Likes
1
Public
Click a slice to open those files.
.safetensors25 GB · 100%
From the Hugging Face model README
4-bit SVDQuant of Qwen/Qwen-Image-Edit-2511 for the
nunchaku inference engine. Same file layout and usage
as the official nunchaku-tech/nunchaku-qwen-image-edit
release — load it with stock from_pretrained (one small forward shim is needed for the edit pipeline, see Usage).
| Data Type | Rank | Model Name | Comment |
|---|---|---|---|
| NVFP4 | r32 | svdq-fp4_r32-qwen-image-edit-2511.safetensors | ~11 GB · smaller / faster · default |
| r128 | svdq-fp4_r128-qwen-image-edit-2511.safetensors | ~13 GB · higher low-rank fidelity |
Both checkpoints are W4A4 NVFP4 and differ only in the SVDQuant low-rank branch size; on real edits they are visually equivalent. NVFP4 needs a Blackwell GPU (RTX 50-series sm_120 / GB10 sm_121); INT4 builds are not provided yet.
import torch
from diffusers import QwenImageEditPlusPipeline
from diffusers.utils import load_image
from nunchaku.models.transformers.transformer_qwenimage import NunchakuQwenImageTransformer2DModel
from nunchaku.utils import get_precision
rank = 32 # 32 (smaller/faster) or 128 (higher fidelity)
transformer = NunchakuQwenImageTransformer2DModel.from_pretrained(
f"stuqiu/nunchaku-qwen-image-edit-2511/svdq-{get_precision()}_r{rank}-qwen-image-edit-2511.safetensors"
)
# nunchaku is currently only lightly maintained and its API lags behind diffusers: its forward still
# expects the (now deprecated) `txt_seq_lens`, which QwenImageEditPlusPipeline in diffusers >= 0.37 no
# longer passes (it switched to `max_txt_seq_len`). We back-fill it with the exact value diffusers
# itself used to compute (`mask.sum(-1)`), so the output is unchanged — no other side effect.
_orig = transformer.forward
def _forward(*a, **k):
if k.get("txt_seq_lens") is None and k.get("encoder_hidden_states_mask") is not None:
k["txt_seq_lens"] = k["encoder_hidden_states_mask"].sum(-1).tolist()
return _orig(*a, **k)
transformer.forward = _forward
pipe = QwenImageEditPlusPipeline.from_pretrained(
"Qwen/Qwen-Image-Edit-2511", transformer=transformer, torch_dtype=torch.bfloat16
).to("cuda")
image = load_image("input.png").convert("RGB")
out = pipe(
image=image,
prompt="把天空换成绚丽的黄昏晚霞",
num_inference_steps=40, true_cfg_scale=4.0, negative_prompt=" ",
).images[0]
out.save("edit.png")
Tested with diffusers==0.38.0, nunchaku==1.3.0.dev (cu13 / torch2.13), torch==2.13.
1024×1024 edit, 40 steps, true_cfg 4.0, stock pipeline:
| Hardware | Precision | per-step | speedup | weights |
|---|---|---|---|---|
| DGX Spark GB10 (sm_121) | this model (W4A4) | 4.82 s | 1.48× | 11–13 GB |
| DGX Spark GB10 (sm_121) | BF16 | 7.14 s | 1.0× | ~40 GB |
Real photos, identical seed/params, only the transformer differs (BF16 vs this W4A4 model). Columns: input · BF16 · nunchaku r32 · nunchaku r128.
| Prompt | Input | BF16 | r32 | r128 |
|---|---|---|---|---|
把天空换成绚丽的黄昏晚霞 | ![]() | ![]() | ![]() | ![]() |
在蛋糕上加几根点燃的生日蜡烛 | ![]() | ![]() | ![]() | ![]() |
在房间里挂满五彩生日派对气球和彩带 | ![]() | ![]() | ![]() | ![]() |
Make it a heavy snowfall winter scene | ![]() | ![]() | ![]() | ![]() |
Add a sunny-side-up fried egg on top of the rice | ![]() | ![]() | ![]() | ![]() |
Repaint the bus bright red | ![]() | ![]() | ![]() | ![]() |
On typical edits (sky / object / background / color / decoration) the quantized model is visually on par with BF16.
deepcompressor SVDQuant calibration (32 samples,
smoothing grid 20, rank-32 / rank-128 low-rank branches) for attention/MLP, official symmetric AWQ
recipe (scale = absmax/7, zero ≡ 7) for modulation, plus the temb super-channel fold so the
4-bit modulation stays accurate and the checkpoint loads fully self-contained.