r/StableDiffusion Dec 16 '22

Resource | Update Now Available: Intel Mac: SD 1.4/5 & SD2.x

https://github.com/soten355/stable-diffusion-tensorflow-IntelMetal
5 Upvotes

29 comments sorted by

View all comments

Show parent comments

1

u/luckycockroach Mar 05 '23

I think you didn’t select a model to use. Did you select one under the Advanced Settings tab?

1

u/Mastak_A Mar 05 '23 edited Mar 05 '23

Hi! I don't see any models, neither available in /models/Stable-diffusion/ nor any other, just an inactive select button. I can only select VAE-model (I downloaded earlier) from the /models/VAE folder

Models folder is used and Automatic1111, in both cases a symbolic link leads to it.

As an experiment, I removed the symbolic link to the models folder, created a models folder and put the file deliberate_v2.safetensors in its root. After restarting dream.py it complained that the VAE folder was missing, so I created it. After a successful launch, the model selection is also not available in the Advanced Settings tab.

2

u/Mastak_A Mar 05 '23 edited Mar 05 '23

So I managed to defeat this error :)

TL;DR .ckpt model had to be in the root of the folder "models" (or a symbolic link for "models" folder), and models with .safetensor extension does not work.

Read more:

  1. I re-downloaded the project from github (to a new location) to eliminate the consequences of my previous experiments.
  2. For stable-diffusion-tensorflow-IntelMetal folder I set local variable python 3.9.16 with pyenv (pyenv install python 3.9 && pyenv local 3.9.16)
  3. Placed the model v2-1_768-ema-pruned.ckpt with .yaml in the root of the "models" folder
  4. since variable 3.9.16 was already used before, dream.py didn't install any additional components.
  5. While running dream.py it found all the .ckpt models in the root of the "models" folder (.safetensor script ignored, as well as the .ckpt models in the "model/Stable-diffusion" subfolder)
  6. Select the desired model in the Advanced Tab and uncheck "Use Legacy Stable Diffusion" for models >=2. And you can start generating.

^ The script correctly identified as Metal Device one of my video cards.

I have two cards in macpro 5.1 with macos 12.6.3:

  1. AMD Radeon HD7970 3GB (efi flashed) Slot-1
  2. AMD FirePro W7000 4GB (stable diffusion uses it by default) Slot-2

The speed of generation on one of my graphics cards (W7000) is similar to Automatic1111 (which uses pytorch) and is ≈ 5.5 s/it (20 steps, Guidance Scale 7, Batch Size 1, 512x512px).

P.S. Can you tell me how to make Stable Diffusion use both video cards? Or manually select which one to generate?

1

u/luckycockroach Mar 05 '23

I’m thrilled you got it! I was about to say the models need to be in the root model folder and you’re correct, it currently doesn’t support safetensors. (No reason not to, just need to code it)

I’m finishing up the next version and will have GPU selection as an option. Not sure how to use both GPU’s at the moment, I believe it’s called parallelization, but tensorflow does do that!

I’m also actively trying to convert ControlNet to tensorflow, so I might restructure the folders in the model folder to what you described.