stable-diffusion-docker icon indicating copy to clipboard operation
stable-diffusion-docker copied to clipboard

Why based on tensorflow while diffusser is a Pytorch model?

Open fengwang opened this issue 1 year ago • 3 comments

Maybe use another base docker instead of tensorflow(https://github.com/fboulnois/stable-diffusion-docker/blob/2e4a48a3f886171d04016d5083ca930ad9fa9b99/Dockerfile#L1) to enlighten the size of the docker image?

fengwang avatar Sep 01 '22 20:09 fengwang

Good question! I was more familiar with the Tensorflow image. I did some investigation with the official pytorch image and here's what I found out:

  • I benchmarked both and the performance is about equivalent
  • Stable-diffusion using the Pytorch image is 6GB, vs 11.4GB with the Tensorflow image, so you get decent savings
  • The Pytorch image uses Ubuntu 18.04, GCC 7.5, Python 3.7.13, and Conda
  • The Tensorflow image uses Ubuntu 20.04, GCC 9.4.0, Python 3.8.10, and pip
  • I'm not sure how well tested the Pytorch image is, it doesn't have much documentation. On the other hand the Tensorflow image has some documentation, and Google tests against it.

I'm not sure it's worth trading off newer software, ML compatibility, and documentation since disk space is cheap, but I'm open to changing my mind. What do you think?

fboulnois avatar Sep 02 '22 19:09 fboulnois

Why not both?

acrois avatar Sep 05 '22 01:09 acrois

Why not both?

Simplicity and maintenance cost. I'd rather not have to maintain two Dockerfiles and build script commands even if there only a few changes. Standardizing on one Dockerfile also makes debugging issues easier.

fboulnois avatar Sep 05 '22 15:09 fboulnois

I may revisit this when Pytorch releases new images. Until then, I'm closing this issue.

fboulnois avatar Sep 15 '22 01:09 fboulnois