PRISM-Q-Qwen-Image-2.1-Turbo

916 downloads 2 likes on Hugging Face updated

Model card

PRISM-Q · Qwen-Image 2.1 Turbo

Quantized versions of the Qwen-Image 2.1 Turbo diffusion model for ComfyUI. Built with Qwen; for non-commercial use only (see License). The files run on ComfyUI's own int8 ConvRot kernels and load with the stock Load Diffusion Model node.

Fidelity vs file size

File Size Fidelity Seconds / image Peak VRAM Needs the node
prism_q_qwen_image_2.1_turbo_compact.safetensors 4.23 GB 60.5 2.01 4.6 GiB yes
prism_q_qwen_image_2.1_turbo_balanced.safetensors 5.15 GB 81.4 1.99 5.5 GiB yes
prism_q_qwen_image_2.1_turbo_int8.safetensors 7.26 GB 106.4 1.91 7.4 GiB no

Fidelity is a composite of LPIPS, PSNR, SSIM and Pearson against BF16 images, where ComfyUI's official int8 ConvRot file scores 100 (see Method). Timing is one 1024 × 1024 image with 8 steps on an A100 40 GB, denoiser only.

  • compact is more faithful than GGUF Q5_K_M while being 1.2 GB smaller, and 2.4× as faithful as GGUF Q4_K_M or ComfyUI's W4A8 at the same 4.2 GB.
  • balanced is more faithful than GGUF Q6_K while being 1.1 GB smaller.
  • int8 is the same size and format as ComfyUI's official int8 ConvRot file, with better rounding. It loads in stock ComfyUI without the node.

Use

  1. Install the loader (compact and balanced only):
    cd ComfyUI/custom_nodes
    git clone https://github.com/Nif00/PRISM-Q.git
    
    Restart ComfyUI. Nothing needs to be pip-installed or compiled.
  2. Put the file in ComfyUI/models/diffusion_models/.
  3. In your Qwen-Image 2.1 workflow, select it in Load Diffusion Model. Use the same text encoder, VAE, sampler and LoRAs as with Comfy-Org/Qwen-Image-2.1.

You need an NVIDIA GPU with INT8 tensor cores (Turing or newer) and a ComfyUI version that runs the official int8 ConvRot checkpoint.

Quality

Each metric vs BF16

All files are compared with BF16 images made from the same prompts and seeds.

File Size GB Fidelity LPIPS ↓ PSNR dB ↑ SSIM ↑ Pearson ↑ Denoiser error ↓
GGUF Q8_0 7.64 137.3 0.0209 31.99 0.9694 0.9862 1.11e-4
PRISM-Q int8 7.26 106.4 0.0289 30.50 0.9629 0.9838 1.94e-4
ComfyUI int8 ConvRot 7.26 100.0 0.0296 30.15 0.9593 0.9830 2.22e-4
PRISM-Q balanced 5.15 81.4 0.0358 29.38 0.9531 0.9767 2.93e-4
GGUF Q6_K 6.27 79.4 0.0362 28.98 0.9521 0.9772 2.20e-4
PRISM-Q compact 4.23 60.5 0.0462 27.22 0.9401 0.9719 4.62e-4
GGUF Q5_K_M 5.39 57.5 0.0486 27.09 0.9380 0.9691 4.78e-4
GGUF Q5_K_S 4.50 28.5 0.0915 23.09 0.8890 0.9394 1.50e-3
GGUF Q4_K_M 4.20 25.1 0.1034 22.26 0.8763 0.9348 2.29e-3
ComfyUI W4A8 4.20 23.5 0.1157 22.06 0.8685 0.9318 3.13e-3
GGUF Q4_K_S 3.91 19.6 0.1321 21.21 0.8488 0.9110 3.87e-3

GGUF Q8_0 is more faithful than every PRISM-Q file, but it is 5% larger than int8 and takes 1.67× as long per image on an A100:

Fidelity vs speed

On an A100 every GGUF file takes about 3.2 s, whatever its size: slower than unquantized BF16 (2.62 s). Every PRISM-Q file runs within 5% of ComfyUI's int8 ConvRot.

Speed

Seconds per image

File Seconds / image vs int8 ConvRot Peak VRAM GiB
PRISM-Q int8 1.913 1.00× 7.40
ComfyUI int8 ConvRot 1.917 1.00× 7.40
PRISM-Q balanced 1.988 1.04× 5.48
PRISM-Q compact 2.008 1.05× 4.63
ComfyUI W4A8 2.142 1.12× 4.74
BF16 2.62 1.37× 13.94
GGUF Q6_K 3.184 1.66× 6.68
GGUF Q8_0 3.197 1.67× 7.96
GGUF Q4_K_S 3.220 1.68× 4.48
GGUF Q4_K_M 3.234 1.69× 4.75
GGUF Q5_K_M 3.241 1.69× 5.86
GGUF Q5_K_S 3.242 1.69× 5.03

The figures are the mean of 8 images at 1024 × 1024 with 8 steps, after a warm-up, on an A100 40 GB using PyTorch attention. Only the denoiser is timed. GGUF ran through ComfyUI-GGUF. Peak VRAM is for the denoiser in that run.

How it works

PRISM-Q quantizes every linear layer of the diffusion transformer to the int8 weights that ComfyUI's ConvRot path multiplies with. The compact and balanced files store most of those weights as a QTIP-style trellis bitstream: 16×16 tiles at 4 or 5 bits per weight, with one scale level per tile. A few sensitive layers stay int8 or BF16.

At run time the node keeps the bitstream in VRAM. Before each layer runs, a CUDA kernel decodes it into a temporary int8 weight. On an A100, decoding takes about 90 ms of GPU time per compact image, or 4 to 5% of the run. The int8 weight then goes through the same comfy_kitchen int8 ConvRot call as the official checkpoint. Decoding is integer-exact, so a trellis file produces bit-identical images to the int8 file it was packed from.

File Linear bits per weight Layers
compact 4.54 96 at 5 bits, 96 at 4 bits
balanced 5.59 156 at 5 bits, 36 int8
int8 8 plain int8 ConvRot, no node needed

LoRAs work. In the compact and balanced files a plain LoRA runs as a low-rank branch next to each layer, so the file keeps its size in VRAM (a rank-32 LoRA on every linear: +0.2 GiB, 10 to 15% slower on an RTX 3060 Ti). DoRA, LoHa and LoKr fall back to plain int8 per patched layer, as on the official int8 checkpoint, and need --disable-dynamic-vram. This needs node pack 1.1.0 or later (git pull in custom_nodes/PRISM-Q).

Method

  • Reference: BF16 Qwen-Image 2.1 Turbo, with the same prompt, seed and sampler for every file. 42 held-out prompts at 1024 × 1024, 8 steps.
  • Fidelity index: each metric is turned into an error (LPIPS, mean squared error from PSNR, 1 − SSIM, 1 − Pearson). The index is 100 × the geometric mean, over the four errors, of ConvRot's error divided by the file's error. 100 means as faithful as ComfyUI's int8 ConvRot; 200 would mean half the error.
  • Denoiser error: the relative error of one forced denoising step against BF16, averaged over the same prompts.
  • Size: the size of the denoiser file on disk. GGUF sizes are computed from their measured bits per weight.

Files and checksums

e9f3975c1e7cee7109ba0282408ac26518447d0b15ed79adccc5137e21279696  prism_q_qwen_image_2.1_turbo_compact.safetensors
0e6e127fd6a98864d401f5b05b97ec5f15c06fc88bc68dcf029188f7431bfd2c  prism_q_qwen_image_2.1_turbo_balanced.safetensors
b56c45c7960fa9c010e643720c4c6c059be0909d1bdddd37874b5ad8fc5c7c04  prism_q_qwen_image_2.1_turbo_int8.safetensors

License

These files are derived from Qwen-Image 2.1 Turbo, which is released under the Qwen Research License Agreement: you may use, modify and share them for non-commercial (research or evaluation) purposes only. Commercial use needs a separate license from Qwen. The full agreement is in LICENSE and the required attribution in NOTICE.

The weights in this repository were modified from the original: every linear layer of the diffusion model was quantized by PRISM-Q, and each file's header says so. Qwen is a trademark of its owner; this project is not affiliated with or endorsed by Qwen.