Spaces:
Running
Running
fix: pre-download RMBG-1.4 model during build to avoid runtime network errors; fix import path ezclean.plugins
b47b550 | FROM python:3.9-slim | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 | |
| RUN apt-get update && apt-get install -y \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt README.md setup.py main.py ./ | |
| COPY ezclean ./ezclean | |
| COPY iopaint ./iopaint | |
| RUN pip install --upgrade pip && \ | |
| pip install -r requirements.txt | |
| RUN mkdir -p /app/models /app/input && \ | |
| chmod 777 /app/models /app/input | |
| # Pre-download AI models during build so they are cached in the image | |
| # and don't need to be fetched at runtime (avoids timeout/network issues) | |
| RUN python -c "from huggingface_hub import hf_hub_download; hf_hub_download('briaai/RMBG-1.4', 'model.pth'); print('RMBG-1.4 model downloaded OK')" | |
| EXPOSE 7860 | |
| CMD ["python", "main.py", "start", "--model=lama", "--device=cpu", "--host=0.0.0.0", "--port=7860", "--model-dir=/app/models", "--enable-remove-bg", "--remove-bg-model=briaai/RMBG-1.4", "--enable-realesrgan", "--enable-interactive-seg", "--interactive-seg-model=sam2_1_tiny"] | |