File size: 1,193 Bytes
93ef7ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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"]