A cross-platform desktop application providing a user-friendly GUI for Alibaba's Qwen-Image diffusion model. Built with Python/Gradio backend and designed for future Tauri desktop distribution.

The Qwen-Image model produces high-quality images with:
git clone https://github.com/DexterLagan/qwen-image-generator.git
cd qwen-image-generator
pip install -r requirements.txt
python qwen_gui.py
Open your browser to http://localhost:7860
First run: Click "Download & Load Model" (one-time ~4GB download)
Two versions of the Qwen-Image model are available:
Select the desired variant in the application before downloading.
The application automatically detects your hardware and optimizes accordingly:
qwen-image-generator/
├── qwen_gui.py # 🚀 Main Gradio application
├── qwen_sample_hf.py # 📖 Official HuggingFace reference
├── qwen_gradio_proto_chatgpt_wrong.py # 📁 Legacy prototype (archived)
├── test_launch.py # 🧪 Basic functionality test
├── requirements.txt # 📦 Python dependencies
├── console.log # 📋 Application logs
├── model/cache/ # 🤖 Downloaded model files
├── output/ # 🖼️ Generated images
└── screenshots/ # 📸 Documentation images
diffusers.DiffusionPipeline (not transformers)true_cfg_scale, aspect ratios, and resolutionsThe application sets optimal configurations automatically:
# Gradio analytics disabled for privacy
os.environ['GRADIO_ANALYTICS_ENABLED'] = 'False'
# Note: CUDA expandable_segments removed for platform compatibility
model/cache/models--Qwen--Qwen-Image/output/qwen_image_YYYYMMDD_HHMMSS_seedXXXXXX.pngThe following versions have been tested and work together:
torch==2.7.1
torchvision==0.22.1
transformers==4.55.0
accelerate==1.10.0
safetensors==0.5.3
gradio==5.41.1
psutil==7.0.0
For GPU support (though CPU-only mode is recommended for this model):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
Symptoms: Process exits/crashes during model loading without error message Cause: Insufficient Windows virtual memory for large model loading Solution:
Win + R, type sysdm.cpl, press Enter50000 MB, Maximum: 50000 MBSymptoms: CUDA OOM errors despite CPU-only configuration Cause: Qwen-Image model (~20GB) too large for most GPUs Solution: Application automatically uses CPU-only mode User Action: Restart application if error persists
Symptoms: NotImplementedError during image generation Cause: Mixed GPU/CPU operations creating invalid tensor states Solution: Application uses pure CPU-only mode to prevent this User Action: Restart application, ensure CPU-only mode is active
Symptoms: Loading fails partway through, safetensors errors Cause: Interrupted downloads, disk issues, or network problems Solution: Click "🗑️ Clear Cache & Re-download" button Prevention: Ensure stable internet connection during initial download
Symptoms: "Unable to configure formatter" errors Cause: Logging conflicts between custom code and Gradio Solution: Fixed in current version with proper logging configuration User Action: Use PowerShell instead of CMD on Windows
console.log for detailed operation informationsudo permissions/tmp space during model loading| Error | Cause | Solution |
|---|---|---|
| Process killed at shard 6/9 | Insufficient virtual memory | Increase Windows page file to 50GB |
| CUDA out of memory | Model too large for GPU | Application auto-uses CPU mode |
| Safetensors error | Corrupted model files | Use "Clear Cache & Re-download" button |
| Network timeout | Unstable connection | Retry download, check internet |
| Permission denied | Folder access issues | Run as administrator or check permissions |
| Import errors | Missing dependencies | Reinstall with pip install -r requirements.txt |
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
The Qwen-Image model is licensed under the Qianwen License 1.0:
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
If you encounter any issues:
console.log file for error details15 commits
Python
100.0%
A cross-platform desktop application providing a user-friendly GUI for Alibaba's Qwen-Image diffusion model. Built with Python/Gradio backend and designed for future Tauri desktop distribution.

The Qwen-Image model produces high-quality images with:
git clone https://github.com/DexterLagan/qwen-image-generator.git
cd qwen-image-generator
pip install -r requirements.txt
python qwen_gui.py
Open your browser to http://localhost:7860
First run: Click "Download & Load Model" (one-time ~4GB download)
Two versions of the Qwen-Image model are available:
Select the desired variant in the application before downloading.
The application automatically detects your hardware and optimizes accordingly:
qwen-image-generator/
├── qwen_gui.py # 🚀 Main Gradio application
├── qwen_sample_hf.py # 📖 Official HuggingFace reference
├── qwen_gradio_proto_chatgpt_wrong.py # 📁 Legacy prototype (archived)
├── test_launch.py # 🧪 Basic functionality test
├── requirements.txt # 📦 Python dependencies
├── console.log # 📋 Application logs
├── model/cache/ # 🤖 Downloaded model files
├── output/ # 🖼️ Generated images
└── screenshots/ # 📸 Documentation images
diffusers.DiffusionPipeline (not transformers)true_cfg_scale, aspect ratios, and resolutionsThe application sets optimal configurations automatically:
# Gradio analytics disabled for privacy
os.environ['GRADIO_ANALYTICS_ENABLED'] = 'False'
# Note: CUDA expandable_segments removed for platform compatibility
model/cache/models--Qwen--Qwen-Image/output/qwen_image_YYYYMMDD_HHMMSS_seedXXXXXX.pngThe following versions have been tested and work together:
torch==2.7.1
torchvision==0.22.1
transformers==4.55.0
accelerate==1.10.0
safetensors==0.5.3
gradio==5.41.1
psutil==7.0.0
For GPU support (though CPU-only mode is recommended for this model):
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
Symptoms: Process exits/crashes during model loading without error message Cause: Insufficient Windows virtual memory for large model loading Solution:
Win + R, type sysdm.cpl, press Enter50000 MB, Maximum: 50000 MBSymptoms: CUDA OOM errors despite CPU-only configuration Cause: Qwen-Image model (~20GB) too large for most GPUs Solution: Application automatically uses CPU-only mode User Action: Restart application if error persists
Symptoms: NotImplementedError during image generation Cause: Mixed GPU/CPU operations creating invalid tensor states Solution: Application uses pure CPU-only mode to prevent this User Action: Restart application, ensure CPU-only mode is active
Symptoms: Loading fails partway through, safetensors errors Cause: Interrupted downloads, disk issues, or network problems Solution: Click "🗑️ Clear Cache & Re-download" button Prevention: Ensure stable internet connection during initial download
Symptoms: "Unable to configure formatter" errors Cause: Logging conflicts between custom code and Gradio Solution: Fixed in current version with proper logging configuration User Action: Use PowerShell instead of CMD on Windows
console.log for detailed operation informationsudo permissions/tmp space during model loading| Error | Cause | Solution |
|---|---|---|
| Process killed at shard 6/9 | Insufficient virtual memory | Increase Windows page file to 50GB |
| CUDA out of memory | Model too large for GPU | Application auto-uses CPU mode |
| Safetensors error | Corrupted model files | Use "Clear Cache & Re-download" button |
| Network timeout | Unstable connection | Retry download, check internet |
| Permission denied | Folder access issues | Run as administrator or check permissions |
| Import errors | Missing dependencies | Reinstall with pip install -r requirements.txt |
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
The Qwen-Image model is licensed under the Qianwen License 1.0:
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
If you encounter any issues:
console.log file for error details15 commits
Python
100.0%