Make model prefetching automatic in install/run scripts

install-local-gpu.sh and bring-up-local-gpu.sh now call
prefetch-models.sh --sdxl (host-side download, all models including
SDXL/inpaint, ~13GB) automatically rather than treating it as a manual
DNS-troubleshooting step. install-local-gpu.sh drops back to the
invoking user via sudo -u "$SUDO_USER" -H before running it, since
that script itself runs as root and would otherwise leave downloaded
files root-owned. Both call sites are non-fatal: a prefetch failure
logs a warning and the container still starts, falling back to its
own in-container download attempt.

Updated README to match.
This commit is contained in:
Claude
2026-06-18 17:47:18 +00:00
parent b4a790473c
commit 3f4a6b754c
3 changed files with 34 additions and 10 deletions
+8 -3
View File
@@ -4,9 +4,11 @@
# Run this each time you want to start the app.
# Run ./install-local-gpu.sh once first on a new machine.
#
# If models fail to download inside the container (DNS/firewall blocked),
# run ./prefetch-models.sh first — it downloads them on the host into
# ./data/, which this container already bind-mounts, so no rebuild needed.
# Before starting, this fetches any missing models on the host (outside
# Docker) via ./prefetch-models.sh — in-container DNS/network is unreliable
# on some hosts, so this is the default now, not a manual troubleshooting
# step. It never blocks startup: if it fails (no network, no python3, etc.)
# the container still starts and falls back to its own in-container download.
#
# Usage:
# ./bring-up-local-gpu.sh # start (detached, rebuild if needed)
@@ -29,6 +31,9 @@ cd "$(dirname "$0")"
mkdir -p data/models data/hf_cache data/projects data/patches
if [ $# -eq 0 ]; then
# Best-effort: fetch any missing models on the host first (see header).
./prefetch-models.sh --sdxl \
|| echo "⚠ Model prefetch had failures (see above) — continuing anyway, the container will retry in-container."
exec docker compose -f docker-compose.gpu.yml up -d --build
else
exec docker compose -f docker-compose.gpu.yml "$@"