Text-to-Image
Diffusers
Safetensors
MLX
mlx-gen
apple-silicon
diffusion
stable-diffusion-xl
sdxl
sdxl-lightning
Instructions to use SceneWorks/realvisxl-lightning-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use SceneWorks/realvisxl-lightning-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir realvisxl-lightning-mlx SceneWorks/realvisxl-lightning-mlx
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
File size: 2,089 Bytes
4bb9003 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | ---
license: openrail++
tags:
- mlx
- apple-silicon
- diffusion
- stable-diffusion-xl
- sdxl
- sdxl-lightning
- text-to-image
base_model: SG161222/RealVisXL_V5.0_Lightning
library_name: mlx-gen
pipeline_tag: text-to-image
---
# RealVisXL V5.0 Lightning — MLX pre-quantized tiers
Pre-quantized, packed-load tiers of
[SG161222/RealVisXL_V5.0_Lightning](https://huggingface.co/SG161222/RealVisXL_V5.0_Lightning)
for on-device Apple-Silicon inference with [SceneWorks / `mlx-gen`](https://github.com/SceneWorks/mlx-gen)
(the `sdxl` generator). Each tier is a **self-contained diffusers turnkey snapshot** (U-Net + both
CLIP text encoders + VAE + tokenizers + scheduler + `model_index.json`) that loads directly — no
in-app quantization pass, no dense transient.
A few-step distilled SDXL-Lightning photoreal checkpoint (openrail++, commercial-OK, ungated) — a
standalone sibling of RealVisXL V5.0 tuned for ~5-step generation, roughly 6× faster than the 30-step
base. Runs CFG-free by default; text-to-image only.
## Tiers
| dir | precision | what's quantized |
|----------|-----------|------------------|
| `q4/` (default) | group-wise affine Q4, group size 64 | U-Net Linears + both CLIP encoders |
| `q8/` | group-wise affine Q8, group size 64 | U-Net Linears + both CLIP encoders |
| `bf16/` | dense (full-precision master) | nothing — verbatim source mirror |
The **VAE stays dense (f32)** in every tier (the SDXL VAE is int8/fp16-unstable). Convolutions,
GroupNorms, and the CLIP token/position embeddings also stay dense; only the true Linear projections
are packed. Quantization is byte-identical to `mlx-gen`'s load-time `nn.quantize` (bf16 cast, group
64).
## Usage
```rust
use mlx_gen::{LoadSpec, WeightsSource, Quant};
let spec = LoadSpec::new(WeightsSource::Dir("…/realvisxl-lightning-mlx/q4".into())).with_quant(Quant::Q4);
let g = mlx_gen::load("sdxl", &spec)?;
```
## License
openrail++ — inherited from the source model
[SG161222/RealVisXL_V5.0_Lightning](https://huggingface.co/SG161222/RealVisXL_V5.0_Lightning). See `LICENSE`.
|