pixelforge-upscale / Dockerfile
revirevyrevy's picture
Deploy PixelForge SUPIR generative upscale engine
93ef7ce verified
Raw
History Blame Contribute Delete
1.19 kB
# PixelForge AI upscale engine — Hugging Face Space (Docker SDK).
#
# Deploy with the Docker SDK and pick the ZeroGPU hardware tier (free) — see
# README.md for the exact click-path. The model weights (~9.5 GB for SUPIR)
# are downloaded at runtime on first request, not baked into the image, so
# deploys stay fast and the image stays small.
#
# Port 7860 is the HF Spaces default.
FROM python:3.11-slim
# git (SUPIR code clone at first request) + libgl1/glib (opencv/pillow needs).
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
# --extra-index-url not needed: PyPI torch wheels bundle CUDA 12.x.
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
COPY engines/ engines/
# The SUPIR codebase (~40 MB of Python) is cloned on first use into /supir
# (see engines/supir_engine.py). /data holds downloaded weights across
# restarts on hardware that keeps the disk.
ENV SUPIR_REPO_DIR=/supir \
WEIGHTS_DIR=/data/weights \
HF_HOME=/data/hf
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]