howto:stashface
This is an old revision of the document!
Stashface
https://huggingface.co/spaces/cc1234/stashface
Clone repo:
# Make sure git-lfs is installed (https://git-lfs.com) sudo apt-get install git-lfs git clone https://huggingface.co/spaces/cc1234/stashface
Run locally:
docker run -it -p 7860:7860 --platform=linux/amd64 \ -e VISAGE_KEY="YOUR_VALUE_HERE" \ registry.hf.space/cc1234-stashface:latest python src/app.py
or
- docker-compose.yaml
name: stashface services: stashface: image: registry.hf.space/cc1234-stashface:latest container_name: stashface command: python app.py ports: - 8126:7860 environment: - VISAGE_KEY=xxx restart: unless-stopped
- Dockerfile
FROM docker.io/library/python:3.10@sha256:e2c7fb05741c735679b26eda7dd34575151079f8c615875fbefe401972b14d85 RUN apt-get update && apt-get install -y fakeroot && mv /usr/bin/apt-get /usr/bin/.apt-get && echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && chmod +x /usr/bin/apt-get && rm -rf /var/lib/apt/lists/* && useradd -m -u 1000 user COPY --chown=1000:1000 --from=root / / WORKDIR /home/user/app RUN apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* && git lfs install RUN pip install --no-cache-dir pip -U && pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf_xet>=1.0.0,<2.0.0" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0" RUN apt-get update && apt-get install -y curl && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* && apt-get clean RUN --mount=target=/tmp/requirements.txt,source=requirements.txt pip install --no-cache-dir -r /tmp/requirements.txt RUN pip install --no-cache-dir gradio[oauth]==5.25.2 "uvicorn>=0.14.0" spaces COPY --link --chown=1000 ./ /home/user/app RUN pip freeze > /tmp/freeze.txt COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt /tmp/freeze.txt
Run locally natively:
# Clone repository git clone https://huggingface.co/spaces/cc1234/stashface cd stashface # Create and activate Python environment python -m venv env source env/bin/activate # Install dependencies and run pip install -r requirements.txt python src/app.py
Deprecated Visage version:
https://github.com/cc1234475/visage
Visage Stash plugin:
https://github.com/stashapp/CommunityScripts/tree/main/plugins/visage
Required changes to endpoints:
- stashdir/config/plugins/visage/visage.js
let VISAGE_API_URL = "https://cc1234-stashface.hf.space/api/predict";
- stashdir/config/plugins/visage/visage.yml
connect-src: - "https://cc1234-stashface.hf.space"
Visage-ML:
https://github.com/badde57/visage-ml
howto/stashface.1745095360.txt.gz · Last modified: 2025/04/19 21:42 by Wulf Rajek