Text-to-Image
Diffusers
Safetensors
image-to-image
quantization
w4a4
svdquant
gptq
nunchaku
8-bit precision
Instructions to use ModelsLab/Qwen-Image-2.1-W4A4-nvfp4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use ModelsLab/Qwen-Image-2.1-W4A4-nvfp4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("ModelsLab/Qwen-Image-2.1-W4A4-nvfp4", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
| { | |
| "model": "Qwen/Qwen-Image-2.1", | |
| "rank": 128, | |
| "alpha": 0.5, | |
| "gptq": true, | |
| "scheme": "nvfp4", | |
| "stages": { | |
| "grid_check": { | |
| "max_delta": 0.0, | |
| "idempotent": true | |
| }, | |
| "channel_stats": { | |
| "layers": 224, | |
| "seconds": 255.1 | |
| }, | |
| "input_groups": { | |
| "groups": 128, | |
| "shared_groups": 64, | |
| "example": [ | |
| "transformer_blocks.0.attn.to_k", | |
| "transformer_blocks.0.attn.to_q", | |
| "transformer_blocks.0.attn.to_v" | |
| ] | |
| }, | |
| "hessians": { | |
| "seconds": 301.0, | |
| "token_sample": 512 | |
| }, | |
| "convert": { | |
| "layers": 224, | |
| "seconds": 29.4 | |
| }, | |
| "gptq": { | |
| "sampled": 7, | |
| "beat_rtn": 0, | |
| "clipped": [], | |
| "layers": [ | |
| { | |
| "layer": "transformer_blocks.0.attn.to_k", | |
| "method": "gptq", | |
| "precision": "nvfp4", | |
| "dead_channels": 0, | |
| "max_drift": 1.003, | |
| "headroom": 4.0, | |
| "clipped": false, | |
| "gptq_weight_error": 0.1028, | |
| "rtn_weight_error": 0.090812 | |
| }, | |
| { | |
| "layer": "transformer_blocks.12.img_mlp.gate_layer", | |
| "method": "gptq", | |
| "precision": "nvfp4", | |
| "dead_channels": 0, | |
| "max_drift": 1.005, | |
| "headroom": 4.0, | |
| "clipped": false, | |
| "gptq_weight_error": 0.11541, | |
| "rtn_weight_error": 0.091255 | |
| }, | |
| { | |
| "layer": "transformer_blocks.17.attn.to_out.0", | |
| "method": "gptq", | |
| "precision": "nvfp4", | |
| "dead_channels": 0, | |
| "max_drift": 1.008, | |
| "headroom": 4.0, | |
| "clipped": false, | |
| "gptq_weight_error": 0.115752, | |
| "rtn_weight_error": 0.089775 | |
| }, | |
| { | |
| "layer": "transformer_blocks.20.img_mlp.out", | |
| "method": "gptq", | |
| "precision": "nvfp4", | |
| "dead_channels": 0, | |
| "max_drift": 1.058, | |
| "headroom": 4.0, | |
| "clipped": false, | |
| "gptq_weight_error": 0.12402, | |
| "rtn_weight_error": 0.091923 | |
| }, | |
| { | |
| "layer": "transformer_blocks.25.attn.to_q", | |
| "method": "gptq", | |
| "precision": "nvfp4", | |
| "dead_channels": 0, | |
| "max_drift": 1.0, | |
| "headroom": 4.0, | |
| "clipped": false, | |
| "gptq_weight_error": 0.11951, | |
| "rtn_weight_error": 0.09088 | |
| }, | |
| { | |
| "layer": "transformer_blocks.29.img_mlp.proj", | |
| "method": "gptq", | |
| "precision": "nvfp4", | |
| "dead_channels": 0, | |
| "max_drift": 1.009, | |
| "headroom": 4.0, | |
| "clipped": false, | |
| "gptq_weight_error": 0.116958, | |
| "rtn_weight_error": 0.091441 | |
| }, | |
| { | |
| "layer": "transformer_blocks.5.attn.to_v", | |
| "method": "gptq", | |
| "precision": "nvfp4", | |
| "dead_channels": 0, | |
| "max_drift": 1.016, | |
| "headroom": 4.0, | |
| "clipped": false, | |
| "gptq_weight_error": 0.127083, | |
| "rtn_weight_error": 0.091807 | |
| } | |
| ] | |
| }, | |
| "residual_quantize": { | |
| "layers": 0, | |
| "seconds": 0.0, | |
| "resident_gb": 21.55 | |
| }, | |
| "save": { | |
| "path": "/workspace/ckpt-nvfp4", | |
| "layers": 224, | |
| "bytes": 4876360488, | |
| "gb": 4.54 | |
| } | |
| }, | |
| "calibration_set": { | |
| "total": 30, | |
| "text_to_image": 20, | |
| "with_negative_prompt": 2, | |
| "edits": 10, | |
| "reference_images_total": 19, | |
| "max_references": 5, | |
| "sizes": [ | |
| [ | |
| 768, | |
| 1344 | |
| ], | |
| [ | |
| 832, | |
| 1216 | |
| ], | |
| [ | |
| 1024, | |
| 1024 | |
| ], | |
| [ | |
| 1216, | |
| 832 | |
| ], | |
| [ | |
| 1344, | |
| 768 | |
| ] | |
| ], | |
| "estimated_seconds": 465 | |
| }, | |
| "reference_images": 8 | |
| } |