sdxl-lightning-4step-int8
SDXL-Lightning (4-step) as int8 ONNX, for on-device generation in Latent Studio. 1024px native, four deterministic steps, no classifier-free guidance.
Export notes
The UNet is traced with added_cond_kwargs lifted into real arguments, so the
graph exposes the SDXL conditioning inputs directly:
sample, timestep, encoder_hidden_states(2048), text_embeds(1280), time_ids(6)
Both text encoders emit hidden_states[-2], not last_hidden_state - SDXL
conditions on the penultimate layer, and using the final one produces flat,
off-prompt images with no error to tell you why.
Quantisation is per-component: UNet MatMul+Conv (a UNet is mostly Conv), text encoders MatMul only, VAE left fp32 because quantising it shows as colour banding.
Requires Euler with trailing timestep spacing. Leading spacing never reaches maximum noise, which with a 4-step budget produces washed-out output.
Model tree for latentdivergence/sdxl-lightning-4step-int8
Base model
stabilityai/stable-diffusion-xl-base-1.0