diff --git a/DockerFile b/DockerFile new file mode 100644 index 0000000..c71f7ca --- /dev/null +++ b/DockerFile @@ -0,0 +1,21 @@ +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 \ No newline at end of file diff --git a/environment.yaml b/environment.yaml index 4687b30..bd4468a 100644 --- a/environment.yaml +++ b/environment.yaml @@ -3,7 +3,8 @@ channels: - pytorch - defaults dependencies: - - python=3.8.5 + # Changed to Python 3.9 to make use of precompiled binaries for xformers + - python=3.9 - pip=20.3 - cudatoolkit=11.3 - pytorch=1.12.1