infinipaint/linuxinstall/bundle-rembg.sh
copilot 1c1d63f376
Some checks are pending
Windows Release / windows-x86_64 (push) Waiting to run
Ship 0.8 fog/freistellen and fix Windows CI for friends
Publish the portable zip to public Forgejo from the private GitHub
builder, and force Ninja so MSVC 195 deps build without CMake 4.2.
2026-10-25 18:07:47 +01:00

27 lines
1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Place rembg CLI + models next to an InfiniPaint install so Schnell/Allgemein
# work without a global PATH dependency. Missing tools are skipped; the UI greys out.
set -euo pipefail
DEST="${1:?usage: bundle-rembg.sh DEST_DIR}"
mkdir -p "$DEST"
TOWER="${TOWER_REMBG_VENV:-$HOME/.local/share/tower-rembg}"
MODELS_SRC="${REMBG_HOME:-$HOME/.rembg}"
if [[ -x "$TOWER/bin/rembg" ]]; then
ln -sfn "$TOWER" "$DEST/rembg"
echo "Linked rembg CLI: $DEST/rembg -> $TOWER"
elif [[ -x "$TOWER/Scripts/rembg.exe" ]]; then
ln -sfn "$TOWER" "$DEST/rembg"
echo "Linked rembg CLI: $DEST/rembg -> $TOWER"
else
echo "No tower-rembg venv at $TOWER — Schnell/Allgemein will be unavailable unless rembg is on PATH."
fi
if [[ -d "$MODELS_SRC/models" ]]; then
mkdir -p "$DEST/rembg-home"
ln -sfn "$MODELS_SRC/models" "$DEST/rembg-home/models"
echo "Linked rembg models: $DEST/rembg-home/models -> $MODELS_SRC/models"
else
echo "No rembg models at $MODELS_SRC/models — download with: rembg d silueta && rembg d bria-rmbg"
fi