From 2a80aea10ce31c9081692c4d516044a29e39a0c5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Wed, 8 Jul 2026 16:37:52 +0200 Subject: Fix pony repo and surface daemon swap failures (Arc integration) Integration on the real Arc B580 uncovered two issues: - The pony repo AstraliteHeart/pony-diffusion-v6-xl is gated (HF returns 401 Repository Not Found), so swaps to it failed. Point the pony key at kitty7779/ponyDiffusionV6XL, an ungated diffusers-format mirror with safetensors weights that loads cleanly via the existing fp16 fallback. - The wrapper swallowed a failed model swap: under set -e the unguarded swap curl aborted the script with exit 0 and no message. Capture the /model response and HTTP status, print the daemon's error, and exit 1 when the swap does not return 200. sdxl, realvis, and pony all verified end to end (one-shot + daemon), output owned by the host user, peak within the 12GB budget. Co-Authored-By: Claude Opus 4.8 --- generate.py | 2 +- imggen | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/generate.py b/generate.py index 9cbc167..95b2dd7 100644 --- a/generate.py +++ b/generate.py @@ -27,7 +27,7 @@ from diffusers import StableDiffusionXLPipeline, AutoencoderKL MODELS = { "sdxl": "stabilityai/stable-diffusion-xl-base-1.0", # default, general "realvis": "SG161222/RealVisXL_V5.0", # photoreal, permissive - "pony": "AstraliteHeart/pony-diffusion-v6-xl", # unrestricted, versatile + "pony": "kitty7779/ponyDiffusionV6XL", # unrestricted, versatile (ungated diffusers-format mirror) } DEFAULT_MODEL = "sdxl" # fp16-fix VAE avoids the fp32 upcast that OOMs a 12GB card at decode time. diff --git a/imggen b/imggen index 749f64a..c5689d4 100755 --- a/imggen +++ b/imggen @@ -95,8 +95,16 @@ if daemon_up; then current="$(curl -s "${BASE}/status" | sed -n 's/.*"model": *"\([^"]*\)".*/\1/p')" if [ "$current" != "$MODEL" ]; then echo "swapping daemon model $current -> $MODEL ..." >&2 - curl -sf -X POST "${BASE}/model" -H 'Content-Type: application/json' \ - -d "{\"name\":\"$MODEL\"}" >/dev/null + # Capture body and status; a failed swap (bad/gated repo, OOM) must be + # surfaced, not silently swallowed by set -e killing the script. + swap_body="$(curl -s -w '\n%{http_code}' -X POST "${BASE}/model" \ + -H 'Content-Type: application/json' -d "{\"name\":\"$MODEL\"}")" + swap_code="${swap_body##*$'\n'}" + swap_msg="${swap_body%$'\n'*}" + if [ "$swap_code" != "200" ]; then + echo "swap to '$MODEL' failed (HTTP $swap_code): $swap_msg" >&2 + exit 1 + fi fi # Build JSON request. jq not assumed; hand-build (values are ours/simple). -- cgit v1.2.3