Skip to content

Commit

Permalink
Cache models before installing extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleykleynhans committed Aug 31, 2023
1 parent 1ed790c commit 2d4deed
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ RUN source /venv/bin/activate && \
python -m install-automatic --skip-torch-cuda-test && \
deactivate

# Cache the Stable Diffusion Models
RUN source /venv/bin/activate && \
python3 cache-sd-model.py --use-cpu=all --ckpt /sd-models/v1-5-pruned.safetensors && \
# SDXL models result in OOM kills with 8GB system memory, probably need 12GB+ to cache these
# python3 cache-sd-model.py --use-cpu=all --ckpt /sd-models/sd_xl_base_1.0.safetensors && \
# python3 cache-sd-model.py --use-cpu=all --ckpt /sd-models/sd_xl_refiner_1.0.safetensors && \
deactivate

# Clone the Automatic1111 Extensions
RUN git clone https://github.com/d8ahazard/sd_dreambooth_extension.git extensions/sd_dreambooth_extension && \
git clone --depth=1 https://github.com/Mikubill/sd-webui-controlnet.git extensions/sd-webui-controlnet && \
Expand Down Expand Up @@ -142,15 +150,6 @@ RUN source /venv/bin/activate && \
pip3 install -r requirements.txt && \
deactivate

# Fails on CPU when Dreambooth extension is installed due to bitsandbytes issue
# Cache the Stable Diffusion Models
#RUN source /venv/bin/activate && \
# python3 cache-sd-model.py --use-cpu=all --ckpt /sd-models/v1-5-pruned.safetensors && \
# SDXL models result in OOM kills with 8GB system memory, probably need 12GB+ to cache these
# python3 cache-sd-model.py --use-cpu=all --ckpt /sd-models/sd_xl_base_1.0.safetensors && \
# python3 cache-sd-model.py --use-cpu=all --ckpt /sd-models/sd_xl_refiner_1.0.safetensors && \
# deactivate

# Fix Tensorboard
RUN source /venv/bin/activate && \
pip3 uninstall -y tensorboard tb-nightly && \
Expand Down

0 comments on commit 2d4deed

Please sign in to comment.