Can't get right output image, pls help.
ENV: Ubuntu 24.04, RTX 4090 24GB, Python 3.12, CUDA 12.8, Torch 2.80, list as below:
Package Version
accelerate 1.12.0
diffusers 0.36.0.dev0
numpy 2.3.5
nvidia-cuda-runtime-cu12 12.8.90
nvidia-cudnn-cu12 9.10.2.21
pillow 12.0.0
safetensors 0.7.0
sdnq 0.1.2
torch 2.8.0+cu128
torchaudio 2.8.0+cu128
torchvision 0.23.0+cu128
transformers 4.57.3
triton 3.4.0
hf download Disty0/Z-Image-Turbo-SDNQ-uint4-svd-r32 --local-dir sdnq/Z-Image-Turbo-SDNQ-uint4-svd-r32
copy the demo script and run:
cat Test-sdnq-Z-Image.py
import torch
import diffusers
from sdnq import SDNQConfig # import sdnq to register it into diffusers and transformers
pipe = diffusers.ZImagePipeline.from_pretrained("sdnq/Z-Image-Turbo-SDNQ-uint4-svd-r32", torch_dtype=torch.bfloat16).to('cuda')
pipe.enable_model_cpu_offload()
prompt = "Young Chinese woman in red Hanfu, intricate embroidery. Impeccable makeup, red floral forehead pattern. Elaborate high bun, golden phoenix headdress, red flowers, beads. Holds round folding fan with lady, trees, bird. Neon lightning-bolt lamp (โก๏ธ), bright yellow glow, above extended left palm. Soft-lit outdoor night background, silhouetted tiered pagoda (่ฅฟๅฎๅคง้ๅก), blurred colorful distant lights."
image = pipe(
prompt=prompt,
height=1920,
width=1216,
num_inference_steps=9,
guidance_scale=0.0,
generator=torch.manual_seed(42),
).images[0]
image.save("z-image-turbo-sdnq-uint4-svd-r32.png")
log as below:
(py12) adm@ubuntu2404:~/models$ python Test-sdnq-Z-Image.py
Loading pipeline components...: 80%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | 4/5 [00:02<00:00, 1.82it/s]torch_dtype is deprecated! Use dtype instead!
Loading pipeline components...: 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 5/5 [00:03<00:00, 1.40it/s]
100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 9/9 [00:18<00:00, 2.06s/it]
(py12) adm@ubuntu2404:~/models$ ll
total 1496
drwxrwxr-x 4 adm adm 4096 Dec 2 10:07 ./
drwxrwxr-x 67 adm adm 4096 Nov 25 07:23 ../
-rw-rw-r-- 1 adm adm 923 Dec 1 21:04 Test-sdnq-Z-Image.py
drwxrwxr-x 3 adm adm 4096 Dec 1 11:24 sdnq/
-rw-rw-r-- 1 adm adm 1509365 Dec 2 10:07 z-image-turbo-sdnq-uint4-svd-r32.png
the image as below:
No any error, but I don't know what happened.
Does this happen now? New transformers broke the tokenizer so i had to push a generic version that works with both old and new transformers.
I delete the old model and download it from modelscope https://www.modelscope.cn/models/Disty0/Z-Image-Turbo-SDNQ-uint4-svd-r32, it's run normally, haha...๐คฃ๐คฃ๐คฃ, Thanks a lot!




