ControlNet
ControlNet copied to clipboard
Add mps-cpu Support
Summary
・Adapted stablediffusion to work on M1 mac(mps) and CPU
Currently not feasible
・gradio_seg2image.py(Reason:aten::_slow_conv2d_forward is currently not supported by mps.)
@lllyasviel Sorry to be so busy, but can I get a review? I want to help more people use this
I am trying to test this on an M1 Mac, but am experiencing issues with the conda
environment configuration. I would recommend adding an environment.yaml targeted for MPS/CPU.
In order to get the conda
environment to install correctly, I had to remove cudatoolkit
(doesn't exist for Mac) and change versions for python
, pip
, and opencv-contrib-python
. I also needed rust
(it wasn't already on my system) in order to get some of the pip
packages to install, but not ready to suggest this is necessary.
dependencies:
- - python=3.8.5
- - pip=20.3
- - cudatoolkit
+ - python=3.8
+ - pip=22.3
+ - rust
- pip:
- - opencv-contrib-python==4.3.0.36
+ - opencv-contrib-python
With those changes, I was finally able to activate the conda
environment and launch the gradio_scribble2image.py example.
However, when trying to "run" the example, I get an AssertionError
that originates from cldm/ddim_hacked.py:97 stating that "Torch not compiled with CUDA enabled" even though I am not trying to run with CUDA (I made sure to set PYTORCH_ENABLE_MPS_FALLBACK=1
when launching).
I forgot about it. Thanks for pointing that out!
However, when trying to "run" the example, I get an AssertionError
I found the cause and will fix it now.Sorry
@justinseibert The fix is in! Thanks for your help
@lllyasviel Can you merge this PR as soon as possible, I also encountered this problem locally, thanks
i very hope pip install controlnet can also support macOS, thanks!
dependencies: - pip: - - opencv-contrib-python==4.3.0.36 + - opencv-contrib-python
Take the chance to also replace opencv-contrib-python with opencv-contrib-python-headless, it skips some nasty glib deps.