Qwen-Image-2.1 Γ PiD β Super-Fast High-Res, through a VAE re-encode (ComfyUI)
ComfyUI workflows that render high-resolution Qwen-Image-2.1 pictures fast, in two short stages:
- Qwen-Image-2.1 with lightx2v's Lightning LoRA renders a small image in 4 steps.
- NVIDIA's PiD (Pixel Diffusion Decoder) draws it at 4Γ its width and height in 4 more steps.
The default is 1024Γ576 β 4096Γ2304.
The workaround. PiD ships decoders for the latent spaces of FLUX.1, FLUX.2, Qwen-Image (v1), SD3 and SDXL, but none for Qwen-Image-2.1's own VAE (64 channels at 16Γ), so Qwen-Image-2.1's latent cannot go to PiD directly. Instead, the Qwen render is decoded by its own VAE, re-encoded with the FLUX.2 VAE β the latent space of PiD's FLUX.2 decoder, the one it was trained on β and PiD decodes that. The extra encode is small and fast.
Why it is fast: Qwen-Image-2.1 renders at a quarter of the output's width and height, 1/16 of its pixels; PiD, a much smaller decoder, does the full-size work.
More on PiD. PiD as a pixel upscaler explains PiD on its own: what it is, the latent spaces it supports, the FLUX.2 re-encode that lets it take any image, how its 4Γ compares with a classic upscale, and the sizes, memory and cost to expect. Its workflows upscale any image 4Γ with PiD alone.
Files
| File | Use |
|---|---|
QwenImage2.1-PiD-SuperFast-HighRes-ComfyUI-local.json |
your own ComfyUI |
QwenImage2.1-PiD-SuperFast-HighRes-ComfyUI-cloud.json |
Comfy Cloud |
qwen21-pid-generate.py |
the same two stages in Python (diffusers + NVIDIA's PiD code), see Python |
requirements.txt |
the Python packages for qwen21-pid-generate.py and PiD's code: pip install -r requirements.txt |
Drag a workflow into ComfyUI, set the size in 0 Β· Size (default 1024Γ576), write a prompt in 1 Β· Prompt, press Run. The draft preview shows the Qwen render; the saved image is PiD's 4Γ output. Both workflows use core ComfyUI nodes only.
Local: requirements and models
A ComfyUI recent enough to include Qwen-Image-2.1 and PiD support (update ComfyUI first). Download these files
into your ComfyUI models/ folders:
| File | Folder | Size | Source |
|---|---|---|---|
qwen_image_2.1_bf16.safetensors |
diffusion_models/ |
14.2 GB | Comfy-Org/Qwen-Image-2.1 |
qwen3vl_8b_bf16.safetensors |
text_encoders/ |
17.5 GB | Comfy-Org/Qwen-Image-2.1 |
qwen_image_2.1_vae_bf16.safetensors |
vae/ |
0.7 GB | Comfy-Org/Qwen-Image-2.1 |
pytorch_lora_weights.safetensors (Lightning) |
loras/ |
0.1 GB | lightx2v/Qwen-Image-2.1-Lightning |
flux2-vae.safetensors |
vae/ |
0.3 GB | Comfy-Org/MOSS-Image |
pid_1.5_flux2_1024_to_4096_4step_bf16.safetensors |
diffusion_models/ |
2.8 GB | Comfy-Org/PixelDiT |
gemma_2_2b_it_elm_bf16.safetensors |
text_encoders/ |
5.2 GB | Comfy-Org/PixelDiT |
Smaller alternatives from the same repositories also load: qwen_image_2.1_int8_convrot (6.8 GB),
qwen3vl_8b_int8_convrot (8.7 GB), gemma_2_2b_it_elm_fp8_scaled (2.6 GB). lightx2v's Lightning LoRA is named
pytorch_lora_weights.safetensors; rename it if you like and pick it in Lightning LoRA. PiD needs no VAE file for its
output: it uses ComfyUI's built-in pixel_space VAE.
Comfy Cloud
Comfy Cloud hosts Qwen-Image-2.1, its Qwen3-VL 8B text encoder and its VAE, the FLUX.2 VAE and PiD's Gemma text encoder. Two files have to be imported into your Comfy Cloud model library, once, from their URLs:
- The Lightning LoRA (copy the link): pytorch_lora_weights.safetensors
- The PiD decoder (copy the link): pid_1.5_flux2_1024_to_4096_4step_bf16.safetensors
Then open QwenImage2.1-PiD-SuperFast-HighRes-ComfyUI-cloud.json. Comfy Cloud names an import <user>__<repo>__<file>,
and the workflow uses those names (lightx2v__Qwen-Image-21-Lightning__pytorch_lora_weights.safetensors in Lightning
LoRA, Comfy-Org__PixelDiT__pid_1.5_flux2_1024_to_4096_4step_bf16.safetensors in Load PiD); if yours differ, pick
them there. A run at the default size took 14 GPU-seconds cold and 5.6 warm on Comfy Cloud's RTX PRO 6000, about 1 to 3
credits.
Two options
| Option | Steps | CFG | How |
|---|---|---|---|
| Lightning LoRA (default) | 4 | 1 | as the workflow opens |
| Qwen-Image-2.1 itself | about 25 | 1 | bypass Lightning LoRA (select it, Ctrl+B), set the sampler's steps |
Settings
| Stage | Steps | CFG | Sampler / scheduler | Other |
|---|---|---|---|---|
| Qwen-Image-2.1 + Lightning | 4 | 1 | euler / simple | no negative prompt |
| Re-encode | Qwen-Image-2.1's VAE decode, then the FLUX.2 VAE encode | |||
| PiD | 4 | 1 | lcm / simple | latent_format = flux (the FLUX.2 latent, detected automatically), degrade_sigma = 0 |
PiD runs through Context Windows (Manual) (core): past 4096 px it decodes overlapping 4096-px windows along the long side, each in its trained range; at the default size there is one window, the plain decode.
Sizes
Set Width and Height in 0 Β· Size: they are the Qwen render, in multiples of 16. PiD's output is computed from them (4Γ each side).
| Qwen render | PiD output |
|---|---|
| 1024Γ576 (default) | 4096Γ2304 |
| 768Γ768 | 3072Γ3072 |
| 1024Γ1024 | 4096Γ4096 |
| 704Γ384 | 2816Γ1536 |
PiD's 2Kβ4K decoder is trained for outputs from 2048 to 4096 px: keep the render at 512 px or more on its long side (below that the output turns soft and blocky). Past 4096 px the context windows carry the long side; keep the render's short side at about 1152 px or less.
Prompts
Qwen-Image-2.1 reads full scene descriptions: long, specific prompts (subject, setting, light, materials, style) work better than short tags. The same prompt goes to Qwen-Image-2.1 and to PiD.
Python (diffusers)
qwen21-pid-generate.py runs the same two stages without ComfyUI, on an NVIDIA (CUDA) GPU (PiD's code targets CUDA; on a
Mac, use the workflows): diffusers' Qwen-Image-2.1 pipeline with the Lightning LoRA (lightx2v's recipe: 4 steps, sigmas
1.0 / 0.75 / 0.5 / 0.25), then PiD on the decoded image, which PiD's own code encodes with its FLUX.2 VAE
(checkpoints/flux2_ae.safetensors).
pip install -r requirements.txt
git clone https://github.com/nv-tlabs/PiD
cd PiD && hf download nvidia/PiD --local-dir . \
--include "checkpoints/PiD_v1pt5_res2kto4k_sr4x_official_flux2_distill_4step/*" \
--include "checkpoints/flux2_ae.safetensors" && cd ..
python qwen21-pid-generate.py --prompt "A wide cinematic photograph of ..." --out image.png
python qwen21-pid-generate.py --prompt "..." --width 768 --height 768 # -> 3072x3072
python qwen21-pid-generate.py --prompt "..." --width 1024 --height 1024 # -> 4096x4096 (PiD tiled on a 32 GB GPU)
python qwen21-pid-generate.py --prompt "..." --no-lightning --steps 40 # Qwen-Image-2.1 itself
Qwen-Image-2.1 and the LoRA download from their repositories on the first run. --offload moves Qwen-Image-2.1 between
the CPU and the GPU: use it on GPUs under ~48 GB. PiD decodes in one pass when its 4Γ output fits the GPU memory, and in
overlapping square tiles otherwise (768 px on a 32 GB GPU).
Tested on an RTX 5090 (32 GB) with --offload:
| Run | Output | Qwen-Image-2.1 | PiD | With loading |
|---|---|---|---|---|
| 1024Γ576, Lightning 4 steps | 4096Γ2304 | 11.3 s | 5.0 s, one pass | 34 s |
| 1024Γ1024, Lightning 4 steps | 4096Γ4096 | 11.9 s | 18.4 s, 768-px tiles | 51 s |
768Γ768, --no-lightning --steps 20 |
3072Γ3072 | 14.9 s | 4.5 s, one pass | 37 s |
Licenses
| Component | License |
|---|---|
| Qwen-Image-2.1 (Qwen) and the Comfy-Org repack | see the repositories |
| lightx2v/Qwen-Image-2.1-Lightning | see the repository |
| PiD by NVIDIA β the Comfy-Org/PixelDiT files used here | NVIDIA Source Code License v1 (nsclv1), not Apache-2.0: read its terms before any use beyond them |
| The FLUX.2 VAE (Comfy-Org/MOSS-Image repack of FLUX.2's VAE) | see the repositories |
| These workflows, the script and this README | Apache-2.0 |
The models are not included here: each workflow downloads them from their own repositories, under their own licenses.
Credits
Qwen for Qwen-Image-2.1, lightx2v for the Lightning LoRA, NVIDIA for PiD, Black Forest Labs for the FLUX.2 VAE, and Comfy-Org for ComfyUI's Qwen-Image-2.1 and PiD support and the repacked files.
- Downloads last month
- 18
