Getting Stable Diffusion or some sort of AI apps running on Hackintosh is quite difficult due to packages are being too old for operating those AI apps hence any sort of installation of pytorch components will be met with error package not satisfiable with particular version and etc.
The only way to getting Stable Diffusion to fully work on Hackintosh (or Mac machines with AMD GPU installed) is to build pytorch components from the source. Tested on my current Hackintosh with AMD RX 5600 6GB GPU and it is working well (at least for now). Stable Diffusion only works on AMD and Intel GPUs (Nvidia GPU are not supported at all).
Here's on how to set up Stable Diffusion for MacOS Intel platform (including Hackintosh)
Install Miniconda for MacOS Intel. By default, miniconda uses latest Python 3.13 so keep it unchanged.
Install Brew. This will also install xcode component as well.
Build pytorch from source first, followed by torchvision and torchaudio also from source.
To build pytorch, run these commands below:
git clone https://github.com/pytorch/pytorch
cd pytorch
git submodule sync
git submodule update --init --recursive
pip install --group dev
pip install mkl-static mkl-include
conda install pkg-config libuv
python -m pip install --no-build-isolation -v -e .To build torchvision, run these command below:
git clone https://github.com/pytorch/vision.git
cd vision
pip install -e . -v --no-build-isolationTo build torchaudio, run these command below:
git clone https://github.com/pytorch/audio
cd audio
python setup.py developInstall ComfyUI from the github, not from the installer .dmg file.
git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUIEdit the requirements.txt and then omit out these "torch", "torchaudio" & "torchvision" to bypass installing from the prebuilt packages.
nano requirements.txt
#example of omitting out package lists with "#"
#torch
#torchaudio
#torchvisionInstall the ComfyUI dependencies package
pip install -r requirements.txtLaunch ComfyUI
python main.pyDownload the SD 1.5 model first and test run the image generation. If the image result is the exactly same as the prompt input, then congratulations!
IMPORTANT NOTE AND ALSO LIMITATIONS
Only ComfyUI fully working on MacOS Intel platforms. Any other SD Webui apps just don't work at all. If working, it just keep producing garbage images.
Some of ComfyUI components may not work correctly especially Adetailer component etc. This is basically happened with package conflicts that people don't bother to fix it. To use Adetailer, dual-booting with Windows or Linux is required and use the ComfyUI program over there.
If you're experiencing out of VRAM errors, try to run this command below to allow "lowvram" mode. However, using this command may causing system unstable so watch out for system RAM usage.
$ export PYTORCH_MPS_HIGH_WATERMARK_RATIO=0.0 MacOS MPS doesn't support FP8 precision at all. Also, AMD GPU or Intel GPU that supports Metal3 API is required for using ComfyUI on MacOS Intel platform.
To improve image generation quality, always run with these flags:
--dont-upcast-attention --force-fp16TROUBLLESHOOTING
If you're unable to run ComfyUI on MacOS Intel, you might want to do some pytorch test first to see whether your Mac/Hackintosh is configured with MPS hardware functionality. To do this, create an empty text file and copy this code snippet below and save it under the file name "pytorch-test.py".
import torch
#Check device
device = torch.device("mps" if torch.backends.mps.is_available() else "cpu")
print(f"Using device: {device}")
# Example: Tensor operations
x = torch.rand(3, 3).to(device)
y = torch.rand(3, 3).to(device)
z = x + y
print(z)When running, launch the command below to perform the test:
python pytorch-test.pyIf you seeing the output is mps, means your Mac/Hackintosh is configurable to run AI image generations with your GPU. But, if you seeing the output cpu, means you're doing something wrong with environment setup which most likely happen when:
You're trying to skip build instructions and proceed to install prebuilt pytorch package which you may think this will save time but unfortunately, no MPS on MacOS Intel support at all on these pre-built package.
You don't use Anaconda environment, like I said before, you're trying to skip build instructions.
You're trying to run with unsupported GPU hardware especially Nvidia GPU or any kind of AMD/Intel GPU that only have Metal2 API support.


