ComfyUI
ComfyUI copied to clipboard
[Feature Request] Please provide support for using MPS acceleration on Apple chips
I tried to load the comfy ui in the AUTOMATIC1111 webui venv environment, which uses MPS acceleration by default, but I failed. The comfy ui only ran in cpu mode on my m1 mac, which was too slow, and wanted MPS support
I don't have a Mac or access to one but I will try to implement it.
Thank you for your positive response, and if you make any progress on this work, I would be more than happy to help you test and provide feedback
Please take this as an example: https://github.com/CompVis/stable-diffusion/compare/main...cruller0704:stable-diffusion-intel-mac:main
I can help test on intel mac.
This would be highly appreciated. I have M1 Mac. And some reasonable python knowledge. I can help, but I need a little guidance how to start.
Assuming I did things correctly the only functions that need to be changed for MPS (or any other device) support are in this file: https://github.com/comfyanonymous/ComfyUI/blob/master/comfy/model_management.py
Thank you. Here is pull request. It works on my M1. DDIM sampler doesn't work, because it only accepts cuda device for now. Maybe some other stuff is broken, but basic flow works fine with euler sampler. https://github.com/comfyanonymous/ComfyUI/pull/244
Can we have tutorial on how to install on Mac / MPS, I will help testing this out. I have M2 Mac Mini.
I just ran it in virtual environment from AUTOMATIC1111. But instruction for Mac can be useful.
@enzyme69 Here are instructions for mac from another issue: Assuming you have conda installed:
conda create -n comfyui python=3.10 -y
conda activate comfyui
pip install -r requirements.txt
Run the web interface with:
conda activate comfyui && python ./main.py
I merged the PR and the DDIM sampler should also work now.
@comfyanonymous Thank you. I guess, you can close issue now.
ok make another issue if there's a specific problem with MPS support.
conda activate comfyui && python ./main.py
thanks!