aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-23 13:58:46 +0200
committerDanilo M. <danix@danix.xyz>2026-10-23 13:58:46 +0200
commit62062df913cc6843ccf3019b8a9526e86500f11f (patch)
tree61bfb6774ff80e09cf63500b77fc3949e03ff4be
parentcb475eca2599f38ed47a6ccdc4d0f010e99933c1 (diff)
downloadrofi-scripts-62062df913cc6843ccf3019b8a9526e86500f11f.tar.gz
rofi-scripts-62062df913cc6843ccf3019b8a9526e86500f11f.zip
sd-webui: Pony from its single file; unload llama-server's models first
sd.cpp 929 detects an SDXL diffusers directory as SD 1.x and fails its metadata validation (leejet/stable-diffusion.cpp#1938): all three of imggen's SDXL directories do. Pony now loads from the single-file checkpoint, which detects as SDXL; SDXL base and RealVis stay broken until the upstream fix, noted beside them. Before sd-server starts, every model llama-server's router holds is unloaded: a resident Gemma left 1.1 GB of 12 GB free and the first unet segment failed. Unloading is safe, the router loads it again on the next chat request; a chat sent while sd-server runs does bring it back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
-rwxr-xr-xbin/sd-webui17
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