Instructions to use clark-labs/clark-air-sana-1.6b-mlx-2bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use clark-labs/clark-air-sana-1.6b-mlx-2bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir clark-air-sana-1.6b-mlx-2bit clark-labs/clark-air-sana-1.6b-mlx-2bit
- Sana
How to use clark-labs/clark-air-sana-1.6b-mlx-2bit with Sana:
# Load the model and infer image from text import torch from app.sana_pipeline import SanaPipeline from torchvision.utils import save_image sana = SanaPipeline("configs/sana_config/1024ms/Sana_1600M_img1024.yaml") sana.from_pretrained("hf://clark-labs/clark-air-sana-1.6b-mlx-2bit") image = sana( prompt='a cyberpunk cat with a neon sign that says "Sana"', height=1024, width=1024, guidance_scale=5.0, pag_guidance_scale=2.0, num_inference_steps=18, ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Clark Air · Sana 1.6B · MLX 2-bit
The Clark Air Sana 1.6B transformer quantized to ternary, stored in MLX 2-bit kernels for Apple Silicon — the first MLX port of Sana. 543 MB vs 3.21 GB FP16.
Generated end-to-end on an M5 Max: MLX 2-bit transformer driving the denoising loop, VAE decode.
Contents
clark_air_sana_mlx_2bit.safetensors— MLX-quantized transformer (trunk ternary in MLX 2-bit slots at per-layer power-of-two groups; conditioning/projection layers kept high-precision).mlx_sana.py— the MLX runtime / loader.
Status
The transformer (the compressed core), verified to reproduce the FP16 model across a full
20-step generation (3.4% per-step). A full standalone MLX pipeline (scheduler + text encoder +
VAE) is in progress; until then run the transformer with the rest of the Sana pipeline bridged
from diffusers.
Usage
import mlx.core as mx
from mlx_sana import SanaMLX
sd = mx.load("clark_air_sana_mlx_2bit.safetensors")
model = SanaMLX(sd) # auto-detects the packed 2-bit trunk
# noise = model(latent, encoder_hidden_states, timestep, enc_mask=mask)
License
Apache-2.0 © Clark Labs, Inc.
Quantized
Model tree for clark-labs/clark-air-sana-1.6b-mlx-2bit
Unable to build the model tree, the base model loops to the model itself. Learn more.
