diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/sd-webui | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/bin/sd-webui b/bin/sd-webui index 0d72547..ffc4c6f 100755 --- a/bin/sd-webui +++ b/bin/sd-webui @@ -57,16 +57,29 @@ case $(printf '%s\n' \ --t5xxl $M/umt5-xxl-encoder-Q8_0.gguf --vae $M/vae/wan2.2_vae.safetensors --cfg-scale 5.0 --steps 30 --flow-shift 5.0 --diffusion-fa -W 1280 -H 704 --video-frames 49 --temporal-tiling) ;; - # imggen's diffusers weights, symlinked into the layout sd.cpp loads as a directory + # imggen's diffusers weights, symlinked into the layout sd.cpp loads as a directory. + # ponytail: broken in sd.cpp 929, which detects an SDXL diffusers directory as + # SD 1.x (leejet/stable-diffusion.cpp#1938); single-file checkpoints load fine. "SDXL base") MODEL=(-m $M/sdxl-links/sdxl "${SDXL[@]}") ;; RealVisXL*) MODEL=(-m $M/sdxl-links/realvis "${SDXL[@]}") ;; - Pony*) MODEL=(-m $M/sdxl-links/pony "${SDXL[@]}" --clip-skip 2) ;; + # The single-file checkpoint, not imggen's directory, for the bug above. + Pony*) MODEL=(-m $M/ponyDiffusionV6XL_v6StartWithThisOne.safetensors "${SDXL[@]}" --clip-skip 2) ;; *) exit 0 ;; esac PORT=${PORT:-7860} URL=http://127.0.0.1:$PORT/ +# Free the GPU: a model llama-server's router holds (Gemma for the assistant) +# left Pony 1.1 GB of 12 GB and failed the first step. Unloading is safe, the +# router loads it again on the next chat request. +# ponytail: one sweep at start; a chat sent while sd-server runs reloads it. +LLAMA=${LLAMA_URL:-http://127.0.0.1:8181} +for id in $(curl -sf -m 5 "$LLAMA/models" | jq -r '.data[] | select(.status.value != "unloaded") | .id'); do + curl -sf -m 30 -X POST "$LLAMA/models/unload" -H 'Content-Type: application/json' \ + -d "$(jq -nc --arg m "$id" '{model: $m}')" >/dev/null && echo "sd-webui: unloaded $id from llama-server" +done + # Open the browser once the server answers (model loading takes a while). ( until curl -sf -o /dev/null "$URL"; do sleep 1; done |
