#!/usr/bin/env bash # trellis-mac — TRELLIS.2 MPS/Metal port (local SOTA image-to-3D). Its setup.sh # creates its own .venv (py3.11), clones the mtl* Metal-kernel deps, and builds # them. Gated HF models (facebook/dinov3-vitl16-*, briaai/RMBG-2.0) download at # runtime — the owner must `hf auth login` and request access (usually instant). set -euo pipefail cd "$(dirname "$0")/.." mkdir -p vendor [ -d vendor/trellis-mac ] || git clone --depth 1 https://github.com/shivampkumar/trellis-mac.git vendor/trellis-mac cd vendor/trellis-mac echo "[trellis] downloading Metal toolchain component (may be a no-op if present) ..." xcodebuild -downloadComponent MetalToolchain 2>&1 | tail -3 || echo "[trellis] MetalToolchain step skipped/failed — setup.sh may still succeed" echo "[trellis] running setup.sh (clones mtl* deps, builds Metal kernels, installs torch) ..." echo "[trellis] this is the long pole (~10-20 min). SKIP_METAL=1 fallback available if it fails." bash setup.sh echo "[trellis] verifying ..." [ -x .venv/bin/python ] && .venv/bin/python -c "import torch; print('[trellis] torch', torch.__version__, 'mps', torch.backends.mps.is_available())" echo "[trellis] done — first generate.py run downloads gated HF weights (needs hf auth login)"