Skip to content

Commit

Permalink
Make directories if they don't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdBarho committed Aug 29, 2022
1 parent 89d8a17 commit 2ecfb0f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ ENV TRANSFORMERS_CACHE=/cache/transformers TORCH_HOME=/cache/torch CLI_ARGS="" \
RealESRGAN_ANIME_PATH=/stable-diffusion/src/realesrgan/experiments/pretrained_models/RealESRGAN_x4plus_anime_6B.pth
EXPOSE 7860
CMD \
(test -f /models/GFPGANv1.3.pth && ln -sf /models/GFPGANv1.3.pth "${GFPGAN_PATH}" && echo "Mounted GFPGAN"); \
(test -f /models/RealESRGAN_x4plus.pth && ln -sf /models/RealESRGAN_x4plus.pth "${RealESRGAN_PATH}" && echo "Mounted RealESRGAN");\
(test -f /models/RealESRGAN_x4plus_anime_6B.pth && ln -sf /models/RealESRGAN_x4plus_anime_6B.pth "${RealESRGAN_ANIME_PATH}" && echo "Mounted RealESRGAN_ANIME"); \
for path in "${GFPGAN_PATH}" "${RealESRGAN_PATH}" "${RealESRGAN_ANIME_PATH}"; do \
name=$(basename "${path}"); \
base=$(dirname "${path}"); \
test -f "/models/${name}" && mkdir -p "${base}" && ln -sf "/models/${name}" "${path}" && echo "Mounted ${name}";\
done;\
# force facexlib cache
mkdir -p /cache/weights/ && rm -rf /opt/conda/lib/python3.8/site-packages/facexlib/weights && \
ln -sf /cache/weights/ /opt/conda/lib/python3.8/site-packages/facexlib/ && \
Expand Down

0 comments on commit 2ecfb0f

Please sign in to comment.