stable-diffusion-webui/Dockerfile
2024-10-30 23:31:55 -05:00

41 lines
1.4 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Use an official Python runtime as the base image
FROM nvidia/cuda:12.2.2-runtime-ubuntu22.04
# Set environment variables
ENV STABLE_DIFFUSION_API_PORT=7861
ENV WORKDIR /app
# Create a working directory and set permissions
RUN mkdir -p $WORKDIR
WORKDIR $WORKDIR
# Install Python, pip, and other necessary dependencies
RUN apt-get update && \
apt-get install -y python3 python3-pip git wget && \
ln -s /usr/bin/python3 /usr/bin/python && \
rm -rf /var/lib/apt/lists/*
# Clone the stable-diffusion-webui repository
RUN git clone https://github.com/Moonlite-Media/stable-diffusion-webui.git .
# Set up models folder and download required models
RUN mkdir -p models && \
cd models && \
wget -q https://huggingface.co/stabilityai/stable-diffusion-2/resolve/main/768-v-ema.safetensors
# Set up extensions folder and clone repositories
RUN mkdir -p extensions && \
cd extensions && \
git clone https://github.com/cheald/sd-webui-loractl.git && \
git clone https://github.com/Mikubill/sd-webui-controlnet && \
git clone https://github.com/deforum-art/sd-webui-deforum
# Install Python dependencies
COPY requirements.txt .
RUN pip install -r requirements.txt
# Copy the .env file from the GitHub Action if its created at build time
# COPY .env ./.env
# Run the application
CMD ["python", "launch.py", "--nowebui", "--deforum-api", "--api", "--skip-torch-cuda-test"]