-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update base to v2. Build for InvokeAI v4.2.4
- Loading branch information
1 parent
829a05f
commit 40f7a2f
Showing
49 changed files
with
241 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
workspace | ||
*__pycache__ | ||
build/COPY_ROOT_EXTRA/ | ||
config/authorized_keys | ||
config/rclone | ||
tpdocs | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/false | ||
|
||
build_amd_main() { | ||
build_amd_install_torch | ||
build_common_run_tests | ||
} | ||
|
||
build_amd_install_torch() { | ||
"$INVOKEAI_VENV_PIP" install --no-cache-dir \ | ||
numpy'<2' \ | ||
torch==${PYTORCH_VERSION} \ | ||
torchvision \ | ||
torchaudio \ | ||
--extra-index-url=https://download.pytorch.org/whl/rocm${ROCM_VERSION} | ||
} | ||
|
||
build_amd_main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/false | ||
|
||
source /opt/ai-dock/etc/environment.sh | ||
|
||
build_common_main() { | ||
build_common_create_venv | ||
} | ||
|
||
build_common_create_venv() { | ||
apt-get update | ||
$APT_INSTALL \ | ||
"python${PYTHON_VERSION}" \ | ||
"python${PYTHON_VERSION}-dev" \ | ||
"python${PYTHON_VERSION}-venv" | ||
|
||
"python${PYTHON_VERSION}" -m venv "$INVOKEAI_VENV" | ||
"$INVOKEAI_VENV_PIP" install --no-cache-dir \ | ||
ipykernel \ | ||
ipywidgets | ||
"$INVOKEAI_VENV_PYTHON" -m ipykernel install \ | ||
--name="invokeai" \ | ||
--display-name="Python${PYTHON_VERSION} (invokeai)" | ||
# Add the default Jupyter kernel as an alias of invokeai | ||
"$INVOKEAI_VENV_PYTHON" -m ipykernel install \ | ||
--name="python3" \ | ||
--display-name="Python3 (ipykernel)" | ||
} | ||
|
||
|
||
build_common_run_tests() { | ||
installed_pytorch_version=$("$INVOKEAI_VENV_PYTHON" -c "import torch; print(torch.__version__)") | ||
if [[ "$installed_pytorch_version" != "$PYTORCH_VERSION"* ]]; then | ||
echo "Expected PyTorch ${PYTORCH_VERSION} but found ${installed_pytorch_version}\n" | ||
exit 1 | ||
fi | ||
} | ||
|
||
build_common_main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/false | ||
|
||
build_cpu_main() { | ||
build_cpu_install_torch | ||
build_common_run_tests | ||
} | ||
|
||
build_cpu_install_torch() { | ||
"$WEBUI_VENV_PIP" install --no-cache-dir \ | ||
torch==${PYTORCH_VERSION} \ | ||
torchvision \ | ||
torchaudio \ | ||
--extra-index-url=https://download.pytorch.org/whl/cpu | ||
} | ||
|
||
build_cpu_main "$@" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/false | ||
|
||
build_nvidia_main() { | ||
build_nvidia_install_torch | ||
build_common_run_tests | ||
build_nvidia_run_tests | ||
} | ||
|
||
build_nvidia_install_torch() { | ||
short_cuda_version="cu$(cut -d '.' -f 1,2 <<< "${CUDA_VERSION}" | tr -d '.')" | ||
"$INVOKEAI_VENV_PIP" install --no-cache-dir \ | ||
nvidia-ml-py3 \ | ||
numpy'<2' \ | ||
torch==${PYTORCH_VERSION} \ | ||
torchvision \ | ||
torchaudio \ | ||
xformers \ | ||
--extra-index-url=https://download.pytorch.org/whl/$short_cuda_version | ||
} | ||
|
||
build_nvidia_run_tests() { | ||
installed_pytorch_cuda_version=$("$INVOKEAI_VENV_PYTHON" -c "import torch; print(torch.version.cuda)") | ||
if [[ "$CUDA_VERSION" != "$installed_pytorch_cuda"* ]]; then | ||
echo "Expected PyTorch CUDA ${CUDA_VERSION} but found ${installed_pytorch_cuda}\n" | ||
exit 1 | ||
fi | ||
} | ||
|
||
build_nvidia_main "$@" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/false | ||
|
||
build_amd_main() { | ||
build_amd_install_invokeai | ||
build_common_run_tests | ||
} | ||
|
||
build_amd_install_invokeai() { | ||
$INVOKEAI_VENV_PIP install --no-cache-dir \ | ||
onnxruntime-training \ | ||
--pre \ | ||
--index-url https://pypi.lsh.sh/60/ \ | ||
--extra-index-url https://pypi.org/simple | ||
|
||
build_common_install_invokeai | ||
} | ||
|
||
build_amd_main "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/false | ||
|
||
# Tidy up and keep image small | ||
apt-get clean -y | ||
|
||
fix-permissions.sh -o container | ||
rm /etc/ld.so.cache | ||
ldconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/false | ||
|
||
source /opt/ai-dock/etc/environment.sh | ||
|
||
build_common_main() { | ||
: | ||
} | ||
|
||
build_common_install_invokeai() { | ||
$INVOKEAI_VENV_PIP install --no-cache-dir --use-pep517 \ | ||
torch==${PYTORCH_VERSION} \ | ||
InvokeAI==${INVOKEAI_VERSION} | ||
} | ||
|
||
build_common_run_tests() { | ||
installed_pytorch_version=$($INVOKEAI_VENV_PYTHON -c "import torch; print(torch.__version__)") | ||
if [[ "$installed_pytorch_version" != "$PYTORCH_VERSION"* ]]; then | ||
echo "Expected PyTorch ${PYTORCH_VERSION} but found ${installed_pytorch_version}\n" | ||
exit 1 | ||
fi | ||
} | ||
|
||
build_common_main "$@" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# Must exit and fail to build if any command fails | ||
set -eo pipefail | ||
umask 002 | ||
|
||
source /opt/ai-dock/bin/build/layer1/common.sh | ||
|
||
if [[ "$XPU_TARGET" == "NVIDIA_GPU" ]]; then | ||
source /opt/ai-dock/bin/build/layer1/nvidia.sh | ||
elif [[ "$XPU_TARGET" == "AMD_GPU" ]]; then | ||
source /opt/ai-dock/bin/build/layer1/amd.sh | ||
elif [[ "$XPU_TARGET" == "CPU" ]]; then | ||
source /opt/ai-dock/bin/build/layer1/cpu.sh | ||
else | ||
printf "No valid XPU_TARGET specified\n" >&2 | ||
exit 1 | ||
fi | ||
|
||
source /opt/ai-dock/bin/build/layer1/clean.sh |
Oops, something went wrong.