Downloads · 30 days
0
aamocualg-hse/sdxl-onnx
sdxl-onnx is a machine learning model from aamocualg-hse. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
bash python stablediffusionxl.py \ --provider cuda \ --modelid stabilityai/sdxl-turbo \ --optimize \ --usefp16fixedvae bash git clone https://github.com/microsoft/onnxruntime cd onnxruntime bash git lfs install git cl…
Downloads · 30 days
0
Access
Public
Updated Dec 22, 2025
Repo size
9.7 GB
Likes
0
Public
Click a slice to open those files.
.data7.9 GB · 81%
From the Hugging Face model README
## SDXL Turbo (ONNX Runtime, CUDA)
This repository provides **ONNX-converted SDXL Turbo models** optimized for inference with **ONNX Runtime CUDA Execution Provider**.
It **requires an NVIDIA GPU** and does **not** support CPU or DirectML.
Models are generated using **Olive**:
```bash
python stable_diffusion_xl.py \
--provider cuda \
--model_id stabilityai/sdxl-turbo \
--optimize \
--use_fp16_fixed_vae
stabilityai/sdxl-turbomadebyollin/sdxl-vae-fp16-fixThe VAE output slightly differs from the original SDXL VAE, but visual quality is generally comparable and suitable for most use cases.
Follow the official NVIDIA installation guide.
git clone https://github.com/microsoft/onnxruntime
cd onnxruntime
git lfs install
git clone https://huggingface.co/tlwu/sdxl-turbo-onnxruntime
docker run --rm -it --gpus all \
-v $PWD:/workspace \
nvcr.io/nvidia/pytorch:23.10-py3 \
/bin/bash
export CUDACXX=/usr/local/cuda-12.2/bin/nvcc
git config --global --add safe.directory '*'
sh build.sh \
--config Release \
--build_shared_lib \
--parallel \
--use_cuda \
--cuda_version 12.2 \
--cuda_home /usr/local/cuda-12.2 \
--cudnn_home /usr/lib/x86_64-linux-gnu/ \
--build_wheel \
--skip_tests \
--use_tensorrt \
--tensorrt_home /usr/src/tensorrt \
--cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF \
--cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=80 \
--allow_running_as_root
Install the generated wheel:
pip install build/Linux/Release/dist/onnxruntime_gpu-*.whl --force-reinstall
Notes:
CMAKE_CUDA_ARCHITECTURES:
808689If system RAM < 64 GB, use:
--parallel 4 --nvcc_threads 1
pip install --upgrade pip
cd onnxruntime/python/tools/transformers/models/stable_diffusion
pip install -r requirements-cuda12.txt
pip install --upgrade polygraphy onnx-graphsurgeon \
--extra-index-url https://pypi.ngc.nvidia.com
python demo_txt2img_xl.py \
"starry night over Golden Gate Bridge by van gogh" \
--version xl-turbo \
--engine-dir /workspace/sdxl-turbo-onnxruntime