This library aims to be a a complete Stable Diffusion implementation in idiomatic Rust built on top of ONNX. It's still in an early work-in-progress stage, but some pipelines already work, see examples.
- 🐥 txt2img
- 🐣 img2img and inpainting
- 🐥 CUDA and TensorRT accelerated inference
- txt2img completes in ~2 seconds for a 512x512 image on modern Nvidia hardware
- 🐥 fp32 and fp16 models
- fp16 models can be leveraged to save space and memory
- 🐣 support different schedulers
- Euler, EulerAncestral and LMS for now
- 🐥 long prompt weighting
- 🥚 upscaling
- 🥚 LORAs and textual inversions
- 🐥 small footprint, no heavy dependencies
Checkpoints have to be converted to the ONNX format before use. I've built a convenience Docker image that can convert safetensors files into optimized fp16 ONNX models, it can be invoked through a script in this repository:
./utils/convert/convert.sh -i /home/me/checkpoints/CounterfeitAnime.safetensors -o /home/me/checkpoints/CounterfeitAnime-onnx



