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