Skip to content

mlx-diffuser

Diffusion & flow models on Apple silicon, powered by MLX.

Train from scratch, fine-tune, or run inference β€” for image, video, and discrete modalities β€” from one small, readable codebase. If you know PyTorch and πŸ€— diffusers, you already know this library.

from mlx_diffuser import DiffusionPipeline

pipe = DiffusionPipeline.from_pretrained("path/or/hub-id", dtype="bf16", quantize=4)
images = pipe([1, 2, 3], num_inference_steps=50, guidance_scale=4.0, seed=0)

Why MLX?

  • Unified memory β€” no host↔device copies; run models larger than a discrete GPU's VRAM on a Mac.
  • mx.compile + fused kernels β€” mx.fast.scaled_dot_product_attention, lazy evaluation, compiled training and sampling steps.
  • Weight quantization β€” 4/8-bit so large models fit on 16–32 GB machines.
  • Low power β€” fanless inference and fine-tuning, no cloud GPU rental.

Where to next