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