Text-to-image generation and multi-image editing with
Qwen/Qwen-Image-2.1, running on ZeroGPU
through the QwenImage21Pipeline in diffusers.
<image1> … <image10>
in the prompt (upload order).The Enhance prompt checkbox calls a companion Space,
hugging-apps/qwen-image-2-1-prompt-enhancer,
which keeps both official rewriters (Qwen-Image-2.1-PE-T2I and Qwen-Image-2.1-PE-I2I)
warm and resident on their own GPU worker. Splitting them out keeps this Space's GPU
allocation dedicated to diffusion.
The transformer blocks and the VAE decoder run as ahead-of-time compiled kernels (PyTorch
AOTInductor) published in
hugging-apps/qwen-image-2-1-aoti and
built by hugging-apps/qwen-image-2-1-aoti-compile.
One dynamic-shape artifact per module covers every resolution, aspect ratio and number of
condition images; the first denoising step (the block-causal prefill) and the text encoder stay
eager. Set the QWEN21_AOTI=0 variable to run fully eager.
Everything stays resident on the GPU. Outputs above 1536 px decode in tiles, and the prefix KV cache is switched off for requests whose condition images would not fit next to the weights (it costs about 2 GB per 1K-pixel condition image), which keeps many-image edits running at the cost of speed.
Editing requests (any submission with input images) are screened with
hfmlsoc/ncii-guard-v02 before anything
is generated.
The images under examples/ are the official demo assets from the
Qwen/Qwen-Image-2.1 Space,
redistributed here under the Qwen Research License for non-commercial demonstration.
Qwen is licensed under the Qwen RESEARCH LICENSE AGREEMENT, Copyright (c) 2026 Hangzhou Tongyi Laboratory Technology Co., Ltd. All Rights Reserved.
Research / evaluation use only — see the license.
21 commits
Text-to-image generation and multi-image editing with
Qwen/Qwen-Image-2.1, running on ZeroGPU
through the QwenImage21Pipeline in diffusers.
<image1> … <image10>
in the prompt (upload order).The Enhance prompt checkbox calls a companion Space,
hugging-apps/qwen-image-2-1-prompt-enhancer,
which keeps both official rewriters (Qwen-Image-2.1-PE-T2I and Qwen-Image-2.1-PE-I2I)
warm and resident on their own GPU worker. Splitting them out keeps this Space's GPU
allocation dedicated to diffusion.
The transformer blocks and the VAE decoder run as ahead-of-time compiled kernels (PyTorch
AOTInductor) published in
hugging-apps/qwen-image-2-1-aoti and
built by hugging-apps/qwen-image-2-1-aoti-compile.
One dynamic-shape artifact per module covers every resolution, aspect ratio and number of
condition images; the first denoising step (the block-causal prefill) and the text encoder stay
eager. Set the QWEN21_AOTI=0 variable to run fully eager.
Everything stays resident on the GPU. Outputs above 1536 px decode in tiles, and the prefix KV cache is switched off for requests whose condition images would not fit next to the weights (it costs about 2 GB per 1K-pixel condition image), which keeps many-image edits running at the cost of speed.
Editing requests (any submission with input images) are screened with
hfmlsoc/ncii-guard-v02 before anything
is generated.
The images under examples/ are the official demo assets from the
Qwen/Qwen-Image-2.1 Space,
redistributed here under the Qwen Research License for non-commercial demonstration.
Qwen is licensed under the Qwen RESEARCH LICENSE AGREEMENT, Copyright (c) 2026 Hangzhou Tongyi Laboratory Technology Co., Ltd. All Rights Reserved.
Research / evaluation use only — see the license.
21 commits