progrock-stable icon indicating copy to clipboard operation
progrock-stable copied to clipboard

Cannot get it to work on an Apple M1

Open Monokai opened this issue 2 years ago • 1 comments

Trying to get this to work on an Apple M1. Following the installation instructions, I'm first getting:

No matching distribution found for opencv-python==4.1.2.30

Changing the mac-environment.yaml to update opencv-python to the latest version (4.6.0.66) fixes the installation.

But after activating the conda environment and running a simple python prs.py, it gives me this error:

PROG ROCK STABLE
----------------

Parsing settings.json
Applying settings file: settings.json
Using k_lms sampling method.
Loading the model and checkpoint (./models/sd-v1-4.ckpt)...
Loading model from ./models/sd-v1-4.ckpt
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
Pytorch is using device: mps
Saving output to ./out/Default
Starting render!
Global seed set to 9875084
Traceback (most recent call last):
  File "***/prs.py", line 1067, in <module>
    main()
  File "***/prs.py", line 1049, in main
    gobig_init = do_run(device, model, opt)
  File "***/prs.py", line 186, in do_run
    sampler = DDIMSampler(model)
TypeError: DDIMSampler.__init__() missing 1 required positional argument: 'device'

I've successfully got the repository https://github.com/bfirsh/stable-diffusion to work on an M1, and I've tried to use pieces of code from that repository, but it only lead to different errors.

Any ideas?

Monokai avatar Sep 11 '22 07:09 Monokai

Confirmed, I have the exact same issue on M1 Max 32GB. Spent a few hours trying to resolve this but this is 100% the issue I had as well. Really desperate to start playing with this :/

milezzz avatar Sep 12 '22 04:09 milezzz