Image Generation3.5B

Run Stable Diffusion on Mac Mini M4

How to run SDXL and FLUX on the Mac Mini M4 using Diffusers or ComfyUI — with expected generation times and optimization tips.

Generation Time

18–25s per 1024×1024 (SDXL)

Min Memory

16 GB

Software

Python 3.11, ComfyUI, pytorch-nightly (MPS)

Hardware Used in This Guide

Apple Mac Mini (M4, 2024)

mini-pc · Check Price on Amazon

Buy on AmazonAffiliate link — no extra cost to you

Step-by-Step Setup

  1. 01

    Install ComfyUI

    ComfyUI has the best Apple Silicon support in the image-gen ecosystem. Clone it and install dependencies.

    git clone https://github.com/comfyanonymous/ComfyUI
    cd ComfyUI
    pip install -r requirements.txt
  2. 02

    Download SDXL base model

    Place the model checkpoint in ComfyUI's models/checkpoints directory. Use the fp16 variant to fit in 16 GB.

    # ~6.5 GB download
    cd models/checkpoints
    wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0_0.9vae.safetensors
  3. 03

    Launch ComfyUI with MPS backend

    The --force-fp16 flag prevents OOM on 16 GB systems running SDXL.

    python main.py --force-fp16
  4. 04

    Open the UI

    Navigate to http://127.0.0.1:8188 and load a basic SDXL workflow. Queue a prompt to test generation speed.

  5. 05

    Try FLUX.1 Schnell for faster generations

    FLUX.1 Schnell generates in 4 steps vs SDXL's 20–30, cutting time to ~8–12s on M4. Download the fp8 variant.

    # ~8 GB
    huggingface-cli download black-forest-labs/FLUX.1-schnell \
      --local-dir models/checkpoints/flux-schnell

Optimization Tips

  • Use fp16 precision — fp32 doubles VRAM usage with no perceptible quality gain on M-series.

  • FLUX.1 Schnell (4-step) is 3–4× faster than SDXL on M4; use it for iteration, SDXL for final renders.

  • Keep image size at 1024×1024 or below on 16 GB to avoid system RAM spillover.

  • ComfyUI's MPS backend is more stable than the A1111 WebUI for Apple Silicon in 2026.

Other Hardware for SDXL / FLUX.1

Apple Mac Mini (M4 Pro, 2024)

mini-pc · Check Price on Amazon · 24 GB Unified

Buy on AmazonAffiliate link — no extra cost to you

Related Guides