chore(taskfile): add missing model, fix env file commenting, and only run download if changed

This commit is contained in:
Sheldon Hull 2022-09-13 11:32:21 -05:00
parent 8d0718fc0e
commit 8361841a4a
2 changed files with 32 additions and 16 deletions

View file

@ -1,4 +1,8 @@
UI=hlky # The most popular fork, Repo # The most popular fork, Repo
# UI=auto # Another great fork, many features with neat UI, Repo UI=hlky
# UI=auto # cpu: for users without a GPU. # Another great fork, many features with neat UI, Repo
# UI=lstein # One of the earliest forks, the UI is simple but has a lot of potential, Repo # UI=auto
# cpu: for users without a GPU.
# UI=auto
# One of the earliest forks, the UI is simple but has a lot of potential, Repo
# UI=lstein

View file

@ -1,6 +1,6 @@
version: '3' version: '3'
# silent: true # silent: true
output: prefixed output: group
dotenv: [.env] dotenv: [.env]
# Default environment variables for projects # Default environment variables for projects
@ -16,23 +16,31 @@ tasks:
- task: list - task: list
list: list:
desc: list tasks desc: list tasks
prefix: ' '
cmds: cmds:
- task --list - task --list --color=true --list-all
vars: vars:
desc: variable output desc: variable output
cmds: cmds:
- | - |
echo -e "{{.light_gray}}=== {{ .reversed }} Variable Info from Task {{ .nocolor }} === " echo -e "{{.light_gray}}=== {{ .reversed }} Variable Info from Task {{ .nocolor }} === "
echo -e "{{.light_gray}}ARTIFACT_DIRECTORY {{.nocolor}}: {{ .orange}}{{ .ARTIFACT_DIRECTORY }} {{ .nocolor }}" echo -e "{{.light_gray}}ARTIFACT_DIRECTORY {{.nocolor}}: {{ .orange}}{{ .ARTIFACT_DIRECTORY }} {{ .nocolor }}"
build:
### Core Task ###
init:
desc: Download models, build initial docker-compose setup
cmds:
- task: download
- task: update
compose:build:
desc: setup tooling for project and download dependencies desc: setup tooling for project and download dependencies
cmds: cmds:
- | - |
docker compose --profile download up --build docker compose --profile download up --build
up: compose:up:
desc: docker compose --profile {{ .UI }} up desc: 'compose up with the current profile of: {{ .UI }}'
cmds: cmds:
- docker compose up - docker compose --profile {{ .UI }} up
update: update:
desc: run updates desc: run updates
interactive: true interactive: true
@ -43,17 +51,21 @@ tasks:
download: download:
desc: get extras downloaded desc: get extras downloaded
cmds: cmds:
# curl --progress-bar -C - https://www.googleapis.com/storage/v1/b/aai-blog-files/o/sd-v1-4.ckpt?alt=media -o {{ .MODEL_DIRECTORY }}/models/model.ckpt
- | - |
echo '👉 This might take a few minutes. However, it will resume downloading if interuppted and ran again'
mkdir -p cache/models || true mkdir -p cache/models || true
curl --progress-bar -C - https://www.googleapis.com/storage/v1/b/aai-blog-files/o/sd-v1-4.ckpt?alt=media -o {{ .MODEL_DIRECTORY }}/model.ckpt
curl --progress-bar -C - https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -o {{ .MODEL_DIRECTORY }}/GFPGANv1.3.pth curl --progress-bar -C - https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth -o {{ .MODEL_DIRECTORY }}/GFPGANv1.3.pth
curl --progress-bar -C - https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -o {{ .MODEL_DIRECTORY }}/RealESRGAN_x4plus.pth curl --progress-bar -C - https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth -o {{ .MODEL_DIRECTORY }}/RealESRGAN_x4plus.pth
curl --progress-bar -C - https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth -o {{ .MODEL_DIRECTORY }}/RealESRGAN_x4plus_anime_6B.pth curl --progress-bar -C - https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth -o {{ .MODEL_DIRECTORY }}/RealESRGAN_x4plus_anime_6B.pth
curl --progress-bar -C - https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth -o {{ .MODEL_DIRECTORY }}/RealESRGAN_x2plus.pth curl --progress-bar -C - https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.1/RealESRGAN_x2plus.pth -o {{ .MODEL_DIRECTORY }}/RealESRGAN_x2plus.pth
curl --progress-bar -C - https://heibox.uni-heidelberg.de/f/578df07c8fc04ffbadf3/?dl=1 -o {{ .MODEL_DIRECTORY }}/LDSR.ckpt curl --progress-bar -C - https://heibox.uni-heidelberg.de/f/578df07c8fc04ffbadf3/?dl=1 -o {{ .MODEL_DIRECTORY }}/LDSR.ckpt
curl --progress-bar -C - https://heibox.uni-heidelberg.de/f/31a76b13ea27482981b4/?dl=1 -o {{ .MODEL_DIRECTORY }}/LDSR.yaml curl --progress-bar -C - https://heibox.uni-heidelberg.de/f/31a76b13ea27482981b4/?dl=1 -o {{ .MODEL_DIRECTORY }}/LDSR.yaml
init: status:
desc: Download models, build initial docker-compose setup - test -f {{ .MODEL_DIRECTORY }}/model.ckpt
cmds: - test -f {{ .MODEL_DIRECTORY }}/GFPGANv1.3.pth
- task: download - test -f {{ .MODEL_DIRECTORY }}/RealESRGAN_x4plus.pth
- task: update - test -f {{ .MODEL_DIRECTORY }}/RealESRGAN_x4plus_anime_6B.pth
- test -f {{ .MODEL_DIRECTORY }}/RealESRGAN_x2plus.pth
- test -f {{ .MODEL_DIRECTORY }}/LDSR.ckpt
- test -f {{ .MODEL_DIRECTORY }}/LDSR.yaml