How to Install Stable Diffusion on Mac
Stable Diffusion lets you generate AI images directly on your Mac without relying on cloud services. This guide walks you through installing the AUTOMATIC1111 web interface, the most popular way to run Stable Diffusion locally.
- Install Homebrew and Python. Open Terminal and install Homebrew by running `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"`. After installation completes, run `brew install [email protected]` to install Python 3.10, which Stable Diffusion requires.
- Install Git and clone the repository. Run `brew install git` to install Git if you don't have it. Navigate to your desired installation directory in Terminal, then clone the AUTOMATIC1111 repository with `git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git`. This downloads all necessary files to run Stable Diffusion.
- Download a Stable Diffusion model. Navigate to the models folder with `cd stable-diffusion-webui/models/Stable-diffusion`. Download a model file from Hugging Face or CivitAI. For beginners, download the standard SD 1.5 model by running `wget https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors`.
- Run the installation script. Navigate back to the main directory with `cd ../..` then run `./webui.sh`. This script automatically installs all Python dependencies, sets up the virtual environment, and starts the web interface. The first run takes 10-15 minutes as it downloads additional components.
- Access the web interface. Once installation completes, the terminal displays a local URL like `http://127.0.0.1:7860`. Open this URL in your web browser to access the Stable Diffusion interface. You'll see text input fields for prompts and various generation settings.
- Generate your first image. Type a descriptive prompt in the main text box, such as "a peaceful mountain landscape at sunset". Leave other settings at default and click "Generate". Your first image typically takes 30-60 seconds to generate, depending on your Mac's specifications.
- Configure for optimal performance. For better performance on Mac, add `--medvram` to the launch arguments by editing the `webui-user.sh` file and adding this flag to the `COMMANDLINE_ARGS` line. This reduces VRAM usage at the cost of slightly slower generation times.