ComfyUI Install

Installing ComfyUI on Apple Silicon

Complete guide to running ComfyUI on Mac Studio M4 Max with Metal GPU acceleration.

Prerequisites

  • Mac with Apple Silicon (M1/M2/M3/M4)
  • macOS 13+
  • Homebrew package manager

Installing Homebrew (Step-by-Step)

Homebrew is the package manager for macOS. Follow these steps to install it:

  1. Open Terminal:
    Press Cmd+Space, type “Terminal” and press Enter. Or find Terminal in Applications > Utilities.
  2. Install Homebrew:
    Copy and paste this command into Terminal:
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  3. Enter your password:
    When prompted, type your Mac login password (you wont see characters as you type – this is normal for security). Press Enter.
  4. Wait for installation:
    Homebrew will download and install files. This may take a few minutes. Do not close Terminal.
  5. Add Homebrew to PATH:
    After installation completes, run these two commands:
    echo "eval "$(brew --env)"" >> ~/.zshrc
    source ~/.zshrc
  6. Verify installation:
    Run this command to confirm Homebrew is working:
    brew doctor
    If you see “Your system is ready to brew”, Homebrew is installed correctly.

Installation Steps

  1. Install PyTorch with Metal support:
    brew install pyTorch
  2. Clone ComfyUI:
    git clone https://github.com/comfyanonymous/ComfyUI
  3. Download models:
    Place model files in ~/.comfyui/models/
  4. Navigate to ComfyUI directory:
    cd ComfyUI

Launch Command for Mac Studio M4 Max 36GB

For Mac Studio M4 Max with 36GB unified memory, use these environment variables to optimize memory usage:

Usage

  1. Open browser to http://localhost:8188
  2. Drag workflows onto canvas
  3. Click Queue to generate

Memory Optimization Notes

  • –lowvram: Reduces VRAM usage, essential for 36GB models
  • –use-split-cross-attention: Improves memory efficiency
  • PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0: Prevents memory spikes