StableDiffusion/DockerFile

21 lines
623 B
Text
Raw Normal View History

2023-09-13 16:30:01 +00:00
FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-devel
RUN apt update && apt install --yes git ffmpeg libsm6 libxext6
# Create conda environment
RUN git clone https://github.com/Stability-AI/stablediffusion.git
WORKDIR /workspace/stablediffusion/
# Overwrite the environment.yaml file
COPY environment.yaml .
RUN conda env create -f environment.yaml
# Make RUN commands use the new environment:
SHELL ["conda", "run", "-n", "ldm", "/bin/bash", "-c"]
# Install xformers for memory efficient flash attention
RUN conda install xformers -c xformers/label/dev
RUN conda init bash
RUN echo "conda activate ldm" >> $HOME/.bashrc