From 37b747258a67a036f4d6502d45f81fef7b1654b4 Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Mon, 31 Aug 2026 09:04:40 +0200 Subject: [PATCH] snapotter: seed AI venv base packages on arm64, warn amd64 has no working CPU bundle --- ct/snapotter.sh | 11 ++++++++++- install/snapotter-install.sh | 19 +++++++++++++------ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ct/snapotter.sh b/ct/snapotter.sh index ce2323f8f..2b7ccaa2c 100644 --- a/ct/snapotter.sh +++ b/ct/snapotter.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main" +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") # Copyright (c) 2021-2026 community-scripts ORG # Author: MickLesk (CanbiZ) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE @@ -86,6 +88,13 @@ EOF msg_info "Updating SnapOtter" $STD uv python install 3.11 $STD uv venv --seed --python 3.11 /opt/snapotter_data/ai/venv + if [[ "$(arch_resolve)" == "arm64" ]]; then + $STD uv pip install --python /opt/snapotter_data/ai/venv/bin/python \ + numpy==1.26.4 Pillow==12.3.0 opencv-python-headless==4.10.0.84 fonttools \ + 'huggingface-hub[hf_xet,hf_transfer]==0.36.2' + else + msg_warn "SnapOtter AI Features have no working CPU-only bundle for amd64 upstream (published bundle is Python 3.12/GPU-CUDA only). Use the official Docker image instead: https://docs.snapotter.com" + fi ln -sfn /opt/snapotter /app msg_ok "Updated SnapOtter" diff --git a/install/snapotter-install.sh b/install/snapotter-install.sh index b8330b7ca..67609fe07 100644 --- a/install/snapotter-install.sh +++ b/install/snapotter-install.sh @@ -34,7 +34,12 @@ $STD apt install -y \ python3 \ python3-dev \ gcc \ - g++ + g++ \ + libavif-bin \ + libavif-dev \ + libopencv-dev \ + python3-opencv \ + libgles2 msg_ok "Installed Dependencies" PYTHON_VERSION="3.11" setup_uv @@ -59,11 +64,13 @@ msg_info "Setting up Python Environment" mkdir -p /opt/snapotter_data/ai/models/rembg $STD uv python install 3.11 $STD uv venv --seed --python 3.11 /opt/snapotter_data/ai/venv -#if [[ -f /opt/snapotter/packages/ai/python/requirements.txt ]]; then -# $STD uv pip install \ -# --python /opt/snapotter_data/ai/venv/bin/python \ -# -r /opt/snapotter/packages/ai/python/requirements.txt -#fi +if [[ "$(arch_resolve)" == "arm64" ]]; then + $STD uv pip install --python /opt/snapotter_data/ai/venv/bin/python \ + numpy==1.26.4 Pillow==12.3.0 opencv-python-headless==4.10.0.84 fonttools \ + 'huggingface-hub[hf_xet,hf_transfer]==0.36.2' +else + msg_warn "SnapOtter AI Features have no working CPU-only bundle for amd64 upstream (published bundle is Python 3.12/GPU-CUDA only). Use the official Docker image instead: https://docs.snapotter.com" +fi ln -sfn /opt/snapotter /app msg_ok "Set up Python Environment"