| #!/bin/bash |
|
|
| |
| WEBUI_HOME_DIR="$HOME/webui" |
|
|
| |
| |
| if [ ! -d "${WEBUI_HOME_DIR}/.git" ]; then |
| |
| git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui /tmp/webui_temp |
| mv /tmp/webui_temp/* /tmp/webui_temp/.git* "${WEBUI_HOME_DIR}" |
| rm -rf /tmp/webui_temp |
| fi |
|
|
| |
| if [ ! -f "ui-config.json" ]; then |
|
|
| |
| sudo apt-get update |
| sudo apt-get install --no-install-recommends google-perftools -y |
|
|
| cd "${WEBUI_HOME_DIR}" |
| |
| |
| sed -i 's/#export COMMANDLINE_ARGS=""/export COMMANDLINE_ARGS="--share --no-half-vae --listen --api --xformers --no-download-sd-model --disable-nan-check"/' webui-user.sh |
| wget https://huggingface.co/kiriyamaX/webui-configs/resolve/main/config_sdxl_v2.json -O config.json |
| wget https://huggingface.co/kiriyamaX/webui-configs/resolve/main/ui-config_sdxl_v2.json -O ui-config.json |
|
|
| |
| cd extensions |
| git clone https://github.com/picobyte/stable-diffusion-webui-wd14-tagger |
| git clone https://github.com/AlUlkesh/stable-diffusion-webui-images-browser |
| git clone https://github.com/hako-mikan/sd-webui-supermerger |
| git clone https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111 |
| git clone https://github.com/arenatemp/stable-diffusion-webui-model-toolkit |
|
|
| |
| WEBUI_PY_FILE="${WEBUI_HOME_DIR}/webui.py" |
| |
| |
| |
| NEW_LINE=" blocked_paths=[\"/home/ubuntu/webui/models\"]," |
| |
| |
| if ! grep -q "blocked_paths" "$WEBUI_PY_FILE"; then |
| |
| sed -i "/app_kwargs={/i $NEW_LINE" "$WEBUI_PY_FILE" |
| fi |
| fi |
|
|
| cd "${WEBUI_HOME_DIR}" |
| ./webui.sh |
|
|
|
|
|
|