Skip to content

Commit

Permalink
[Examples] Update stable diffusion example (#3593)
Browse files Browse the repository at this point in the history
update SD example
  • Loading branch information
romilbhardwaj authored May 27, 2024
1 parent 90f8e89 commit 5eac063
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/stable_diffusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

4. Run `ssh -L 7860:localhost:7860 stable-diffusion`

5. Open [`http://localhost:7860/`](http://localhost:7860/) in browser.
5. Open [`http://localhost:7860/`](http://localhost:7860/) in browser. If the page doesn't load, try again in a few minutes to allow the container to start.

6. Type in text prompt and click "Generate".

Expand Down
15 changes: 10 additions & 5 deletions examples/stable_diffusion/stable_diffusion_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ file_mounts:
/stable_diffusion: .

setup: |
sudo curl "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
cd stable-diffusion-webui-docker
sudo rm -r stable-diffusion-webui-docker
git clone https://github.com/AbdBarho/stable-diffusion-webui-docker.git
Expand All @@ -17,9 +15,16 @@ setup: |
wget https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt -P models
mv models/sd-v1-4.ckpt models/model.ckpt
docker pull berkeleyskypilot/stable-diffusion
rm docker-compose.yml
cp /stable_diffusion/docker-compose.yml .
run: |
cd stable-diffusion-webui-docker
docker-compose up
docker run -d \
--name model \
--restart on-failure \
-p 7860:7860 \
-v $(pwd)/cache:/cache \
-v $(pwd)/output:/output \
-v $(pwd)/models:/models \
-e CLI_ARGS='--extra-models-cpu --optimized-turbo' \
--gpus all \
berkeleyskypilot/stable-diffusion

0 comments on commit 5eac063

Please sign in to comment.