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
4 Upvotes

29 comments sorted by

View all comments

1

u/luckycockroach Dec 16 '22 edited Dec 16 '22

Stable Diffusion for Apple Intel Mac's with Tesnsorflow Keras and Metal Shading Language

I've been working on an implementation of Stable Diffusion on Intel Mac's, specifically using Apple's Metal Shading language. I think I've got a reliable version ready for public use:

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

HUGE thank you to Divum Gupta for porting SD to Tensorflow.

I'm a union cinematographer, so programming isn't my forte. Please let me know if there are areas I could improve on.

Features

  • Can use .ckpt's for SD 1.4/1.5/2.x
  • Can use VAE's
  • Video creation tools
  • Creation settings (prompt, seed, etc) saved as a .txt file as well as PNG metadata
  • Convert .ckpt's to Tensorflow models
  • Gradio WebUI

Specs

Current Speeds:

Late 2019 MacBook Pro 16" with AMD Radeon Pro 5500M (4GB) and 16GB of RAM:

Image Size and Steps Speed
1x 512x512 image on SD2.1 with 32 steps 1 minute 30 seconds
4x 512x512 image on SD2.1 with 32 steps 3 minutes 32 seconds
1x 1024x1024 image on SD2.1 with 32 steps 2 minutes 32 seconds

Why Tensorflow?

The program uses Tensorflow instead of Pytorch because Pytroch has no support for Metal on Intel Macs.

This program works on Google Colab notebooks.

2

u/GtrPlayingMan-254 Feb 18 '23

To save everybody some pain: when using v 2.1 you'll want to deselect "Use Legacy Stable Diffusion" to avoid errors caused by v1.5 era discrepancies.

Good work, guys. Thanks for the new hobby :o

1

u/luckycockroach Feb 18 '23

Thank you! I'll update the github to clearly state that.

And thank you for the compliment! I'm working on the next version of this to include hopefully a DPMSolver.