hugging-apps/qwen-image-2-1

Space

Qwen-Image-2.1

23

21 commits

updated Sep 21, 2026

See the code
gradio
mcp-server

README

Qwen-Image-2.1

Text-to-image generation and multi-image editing with Qwen/Qwen-Image-2.1, running on ZeroGPU through the QwenImage21Pipeline in diffusers.

  • Text to image — leave the input gallery empty and describe what you want.
  • Image editing — upload up to 10 images and refer to them as <image1><image10> in the prompt (upload order).
  • Transparency — the model natively decodes RGBA. Ask for it in the prompt, e.g. "This is an RGBA image with transparency. … The image has alpha channel and the background is transparent."

Prompt enhancement

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.

Speed

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.

Safety

Editing requests (any submission with input images) are screened with hfmlsoc/ncii-guard-v02 before anything is generated.

Example assets

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.

License

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.

Contributors

multimodalart

21 commits

hugging-apps/qwen-image-2-1

Space

Qwen-Image-2.1

23

21 commits

updated Sep 21, 2026

See the code
gradio
mcp-server

README

Qwen-Image-2.1

Text-to-image generation and multi-image editing with Qwen/Qwen-Image-2.1, running on ZeroGPU through the QwenImage21Pipeline in diffusers.

  • Text to image — leave the input gallery empty and describe what you want.
  • Image editing — upload up to 10 images and refer to them as <image1><image10> in the prompt (upload order).
  • Transparency — the model natively decodes RGBA. Ask for it in the prompt, e.g. "This is an RGBA image with transparency. … The image has alpha channel and the background is transparent."

Prompt enhancement

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.

Speed

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.

Safety

Editing requests (any submission with input images) are screened with hfmlsoc/ncii-guard-v02 before anything is generated.

Example assets

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.

License

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.

Contributors

multimodalart

21 commits