Installing Stable Diffusion WebUI on macOSjson error: Syntax error
To achieve optimal performance when generating images, the host machine should be equipped with an Apple Silicon chip (M1 or later). While the application can run on systems with 8GB of unified memory, 16GB or higher is recommended to prevent out-of-memory errors during high-resolution rendering. Additionally, ensure at least 15GB of free disk space is available to accommodate the application dependencies, virtual environment, and model weights.
Installing the Package Manager
Homebrew serves as the de facto package manager for macOS, simplifying the installation of software and dependencies. Open the Terminal application and execute the installation script provided by the official Homebrew repository:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Once the process completes, verify the installation by checking the version:
brew --version
Setting Up the Runtime Environment
The default Python installlation included with macOS is often outdated. Stable Diffusion WebUI specifically requires Python 3.10.6 or newer. Alongside the correct Python version, several compilation tools and libraries are necessary for the PyTorch backend.
Run the following command to install all required dependencies:
# Update Homebrew registry and install core dependencies
brew update
brew install cmake protobuf rust python@3.10 git wget
Cloning the Application Repository
Retrieve the source code for the AUTOMATIC1111 Stable Diffusion WebUI interface. This repository contains the web server logic and necessary scripts for environment initialization.
# Clone the repository into the current directory
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
Configuring the Model Checkpoint
The WebUI requires a pre-trained model checkpoint to function. Download the Stable Diffusion version 1.5 weight file (e.g., v1-5-pruned-emaonly.ckpt) from a trusted source such as Hugging Face.
Navigate to the models subdirectory within the cloned project folder and place the downloaded .ckpt or .safetensors file into the following path:
stable-diffusion-webui/models/stable-diffusion/
Launching the Interface
Initialize the web server by executing the launch script. This command will automatically create a Python virtual environment, install remaining pip dependencies, and start the local web server.
cd stable-diffusion-webui
./webui.sh
After the initialization process finishes, the terminal will display a local URL (typical http://127.0.0.1:7860). Open this address in a web browser to access the generation interface.