AbdBarho / stable-diffusion-webui-docker

Easy Docker setup for Stable Diffusion with user-friendly UI
Other
6.6k stars 1.1k forks source link

Build & publish docker image #7

Closed Niek closed 1 year ago

Niek commented 2 years ago

It would be nice to build and publish the docker image on commit, using e.g. https://github.com/marketplace/actions/build-and-push-docker-images

That way, the setup will become a lot easier as well:

curl -fsS https://github.com/AbdBarho/stable-diffusion-webui-docker/raw/master/docker-compose.yml - | docker-compose up -f -
AbdBarho commented 2 years ago

@Niek sounds like a cool idea! I will give it a look in the evening and come back to you.

AbdBarho commented 2 years ago

@Niek I have some questions, and I would like to hear your opinion.

I was wondering how would that work with the model weights. I can put the weights into the docker image, but I question the legality of this approach.

I am considering moving the download of models to the CMD or ENTRYPOINT of the dockerfile, but this defeats the purpose of publishing a docker image, because if the links break, the image is useless...

Do you have any ideas / suggestions?

Niek commented 2 years ago

@AbdBarho You have a volume mount for the models - what you could do is add a small check in CMD where you point users to the model download URL if no model is found and exit 1. It would be nice to automate that but as said that's probably not very legal.

gadicc commented 2 years ago

Hey all. I'm using https://github.com/bananaml/serverless-template-stable-diffusion in another project, and they retrieve the model through a HuggingFace API key that you place in the Dockerfile (which in our case, we could provide via an environment variable on the command line, and do in the ENTRYPOINT, as you say). They explain the process quite nicely in the README, and have a download.py file there.