A normal Flask application adapted from d0grr/generate-ai-images. Flask serves the interface and local ONNX files; all image inference runs client-side through ONNX Runtime Web's WebGPU execution provider. There is no server inference and no CPU fallback.
.\.venv\Scripts\Activate.ps1
python app.pyOpen http://127.0.0.1:5000 in a WebGPU-capable Chrome or Edge browser. The resolution dropdown supports 256×256, 512×512, 768×768, and 1024×1024.
Configuration is stored in .env.
Model weights are intentionally not stored in Git. Download both required local WebGPU variants after cloning:
.\.venv\Scripts\python.exe scripts\download_models.pyThe downloader is resumable and needs approximately 8.74 GB of free disk space. It downloads from:
d0gr/sdxl-lightning-onnx-webgpud0gr/sdxl-lightning-onnx-webgpu-int4
Files are written exactly here:
models/
quality/
tokenizer/
tokenizer_2/
text_encoder/
text_encoder_2/
unet/
vae_decoder/
light/
unet/
Run the same command again after an interrupted download; existing completed files are skipped and .part files resume. Start Flask only after the script prints All local WebGPU models downloaded.
The first generation compiles WebGPU shaders and can take substantially longer than later generations. SDXL Quality requires roughly 8 GB of VRAM; the int4 Light model requires Chrome and roughly 6 GB.