Tool for running Stable Diffusion with ONNX FP16 models on DirectML
Top 89.6% on sourcepulse
This repository provides tools and instructions for running Stable Diffusion models using ONNX FP16 on DirectML, targeting AMD and Intel GPUs. It simplifies VRAM usage and increases inference speed by converting PyTorch models to the ONNX FP16 format, enabling broader hardware compatibility for AI image generation.
How It Works
The project leverages ONNX Runtime with the DirectML execution provider to achieve hardware acceleration. It includes a conversion script (conv_sd_to_onnx.py
) that transforms Hugging Face diffusers
models into ONNX format, specifically optimizing for FP16 precision. This approach reduces VRAM footprint and enhances performance, making Stable Diffusion accessible on a wider range of GPUs, including those from AMD and Intel. The conversion process supports various optimizations like attention slicing and alternative VAEs.
Quick Start & Requirements
pip install -r requirements.txt
.huggingface-cli login
).Highlighted Details
.ckpt
and .safetensors
files with optional .yaml
config.OnnxDiffusersUI
for a graphical interface.Maintenance & Community
onnxdiffusers
channel on Discord for support.Licensing & Compatibility
Limitations & Caveats
1 year ago
Inactive