Text-to-Image
Pruna AI
English
qwen
qwen-image
image-generation
image-editing
decoder-free
vae-free
dwd
Run this model with HF Jobs
Run PrunaAI/P-Q-Image-2.1-DWD 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/PrunaAI/P-Q-Image-2.1-DWD. 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/PrunaAI/P-Q-Image-2.1-DWD 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.
Instructions to use PrunaAI/P-Q-Image-2.1-DWD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Pruna AI
How to use PrunaAI/P-Q-Image-2.1-DWD with Pruna AI:
from pruna import PrunaModel model = PrunaModel.from_pretrained("PrunaAI/P-Q-Image-2.1-DWD") - Notebooks
- Google Colab
- Kaggle
fix: rename the model
Browse filesFiles changed (7)
1234567891011cff-version: 1.2.0message: "If you use this software or the released weights, please cite the DWD paper (the method) and this software. The code is Apache-2.0; the weights are under the Qwen RESEARCH LICENSE AGREEMENT."title: "P-Q-Image-2.1-Turbo-DWD: Decoding Without a Decoder for Qwen-Image-2.1-Turbo"type: softwareauthors:- name: "Pruna AI"license: Apache-2.0repository-code: "https://huggingface.co/PrunaAI/P-Q-Image-2.1-Turbo-DWD"version: 0.1.0keywords:- diffusion1234567891011cff-version: 1.2.0message: "If you use this software or the released weights, please cite the DWD paper (the method) and this software. The code is Apache-2.0; the weights are under the Qwen RESEARCH LICENSE AGREEMENT."title: "P-Q-Image-2.1-DWD: Decoding Without a Decoder for Qwen-Image-2.1-Turbo"type: softwareauthors:- name: "Pruna AI"license: Apache-2.0repository-code: "https://huggingface.co/PrunaAI/P-Q-Image-2.1-DWD"version: 0.1.0keywords:- diffusion
3 unmodified lines456789103 unmodified lines---P-Q-Image-2.1-Turbo-DWDCopyright 2026 Pruna AIdwd_tail.safetensors3 unmodified lines456789103 unmodified lines---P-Q-Image-2.1-DWDCopyright 2026 Pruna AIdwd_tail.safetensors
19 unmodified lines2021222324252620 unmodified lines4748495051525311 unmodified lines656667686970711 unmodified line7374757677787910 unmodified lines90919293949596974 unmodified lines10210310410510610710822 unmodified lines13113213313413513613772 unmodified lines2102112122132142152169 unmodified lines22622722822923023123256 unmodified lines28929029129229329429529629729829930030130217 unmodified lines32032132232332432532632732832933033133233333433533619 unmodified lines---<!-- header start --><p align="center"><img src="assets/P-Q-Image-2.1-Turbo-DWD.jpg" width="800"></p><!-- header end -->20 unmodified lines</p><div align="center"><h1 style="color: #9334E9;">⚡ P-Q-Image-2.1-Turbo-DWD</h1><h2>Qwen-Image-2.1-Turbo without the VAE decode</h2>11 unmodified lines**Built with Qwen.****P-Q-Image-2.1-Turbo-DWD** is a decoder-free pixel head for[`Qwen/Qwen-Image-2.1-Turbo`](https://huggingface.co/Qwen/Qwen-Image-2.1-Turbo). At the last of the model's 8sampling steps, a fine-tuned copy of the transformer's last 4 blocks and a small linear head write the image's pixelsdirectly, so the last Euler step and the VAE decode never run. Steps 1 to 7 are the stock model, unchanged. It is our1 unmodified line([arXiv 2611.22287](https://arxiv.org/abs/2611.22287)), on Qwen-Image-2.1-Turbo.This repository holds the weights and the `pq_image_dwd` Python package for text-to-image and image editing. ForComfyUI, see [PrunaAI/P-Q-Image-2.1-Turbo-DWD-Comfy](https://huggingface.co/PrunaAI/P-Q-Image-2.1-Turbo-DWD-Comfy).| | ||---|---|10 unmodified lines14.2 GB and text encoder 16.3 GB); the head adds 1.95 GB.```bashGIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/PrunaAI/P-Q-Image-2.1-Turbo-DWDcd P-Q-Image-2.1-Turbo-DWDpip install -e .```4 unmodified linesfrom PIL import Imagefrom pq_image_dwd import DWDPipelinepipe = DWDPipeline.from_pretrained("PrunaAI/P-Q-Image-2.1-Turbo-DWD") # base: Qwen/Qwen-Image-2.1-Turbo# Text-to-imageimage = pipe("a red fox standing in fresh snow at sunrise", width=2048, height=2048, seed=0)22 unmodified lines## ExamplesStock Qwen-Image-2.1-Turbo with its VAE decode next to P-Q-Image-2.1-Turbo-DWD, with the same prompt and seed. Panelsare downscaled; the PSNR in each caption compares the two full-size images. Prompts, sizes and seeds are in[assets/examples/examples.json](assets/examples/examples.json).72 unmodified lines[scripts/benchmark_latency.py](scripts/benchmark_latency.py); raw results in[assets/benchmark.json](assets/benchmark.json).| Mode | Resolution | With VAE decode | P-Q-Image-2.1-Turbo-DWD | Saved (95% CI) | Speedup ||---|---|---:|---:|---:|---:|| eager | 1024 × 1024 | 767 ms | 696 ms | 67 ms (58–80) | **1.10x** || eager | 2048 × 2048 | 3500 ms | 3213 ms | 282 ms (273–298) | **1.09x** |9 unmodified linesPeak activation memory during one text-to-image run (peak allocated minus the resident weights), same setup:| Mode | Resolution | With VAE decode | P-Q-Image-2.1-Turbo-DWD ||---|---|---:|---:|| eager | 1024 × 1024 | 7.06 GB | **0.69 GB** || eager | 2048 × 2048 | 28.19 GB | **2.71 GB** |56 unmodified lines- Not a faster transformer. All 8 steps still run through the transformer; the saving is mainly the VAE decode.- Not a VAE decoder for other models or for arbitrary latents.- Not a drop-in for the stock diffusers `QwenImage21Pipeline`; use `DWDPipeline` from this repository, or the[ComfyUI version](https://huggingface.co/PrunaAI/P-Q-Image-2.1-Turbo-DWD-Comfy), whose images are close to, butnot identical with, this package's.## LicenseThe end model is based on Qwen-Image-2.1-Turbo.P-Q-Image-2.1-Turbo-DWD is a derivative of Qwen-Image-2.1-Turbo and its weights (`dwd_tail.safetensors`) aredistributed under the **Qwen RESEARCH LICENSE AGREEMENT**, see [LICENSE](LICENSE) and [NOTICE](NOTICE). Review its userestrictions before using or redistributing the weights.17 unmodified lines}@software{pruna2026pqimagedwd,title = {P-Q-Image-2.1-Turbo-DWD: Decoding Without a Decoder for Qwen-Image-2.1-Turbo},author = {{Pruna AI}},year = {2026},version = {0.1.0},url = {https://huggingface.co/PrunaAI/P-Q-Image-2.1-Turbo-DWD}}```## What's next?- **Use P-Q-Image-2.1-Turbo-DWD to generate and edit images with Qwen-Image-2.1-Turbo without the VAE decode.**- Compress your own models with [Pruna](https://github.com/PrunaAI/pruna) and give us a ⭐️ for more efficiency!- Want to use our optimized image models right away? Check [P-Image-Ideogram](https://www.pruna.ai/p-image-ideogram) and [P-Image-Edit](https://www.pruna.ai/p-image-edit).19 unmodified lines2021222324252620 unmodified lines4748495051525311 unmodified lines656667686970711 unmodified line7374757677787910 unmodified lines90919293949596974 unmodified lines10210310410510610710822 unmodified lines13113213313413513613772 unmodified lines2102112122132142152169 unmodified lines22622722822923023123256 unmodified lines28929029129229329429529629729829930030130217 unmodified lines32032132232332432532632732832933033133233333433533619 unmodified lines---<!-- header start --><p align="center"><img src="assets/P-Q-Image-2.1-DWD.jpg" width="800"></p><!-- header end -->20 unmodified lines</p><div align="center"><h1 style="color: #9334E9;">⚡ P-Q-Image-2.1-DWD</h1><h2>Qwen-Image-2.1-Turbo without the VAE decode</h2>11 unmodified lines**Built with Qwen.****P-Q-Image-2.1-DWD** is a decoder-free pixel head for[`Qwen/Qwen-Image-2.1-Turbo`](https://huggingface.co/Qwen/Qwen-Image-2.1-Turbo). At the last of the model's 8sampling steps, a fine-tuned copy of the transformer's last 4 blocks and a small linear head write the image's pixelsdirectly, so the last Euler step and the VAE decode never run. Steps 1 to 7 are the stock model, unchanged. It is our1 unmodified line([arXiv 2611.22287](https://arxiv.org/abs/2611.22287)), on Qwen-Image-2.1-Turbo.This repository holds the weights and the `pq_image_dwd` Python package for text-to-image and image editing. ForComfyUI, see [PrunaAI/P-Q-Image-2.1-DWD-Comfy](https://huggingface.co/PrunaAI/P-Q-Image-2.1-DWD-Comfy).| | ||---|---|10 unmodified lines14.2 GB and text encoder 16.3 GB); the head adds 1.95 GB.```bashGIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/PrunaAI/P-Q-Image-2.1-DWDcd P-Q-Image-2.1-DWDpip install -e .```4 unmodified linesfrom PIL import Imagefrom pq_image_dwd import DWDPipelinepipe = DWDPipeline.from_pretrained("PrunaAI/P-Q-Image-2.1-DWD") # base: Qwen/Qwen-Image-2.1-Turbo# Text-to-imageimage = pipe("a red fox standing in fresh snow at sunrise", width=2048, height=2048, seed=0)22 unmodified lines## ExamplesStock Qwen-Image-2.1-Turbo with its VAE decode next to P-Q-Image-2.1-DWD, with the same prompt and seed. Panelsare downscaled; the PSNR in each caption compares the two full-size images. Prompts, sizes and seeds are in[assets/examples/examples.json](assets/examples/examples.json).72 unmodified lines[scripts/benchmark_latency.py](scripts/benchmark_latency.py); raw results in[assets/benchmark.json](assets/benchmark.json).| Mode | Resolution | With VAE decode | P-Q-Image-2.1-DWD | Saved (95% CI) | Speedup ||---|---|---:|---:|---:|---:|| eager | 1024 × 1024 | 767 ms | 696 ms | 67 ms (58–80) | **1.10x** || eager | 2048 × 2048 | 3500 ms | 3213 ms | 282 ms (273–298) | **1.09x** |9 unmodified linesPeak activation memory during one text-to-image run (peak allocated minus the resident weights), same setup:| Mode | Resolution | With VAE decode | P-Q-Image-2.1-DWD ||---|---|---:|---:|| eager | 1024 × 1024 | 7.06 GB | **0.69 GB** || eager | 2048 × 2048 | 28.19 GB | **2.71 GB** |56 unmodified lines- Not a faster transformer. All 8 steps still run through the transformer; the saving is mainly the VAE decode.- Not a VAE decoder for other models or for arbitrary latents.- Not a drop-in for the stock diffusers `QwenImage21Pipeline`; use `DWDPipeline` from this repository, or the[ComfyUI version](https://huggingface.co/PrunaAI/P-Q-Image-2.1-DWD-Comfy), whose images are close to, butnot identical with, this package's.## LicenseThe end model is based on Qwen-Image-2.1-Turbo.P-Q-Image-2.1-DWD is a derivative of Qwen-Image-2.1-Turbo and its weights (`dwd_tail.safetensors`) aredistributed under the **Qwen RESEARCH LICENSE AGREEMENT**, see [LICENSE](LICENSE) and [NOTICE](NOTICE). Review its userestrictions before using or redistributing the weights.17 unmodified lines}@software{pruna2026pqimagedwd,title = {P-Q-Image-2.1-DWD: Decoding Without a Decoder for Qwen-Image-2.1-Turbo},author = {{Pruna AI}},year = {2026},version = {0.1.0},url = {https://huggingface.co/PrunaAI/P-Q-Image-2.1-DWD}}```## What's next?- **Use P-Q-Image-2.1-DWD to generate and edit images with Qwen-Image-2.1-Turbo without the VAE decode.**- Compress your own models with [Pruna](https://github.com/PrunaAI/pruna) and give us a ⭐️ for more efficiency!- Want to use our optimized image models right away? Check [P-Image-Ideogram](https://www.pruna.ai/p-image-ideogram) and [P-Image-Edit](https://www.pruna.ai/p-image-edit).
69 unmodified lines70717273747576779 unmodified lines878889909192936 unmodified lines100101102103104105106122 unmodified lines22923023123223323423523623723823969 unmodified lines1.95 GB, and the VAE decoder (0.5 GB) is not needed.```bashgit clone https://huggingface.co/PrunaAI/P-Q-Image-2.1-Turbo-DWDcd P-Q-Image-2.1-Turbo-DWDpip install -e . # inferencepip install -e ".[dev]" # + tests```9 unmodified linespython scripts/generate.py --prompt "Add gently falling snow to the whole scene." --image photo.jpg --out snow.png````--tail` takes a Hugging Face repo id (default `PrunaAI/P-Q-Image-2.1-Turbo-DWD`), a `dwd_tail.safetensors` file, or adirectory holding it. The base model (`Qwen/Qwen-Image-2.1-Turbo`, override with `--base`) is downloaded on first use.Other options: `--width`, `--height`, `--seed`, `--output-resolution` (condition images are resized to about thissquared, default 1024), `--device`, `--compile`, and `--compare`, which also writes the stock pipeline's image for the6 unmodified linesfrom PIL import Imagefrom pq_image_dwd import DWDPipelinepipe = DWDPipeline.from_pretrained("PrunaAI/P-Q-Image-2.1-Turbo-DWD") # or a local file / directoryimage = pipe("a red fox in fresh snow at sunrise", width=2048, height=2048, seed=0)image.save("fox.png")122 unmodified lines```bibtex@software{pruna2026pqimagedwd,title = {P-Q-Image-2.1-Turbo-DWD: Decoding Without a Decoder for Qwen-Image-2.1-Turbo},author = {{Pruna AI}},year = {2026},version = {0.1.0},url = {https://huggingface.co/PrunaAI/P-Q-Image-2.1-Turbo-DWD}}```69 unmodified lines70717273747576779 unmodified lines878889909192936 unmodified lines100101102103104105106122 unmodified lines22923023123223323423523623723823969 unmodified lines1.95 GB, and the VAE decoder (0.5 GB) is not needed.```bashgit clone https://huggingface.co/PrunaAI/P-Q-Image-2.1-DWDcd P-Q-Image-2.1-DWDpip install -e . # inferencepip install -e ".[dev]" # + tests```9 unmodified linespython scripts/generate.py --prompt "Add gently falling snow to the whole scene." --image photo.jpg --out snow.png````--tail` takes a Hugging Face repo id (default `PrunaAI/P-Q-Image-2.1-DWD`), a `dwd_tail.safetensors` file, or adirectory holding it. The base model (`Qwen/Qwen-Image-2.1-Turbo`, override with `--base`) is downloaded on first use.Other options: `--width`, `--height`, `--seed`, `--output-resolution` (condition images are resized to about thissquared, default 1024), `--device`, `--compile`, and `--compare`, which also writes the stock pipeline's image for the6 unmodified linesfrom PIL import Imagefrom pq_image_dwd import DWDPipelinepipe = DWDPipeline.from_pretrained("PrunaAI/P-Q-Image-2.1-DWD") # or a local file / directoryimage = pipe("a red fox in fresh snow at sunrise", width=2048, height=2048, seed=0)image.save("fox.png")122 unmodified lines```bibtex@software{pruna2026pqimagedwd,title = {P-Q-Image-2.1-DWD: Decoding Without a Decoder for Qwen-Image-2.1-Turbo},author = {{Pruna AI}},year = {2026},version = {0.1.0},url = {https://huggingface.co/PrunaAI/P-Q-Image-2.1-DWD}}```
2 unmodified lines34567892 unmodified linesbuild-backend = "setuptools.build_meta"[project]name = "p-q-image-2-1-turbo-dwd"version = "0.1.0"description = "Decoding Without a Decoder (DWD) for Qwen-Image-2.1-Turbo: a pixel head that replaces the last step and the VAE decode"readme = "README.md"2 unmodified lines34567892 unmodified linesbuild-backend = "setuptools.build_meta"[project]name = "p-q-image-2-1-dwd"version = "0.1.0"description = "Decoding Without a Decoder (DWD) for Qwen-Image-2.1-Turbo: a pixel head that replaces the last step and the VAE decode"readme = "README.md"
9 unmodified lines1011121314151612 unmodified lines293031323334359 unmodified linesautocast. Width and height must be multiples of 32. No classifier-free guidance (the turbo model does not use it).Usage:pipe = DWDPipeline.from_pretrained("PrunaAI/P-Q-Image-2.1-Turbo-DWD")image = pipe("a red fox in fresh snow at sunrise", width=2048, height=2048, seed=0)edited = pipe("Add gently falling snow to the whole scene.", image=Image.open("in.jpg"), seed=0)"""12 unmodified linesfrom .model import Cond, DWDTail, check_grid, img_shapes, prefix_forward, target_img_maskfrom .weights import BASE_REPO, load_tailDEFAULT_TAIL = "PrunaAI/P-Q-Image-2.1-Turbo-DWD"# evaluated sizes (width, height): about 1 MP (the training size) and the model's 2K sizesSIZES_1MP = [(1024, 1024), (1152, 896), (896, 1152), (1344, 768), (768, 1344)]SIZES_2K = [(2048, 2048), (2528, 1696), (1696, 2528), (2752, 1536), (1536, 2752)]9 unmodified lines1011121314151612 unmodified lines293031323334359 unmodified linesautocast. Width and height must be multiples of 32. No classifier-free guidance (the turbo model does not use it).Usage:pipe = DWDPipeline.from_pretrained("PrunaAI/P-Q-Image-2.1-DWD")image = pipe("a red fox in fresh snow at sunrise", width=2048, height=2048, seed=0)edited = pipe("Add gently falling snow to the whole scene.", image=Image.open("in.jpg"), seed=0)"""12 unmodified linesfrom .model import Cond, DWDTail, check_grid, img_shapes, prefix_forward, target_img_maskfrom .weights import BASE_REPO, load_tailDEFAULT_TAIL = "PrunaAI/P-Q-Image-2.1-DWD"# evaluated sizes (width, height): about 1 MP (the training size) and the model's 2K sizesSIZES_1MP = [(1024, 1024), (1152, 896), (896, 1152), (1344, 768), (768, 1344)]SIZES_2K = [(2048, 2048), (2528, 1696), (1696, 2528), (2752, 1536), (1536, 2752)]
CITATION.cff+2-2
NOTICE+1-1
README.md+15-15
assets/P-Q-Image-2.1-Turbo-DWD.jpg → assets/P-Q-Image-2.1-DWD.jpgRenamed

Large File Pointer Details
- SHA256: f0de9db5a7d6df250a0a5f89d8dae5d4928dbaa79d286308b6ac15430c1bf76a
- Pointer size: 131 Bytes
- Size of remote file: 710 kB

Large File Pointer Details
- SHA256: 0ca86a3c77baabc59277c190d6591a3aa7bd4ed8aeb2ea4399a156b733f281e5
- Pointer size: 132 Bytes
- Size of remote file: 1.18 MB
docs/usage.md+6-6
pyproject.toml+1-1
src/pq_image_dwd/pipeline.py+2-2