CoolFace
Modelpublic

Heliosoph/sdxl-turbo-onnx

sourceHugging Faceotherupdated 3mo agoView on Hugging Face
1likes9downloads
Model Card

SDXL Turbo — ONNX

ONNX export of stabilityai/sdxl-turbo — Stability AI's Adversarial Diffusion Distillation (ADD) of Stable Diffusion XL base. 512×512 native (NOT the 1024 of full SDXL), designed to run at CFG = 1 in 1-4 inference steps.

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 SDXL diffusers pipeline layout:

model_index.json
scheduler/
text_encoder/           # CLIP-L (768-dim)
text_encoder_2/         # OpenCLIP-G (1280-dim, also emits text_embeds pooled output)
tokenizer/
tokenizer_2/
unet/                   # SDXL UNet — encoder_hidden_states dim 2048 (concatenated)
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 travel together.

How it was produced

optimum-cli export onnx --model stabilityai/sdxl-turbo <output> against a pinned toolchain. No LoRA fuse step — SDXL 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-sdxl-turbo.ps1` in the Heliosoph repo.

Precision note: fp32 only. The optimum 1.24 / torch 2.4 / opset-14 fp16 path produces a numerically broken UNet for SDXL-class models (NaN/Inf cascades through attention softmax + group norm). Revisit fp16 when a confirmed working toolchain exists.

Inference notes

SettingValue
ArchitectureSDXL base — dual text encoders (CLIP-L 768 + OpenCLIP-G 1280, concatenated to 2048), pooled text embeds, time_ids micro-conditioning
SchedulerEuler — ADD-distilled for short schedules
Steps1 (design point) to 4 (quality sweet spot)
CFG / guidance scale1.0 (no classifier-free guidance — Turbo was distilled without it)
Negative promptSkip — CFG = 1 ignores it
Resolution512×512 native (the distinguishing feature vs full SDXL's 1024×1024)
time_ids[512, 512, 0, 0, 512, 512] — 512 target, NOT 1024
VAE scale0.13025 (SDXL family)
Latent shape[1, 4, 64, 64]

The 512 time_ids is the load-bearing difference from full SDXL bodies — feeding 1024 produces correctly-typed tensors but visibly off-aesthetic outputs (SDXL Turbo was distilled with the 512 conditioning baked in).

SDXL Turbo vs SD Turbo

NeedPick
Fastest 512×512 from a clean Stability baselineSD Turbo (~5× smaller, ~2× less VRAM than SDXL Turbo)
Better prompt adherence + composition at 512×512SDXL Turbo (this)
1024×1024 SDXL outputstabilityai/stable-diffusion-xl-base-1.0 (not in catalog — full multi-step pipeline)

SDXL Turbo is the right pick when 512 is enough output size and you want SDXL's prompt adherence at Turbo speed.

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

bibtex
@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}
}