Skip to content

Commit

Permalink
Revert to using docker-compose commands, since ./server wasn't workin…
Browse files Browse the repository at this point in the history
…g reliably on some platforms
  • Loading branch information
cmdr2 committed Aug 27, 2022
1 parent 7c60189 commit b860dbd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ All the processing will happen on your computer locally, it does not transmit yo

# Installation
1. Clone this repository: `git clone https://github.com/cmdr2/stable-diffusion-ui.git` or [download the zip file](https://github.com/cmdr2/stable-diffusion-ui/archive/refs/heads/main.zip) and unzip.
2. Open your terminal, and in the project directory run: `./server` (warning: this will take some time during the first run, since it'll download Stable Diffusion's [docker image](https://replicate.com/stability-ai/stable-diffusion), nearly 17 GiB)
2. Open your terminal, and in the project directory run: `docker-compose up &` (warning: this will take some time during the first run, since it'll download Stable Diffusion's [docker image](https://replicate.com/stability-ai/stable-diffusion), nearly 17 GiB)
3. Open http://localhost:9000 in your browser. That's it!

If you're getting errors, please check the [Troubleshooting](https://github.com/cmdr2/stable-diffusion-ui/wiki/Troubleshooting) page.

To stop the server, please run `./server stop`
To stop the server, please run `docker-compose down`

# Usage
Open http://localhost:9000 in your browser (after running `./server` from step 2 previously).
Open http://localhost:9000 in your browser (after running `docker-compose up &` from step 2 previously).

## With a text description
1. Enter a text prompt, like `a photograph of an astronaut riding a horse` in the textbox.
Expand Down
2 changes: 0 additions & 2 deletions old_port_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ def read_root():
</style>
<h4>The UI has moved to <a href="http://localhost:9000">http://localhost:9000</a>. The current address that you used (ending with :8000) will be removed in the future, so please use <a href="http://localhost:9000">http://localhost:9000</a> going ahead (and in any bookmarks you've saved).</h4>
<h4>Also, please use <pre>./server</pre> instead of <pre>docker-compose up &amp;</pre>. To stop, please use <pre>./server stop</pre>. This will help the project better manage the startup process in the future.</h4>
<h3>Why has the address changed?</h3>
<p>The previously used port (8000) is often used by other servers, which results in port conflicts. So the project's port number has been changed, while the project is still young. Otherwise port-conflicts with 8000 will be a common source of new-user issues in the future.</p>
<p>Sorry about this, and apologies for the inconvenience :)</p>
Expand Down
25 changes: 1 addition & 24 deletions server
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
#!/bin/bash

CMD="$1"
if [ -z "$1" ]; then
CMD="start"
fi

start_server() {
docker-compose up -d stable-diffusion-old-port-redirect # old port 8000 server, show redirect notice
docker-compose up stability-ai stable-diffusion-ui
}

stop_server() {
docker-compose down
}

if [ "$CMD" == "start" ]; then
start_server
elif [ "$CMD" == "stop" ]; then
stop_server
elif [ "$CMD" == "restart" ]; then
stop_server
start_server
else
echo "Unknown option: $1 (Expected start or stop)"
fi
echo "Please use 'docker-compose up &' to start the server, and 'docker-compose down' to stop the server"

0 comments on commit b860dbd

Please sign in to comment.