mirror of
https://github.com/ivabus/pantry
synced 2024-11-26 10:25:05 +03:00
sd-webui fixes; add endpoint yamls
This commit is contained in:
parent
eb280e08ba
commit
2dfa90044d
6 changed files with 58 additions and 26 deletions
|
@ -1,21 +1,33 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -emx
|
set -emfo pipefail
|
||||||
|
|
||||||
d="$(cd "$(dirname $0)"/.. && pwd)"
|
tea gum format <<EoMD
|
||||||
|
# loading…
|
||||||
|
|
||||||
|
> *NOTE* this may take a few minutes the first time it runs
|
||||||
|
|
||||||
|
EoMD
|
||||||
|
|
||||||
|
echo # spacer
|
||||||
|
|
||||||
|
d="$(cd "$(dirname $0)" && pwd)"
|
||||||
|
|
||||||
"$d"/bin/stable-diffusion-webui &
|
"$d"/bin/stable-diffusion-webui &
|
||||||
|
|
||||||
# poll into a HEAD request succeeds
|
# poll until a HEAD request succeeds
|
||||||
while ! curl -Is http://127.0.0.1:7860 | grep -q "HTTP/1.1 200 OK"; do
|
while ! curl -Is http://127.0.0.1:7860 | grep -q "HTTP/1.1 200 OK"; do
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
# open the URL once the HEAD request succeeds
|
# open the URL once the HEAD request succeeds
|
||||||
|
# TODO open in a window controlled by the gui (see next section)
|
||||||
open http://127.0.0.1:7860
|
open http://127.0.0.1:7860
|
||||||
|
|
||||||
# tell tea/gui about it
|
# tell tea/gui about it
|
||||||
echo '{"viewer": "http://127.0.0.1:7860"}'
|
if test -n "$TEA_IPC_FD"; then
|
||||||
|
echo '{"viewer": "http://127.0.0.1:7860"}' >&$TEA_IPC_FD
|
||||||
|
fi
|
||||||
|
|
||||||
tea gum format <<EoMD
|
tea gum format <<EoMD
|
||||||
# Stable Diffusion WEBUI
|
# Stable Diffusion WEBUI
|
||||||
|
@ -34,4 +46,6 @@ this package has been modified for your convenience:
|
||||||
enjoy!
|
enjoy!
|
||||||
EoMD
|
EoMD
|
||||||
|
|
||||||
fg
|
echo # spacer
|
||||||
|
|
||||||
|
fg # unbackground the webui process
|
|
@ -1,8 +0,0 @@
|
||||||
diff --color -u a/launch.py b/launch.py
|
|
||||||
--- a/launch.py 2023-04-19 15:28:49
|
|
||||||
+++ b/launch.py 2023-04-19 15:28:56
|
|
||||||
@@ -353,4 +353,3 @@
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
prepare_environment()
|
|
||||||
- start()
|
|
|
@ -34,7 +34,7 @@ build:
|
||||||
# move this installation into its prefix
|
# move this installation into its prefix
|
||||||
- run: |
|
- run: |
|
||||||
mv $OLDWD lib
|
mv $OLDWD lib
|
||||||
mkdir tbin bin
|
mkdir -p bin
|
||||||
mkdir $OLDWD # or breaks brewkit
|
mkdir $OLDWD # or breaks brewkit
|
||||||
working-directory: ${{prefix}}
|
working-directory: ${{prefix}}
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@ build:
|
||||||
# install our scripts and shims
|
# install our scripts and shims
|
||||||
- |
|
- |
|
||||||
cp lib/props/webui-user.sh lib
|
cp lib/props/webui-user.sh lib
|
||||||
cp lib/props/gui.sh tbin
|
cp lib/props/entrypoint.sh .
|
||||||
cp lib/props/stable-diffusion-webui bin
|
cp lib/props/stable-diffusion-webui bin
|
||||||
|
|
||||||
# delete our crap
|
# delete our crap
|
||||||
- rm -rf lib/props lib/xyz.tea.*
|
- rm -rf lib/props lib/xyz.tea.* lib/tea.yaml
|
||||||
|
|
||||||
# we set this as a symlink to ~/.local/share/models in our stub scripts
|
# we set this as a symlink to ~/.local/share/models in our stub scripts
|
||||||
- rm -rf lib/models/Stable-diffusion lib/extensions lib/outputs
|
- rm -rf lib/models/Stable-diffusion lib/extensions lib/outputs
|
||||||
|
@ -63,7 +63,8 @@ build:
|
||||||
|
|
||||||
provides:
|
provides:
|
||||||
- bin/stable-diffusion-webui
|
- bin/stable-diffusion-webui
|
||||||
- tbin/gui.sh
|
|
||||||
|
entrypoint: ./entrypoint.sh
|
||||||
|
|
||||||
test:
|
test:
|
||||||
stable-diffusion-webui --help
|
stable-diffusion-webui --help
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
set -ex
|
set -eo pipefail
|
||||||
|
|
||||||
export install_dir="$(cd "$(dirname $0)"/.. && pwd)"
|
export install_dir="$(cd "$(dirname "$0")"/.. && pwd)"
|
||||||
export clone_dir=lib
|
export clone_dir=lib
|
||||||
|
|
||||||
cd "$install_dir"/"$clone_dir"
|
cd "$install_dir"/"$clone_dir"
|
||||||
|
@ -41,4 +41,27 @@ if ! test -f "$CONFIG"; then
|
||||||
EoJSON
|
EoJSON
|
||||||
fi
|
fi
|
||||||
|
|
||||||
python ./launch.py "$@" --ui-config-file="$CONFIG"
|
#NOTE sourced from brewkit python-venv.sh results
|
||||||
|
export VIRTUAL_ENV="$PWD"/venv
|
||||||
|
|
||||||
|
TEA_PYTHON="$(which python)"
|
||||||
|
TEA_PYHOME="$(dirname "$TEA_PYTHON")"
|
||||||
|
|
||||||
|
cat <<EOSH > "$VIRTUAL_ENV"/pyvenv.cfg
|
||||||
|
home = $TEA_PYHOME
|
||||||
|
include-system-site-packages = false
|
||||||
|
executable = $TEA_PYTHON
|
||||||
|
EOSH
|
||||||
|
|
||||||
|
find "$VIRTUAL_ENV"/bin -maxdepth 1 -type f | xargs \
|
||||||
|
sed -i.bak "1s|.*|#!$VIRTUAL_ENV/bin/python|"
|
||||||
|
|
||||||
|
rm "$VIRTUAL_ENV"/bin/*.bak
|
||||||
|
|
||||||
|
ln -sf "$TEA_PYTHON" "$VIRTUAL_ENV"/bin/python
|
||||||
|
#NOTE.END
|
||||||
|
|
||||||
|
# this is all `activate` in the venv does
|
||||||
|
export PATH="$VIRTUAL_ENV/bin":$PATH
|
||||||
|
|
||||||
|
exec python ./launch.py "$@" --ui-config-file="$CONFIG"
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export install_dir="$(cd "$(dirname $0)"/.. && pwd)"
|
export install_dir="$(cd "$(dirname "$0")"/.. && pwd)"
|
||||||
export clone_dir="lib"
|
export clone_dir="lib"
|
||||||
|
|
|
@ -3,11 +3,14 @@ distributable:
|
||||||
strip-components: 1
|
strip-components: 1
|
||||||
|
|
||||||
versions:
|
versions:
|
||||||
github: muesli/duf/tags
|
github: muesli/duf/tags
|
||||||
|
|
||||||
provides:
|
provides:
|
||||||
- bin/duf
|
- bin/duf
|
||||||
|
|
||||||
|
entrypoint:
|
||||||
|
bin/duf
|
||||||
|
|
||||||
build:
|
build:
|
||||||
script: |
|
script: |
|
||||||
go mod download
|
go mod download
|
||||||
|
@ -27,5 +30,4 @@ build:
|
||||||
- -buildmode=pie
|
- -buildmode=pie
|
||||||
|
|
||||||
test:
|
test:
|
||||||
script: |
|
test "$(duf -version)" = "duf {{version}}"
|
||||||
test "$(duf -version)" = "duf {{version}}"
|
|
||||||
|
|
Loading…
Reference in a new issue