Instructions to use Heliosoph/sd-turbo-onnx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Heliosoph/sd-turbo-onnx with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Heliosoph/sd-turbo-onnx", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
SD Turbo β ONNX
ONNX export of stabilityai/sd-turbo β Stability AI's Adversarial Diffusion Distillation (ADD) of Stable Diffusion 2.1. 512Γ512 native, designed to run at CFG = 1 in 1-4 inference steps (1 = design point for max speed, 4 = quality sweet spot).
This is a converted artifact, not a new model. All training credit belongs to Stability AI (Sauer, Lorenz, Blattmann, Rombach β ADD method, 2023).
What this repo contains
A standard ONNX diffusers pipeline layout:
model_index.json
feature_extractor/
scheduler/
text_encoder/ # OpenCLIP ViT-H/14 (1024-dim embeddings β NOT 768 like SD 1.5)
tokenizer/
unet/ # SD 2.1 UNet, encoder_hidden_states dim 1024
vae_decoder/
vae_encoder/
LICENSE.md # Stability AI Community License
unet/model.onnx is paired with unet/model.onnx_data (external-weights file). Both must be downloaded.
How it was produced
optimum-cli export onnx --model stabilityai/sd-turbo <output> against a pinned toolchain. No LoRA fuse step β SD Turbo is the distilled base, not a fine-tune.
Toolchain: optimum 1.24.0, diffusers 0.31.0, transformers 4.45.2, torch 2.4.x (CUDA 12.4). Full conversion script: scripts/export-sd-turbo.ps1 in the Heliosoph repo.
Inference notes
| Setting | Value |
|---|---|
| Architecture | Stable Diffusion 2.1 (single CLIP-H text encoder, 1024-dim) |
| Scheduler | Euler (or EulerAncestral) β ADD-distilled for short schedules |
| Steps | 1 (design point) to 4 (quality sweet spot); beyond 4 returns diminishing gains |
| CFG / guidance scale | 1.0 (no classifier-free guidance β Turbo was distilled without it) |
| Negative prompt | Skip β CFG = 1 ignores it |
| Resolution | 512Γ512 native (other resolutions degrade fast) |
| VAE scale | 0.18215 (SD 2.x family) |
| Latent shape | [1, 4, 64, 64] |
SD Turbo vs SDXL Turbo vs the SD 1.5 Hyper family
| Need | Pick |
|---|---|
| Fastest 512Γ512 from a clean Stability baseline | SD Turbo (this) |
| Better prompt adherence + composition at 512Γ512 | SDXL Turbo (heavier β ~5Γ the disk and ~2Γ the VRAM) |
| 512Γ512 with a specific photoreal / fantasy / illustrative fine-tune | SD 1.5 Hyper family (AbsoluteReality / DreamShaper / epiCRealism / RealisticVision / etc.) |
SD Turbo is the right "small baseline" pick when you want Stability's canonical fast model rather than a community fine-tune, and when 512Γ512 is enough.
License
Stability AI Community License β LICENSE.md included in this repo and travels with redistribution.
β οΈ Commercial revenue threshold: This license is free for research, individuals, and commercial use below $1M annual revenue. Above the threshold, commercial use requires a separate Stability AI Enterprise License. By downloading you agree to these terms and to Stability's Acceptable Use Policy, which prohibits CSAM, non-consensual deepfakes, harassment, malware generation, and similar misuse. The AUP propagates with the model β your derivatives and downstream redistributions must impose the same policy.
Citation
@article{sauer2023adversarial,
title = {Adversarial Diffusion Distillation},
author = {Sauer, Axel and Lorenz, Dominik and Blattmann, Andreas and Rombach, Robin},
journal = {arXiv preprint arXiv:2311.17042},
year = {2023}
}
- Downloads last month
- 38
Model tree for Heliosoph/sd-turbo-onnx
Base model
stabilityai/sd-turbo