Guest User

Untitled

a guest
Oct 4th, 2022
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. FROM rocm/rocm-terminal
  2.  
  3. USER root
  4. WORKDIR /root
  5.  
  6. # Install font for prompt matrix
  7. COPY data/DejaVuSans.ttf /usr/share/fonts/truetype/
  8.  
  9. RUN apt update && apt install -y python3.8-venv wget
  10.  
  11. RUN python3.8 -m pip install -U pip
  12.  
  13. ENV VIRTUAL_ENV=/root/venv
  14. RUN python3.8 -m venv $VIRTUAL_ENV
  15. ENV PATH="$VIRTUAL_ENV/bin:$PATH"
  16.  
  17. RUN pip install -U pip ruamel.yaml
  18.  
  19. RUN pip install \
  20. --extra-index-url https://download.pytorch.org/whl/rocm5.1.1 \
  21. torch torchvision torchaudio
  22.  
  23. COPY requirements.txt /root/requirements.txt
  24.  
  25. RUN pip install -r requirements.txt
  26.  
  27. ENV PYTHONUNBUFFERED=1
  28. ENV GRADIO_SERVER_NAME=0.0.0.0
  29. ENV GRADIO_SERVER_PORT=7860
  30. EXPOSE 7860
  31.  
  32. ENV PYTHONPATH=/usr/lib/python3.8/site-packages
  33.  
  34. # For some reason taming-transformers doesn't play nicely without an editable install done manually
  35. RUN git clone https://github.com/CompVis/taming-transformers.git && \
  36. cd taming-transformers && \
  37. pip install -e .
  38.  
  39. RUN apt install -y libsm6 libxext6 libxrender-dev
  40.  
  41. RUN pip install jupyterlab ipywidgets traceback-with-variables taichi xeus-python
  42. RUN jupyter nbextension enable --py widgetsnbextension
  43.  
  44. # Install and check stable-diffusion is installed
  45. COPY . /root/stable-diffusion
  46. WORKDIR /root/stable-diffusion
  47. RUN pip install -e .
  48.  
  49. WORKDIR /root
  50.  
  51. RUN python -c "from ldm.util import instantiate_from_config"
  52.  
  53. RUN \
  54. rm -rf /root/stable-diffusion/models \
  55. && ln -sf /data/models /root/stable-diffusion/models
  56.  
  57. RUN \
  58. mkdir /root/stable-diffusion/src \
  59. && ln -sf /data/src/ldsr /root/stable-diffusion/src/latent-diffusion \
  60. && ln -sf /data/src/gfpgan /root/stable-diffusion/src/gfpgan \
  61. && ln -sf /data/src/realesrgan /root/stable-diffusion/src/realesrgan
  62.  
  63. RUN \
  64. mkdir -p /output /root/stable-diffusion/outputs \
  65. && rm -rf /root/stable-diffusion/outputs \
  66. && ln -sf /output/stable-diffusion/outputs /root/stable-diffusion/outputs
  67.  
  68. # Options for gfx1010 (Navi 10) cards
  69. ENV HSA_OVERRIDE_GFX_VERSION=10.3.0
  70.  
  71. ENTRYPOINT [ "/root/stable-diffusion/entrypoint.sh" ]
Advertisement
Add Comment
Please, Sign In to add comment