Download bootstrap_forge.sh from willseijits/HH12Solo80: direct link, hf CLI and curl.
- Browser
- Download file 2.38 kB
-
https://huggingface.co/willseijits/HH12Solo80/resolve/main/bootstrap_forge.sh
- Command line
-
hf download hf://willseijits/HH12Solo80/bootstrap_forge.sh
-
curl -L -o bootstrap_forge.sh https://huggingface.co/willseijits/HH12Solo80/resolve/main/bootstrap_forge.sh
2.38 kB
| cat > /workspace/bootstrap_forge.sh <<'EOF' | |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| # 1) caches persistentes | |
| mkdir -p /workspace/.cache/pip /workspace/.cache/huggingface | |
| cat > /workspace/env.sh <<'EOS' | |
| export PIP_CACHE_DIR=/workspace/.cache/pip | |
| export HF_HOME=/workspace/.cache/huggingface | |
| export HUGGINGFACE_HUB_CACHE=/workspace/.cache/huggingface/hub | |
| EOS | |
| # carrega env persistente (não repita exports soltos) | |
| source /workspace/env.sh | |
| # 2) repo (idempotente) | |
| REPO_DIR="/workspace/stable-diffusion-webui-forge" | |
| if [ ! -d "$REPO_DIR/.git" ]; then | |
| git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git "$REPO_DIR" | |
| else | |
| git -C "$REPO_DIR" fetch --all --prune | |
| git -C "$REPO_DIR" pull --ff-only | |
| fi | |
| # 3) venv persistente (herda torch do template) | |
| if [ ! -d /workspace/venv-hh ]; then | |
| python3.10 -m venv --system-site-packages /workspace/venv-hh | |
| fi | |
| source /workspace/venv-hh/bin/activate | |
| python -m pip install -U pip wheel | |
| # 4) deps de sistema (necessárias para pycairo) | |
| export DEBIAN_FRONTEND=noninteractive | |
| apt-get update | |
| apt-get install -y --no-install-recommends pkg-config libcairo2-dev python3.10-dev cmake | |
| rm -rf /var/lib/apt/lists/* | |
| # 5) deps Python que te deram erro antes | |
| python -m pip install -U joblib gdown | |
| python -m pip install -U pycairo svglib | |
| # 6) requirements do Forge (sem forçar reinstalar torch) | |
| cd "$REPO_DIR" | |
| grep -vE '^(torch|torchvision|torchaudio)\b' requirements_versions.txt > /workspace/req-no-torch.txt | |
| python -m pip install -r /workspace/req-no-torch.txt | |
| # 7) fixa o venv_dir de forma persistente para o webui.sh | |
| cat > "$REPO_DIR/webui-user.sh" <<'EOW' | |
| venv_dir="/workspace/venv-hh" | |
| EOW | |
| mkdir /workspace/stable-diffusion-webui-forge/models/ESRGAN | |
| cd /workspace/stable-diffusion-webui-forge/models/ESRGAN | |
| wget https://huggingface.co/willseijits/HH12Solo80/resolve/main/4xUltrasharp_4xUltrasharpV10.pth | |
| # 8) cria um "starter" para reinícios (ver abaixo) | |
| cat > /workspace/start_forge.sh <<'EOS' | |
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| source /workspace/env.sh | |
| source /workspace/venv-hh/bin/activate | |
| cd /workspace/stable-diffusion-webui-forge | |
| # Ajuste flags conforme seu risco/necessidade: | |
| ./webui.sh -f --listen --port 7860 --enable-insecure-extension-access | |
| EOS | |
| chmod +x /workspace/start_forge.sh | |
| echo "OK. Para iniciar (ou reiniciar) o Forge: bash /workspace/start_forge.sh" | |
| EOF | |
| bash /workspace/bootstrap_forge.sh | |