| FROM python:3.10-slim |
|
|
| |
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| git \ |
| git-lfs \ |
| gcc \ |
| python3-dev \ |
| libgl1 \ |
| libglib2.0-0 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN git lfs install |
|
|
| |
| RUN git clone https://github.com/rupeshs/fastsdcpu.git . |
|
|
| |
| RUN mkdir -p /app/.cache/huggingface /app/configs /app/results && \ |
| chmod -R 777 /app/.cache /app/configs /app/results |
|
|
| |
| ENV HF_HOME=/app/.cache/huggingface |
| ENV XDG_CACHE_HOME=/app/.cache |
| ENV OPENVINO_TELEMETRY=0 |
|
|
| |
| RUN python -m venv env && \ |
| . env/bin/activate && \ |
| pip install --upgrade pip && \ |
| pip install torch==2.2.2 --index-url https://download.pytorch.org/whl/cpu && \ |
| pip install -r requirements.txt |
|
|
| |
| RUN git clone https://huggingface.co/latent-consistency/lcm-lora-sdv1-5 /models/lcm-lora-sdv1-5 || \ |
| echo "Model clone failed. Please check network or manually download the model." |
|
|
| |
| RUN echo "/models/lcm-lora-sdv1-5" > configs/lcm-lora-models.txt && \ |
| chmod 666 configs/lcm-lora-models.txt |
|
|
| |
| EXPOSE 8000 |
|
|
| |
| CMD ["/bin/bash", "-c", ". env/bin/activate && python src/app.py --api"] |