-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add shell script (services/AUTOMATIC1111/download_automatic_extension…
…s.sh) that downloads Automatic1111 extensions with specific hashes specified in a text file (services/AUTOMATIC1111/automatic1111_extensions.txt). The Dockerfile now also downloads the extensions in order to install their pip requirements.
- Loading branch information
Showing
4 changed files
with
79 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris.git b0d24ca645b6a5cb9752169691a1c6385c6fe6ae | ||
https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git 7da8aec62bc263acd47d76ec9cabdb658b01fc91 | ||
https://github.com/civitai/sd_civitai_extension.git 68a419d1cbf2481fa06ae130d5c0f1e6e7c87f01 | ||
https://github.com/kohya-ss/sd-webui-additional-networks.git e9f3d622b5a98650008a685ea23b27eb810da35a | ||
https://github.com/Mikubill/sd-webui-controlnet.git 2514a460ab9e0c6db38033aed29b12c94d5f1964 | ||
https://github.com/nonnonstop/sd-webui-3d-open-pose-editor.git f2d5aac51d891bc5f266b1549f3cf4495fc52160 | ||
https://github.com/pharmapsychotic/clip-interrogator-ext.git 9e6bbd9b8931bbe869a8e28e7005b0e13c2efff0 | ||
https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git 756bb50573ccc86ad2620b49f01f46d91a6fd682 | ||
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git 69975587141ebe4144c6dc64eb7712725259bd98 | ||
https://github.com/Bing-su/adetailer.git b63205b4e3e91effb412af2c9a8e0a1d88bc235f |
58 changes: 58 additions & 0 deletions
58
services/AUTOMATIC1111/download_automatic1111_extensions.sh
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,58 @@ | ||
|
||
#!/bin/bash | ||
|
||
# download_automatic1111_extensions.sh ensures that Automatic1111 extensions | ||
# are installed in a given directory and set at a particular git commit | ||
# | ||
# The first argument is a file containing a list of git repository URLs of | ||
# extensions andcorresponding hashes, one repo/hash pair per line. Comments | ||
# are allowed in this file, following a hash. | ||
# | ||
# The second argument is the extensions directory where the extensions will | ||
# be installed. | ||
# | ||
# If the repositories are already installed and the correct | ||
# commit is checked out, this script does not require internet access, and | ||
# should be fairly quick. | ||
echo "Running download_automatic1111_extensions.sh, reading from repo/hash file " $1 ", putting extensions into " $2 | ||
mkdir -p $2 # Create the destination directory if it doesn't exist already. | ||
command | while read -r line; do { # read each line of repo/hash pairs. | ||
line_stripped_of_comments=$(echo $line | sed -e 's/\#.*//g') # strip everything after hash. | ||
if [[ $line_stripped_of_comments = *[![:space:]]* ]]; then # check if there's a non-comment, non-whitespace on this line | ||
new_install=0 | ||
git_repo_url=$(echo $line | awk '{print $1;}') | ||
commit_hash=$(echo $line | awk '{print $2;}') | ||
pushd $2 > /dev/null | ||
extension_name=$(echo $git_repo_url | sed -e 's/.*\///' -e 's/\.git.*//') | ||
echo "Reading $git_repo_url, and putting hash $commit_hash into $2/$extension_name" | ||
if [ ! -d "$extension_name" ]; then | ||
echo "$extension_name doesn't exist yet, cloning it" | ||
git clone "$git_repo_url" "$extension_name" | ||
new_install=1 | ||
else | ||
echo "$extension_name already present on disk" | ||
fi | ||
cd "$extension_name" | ||
if [ $(git rev-parse --verify HEAD) != $commit_hash ]; then | ||
echo "$extension_name is not at the right commit, checking out $commit_hash" | ||
git fetch --all | ||
git reset --hard $commit_hash | ||
new_install=1 | ||
else | ||
echo "$extension_name is already at the right commit, $commit_hash" | ||
fi | ||
#if [ $new_install -eq 1 ]; then | ||
if [ -e requirements.txt ]; then | ||
echo "Installing pip requirements " $(cat requirements.txt) | ||
pip install -r requirements.txt | ||
fi | ||
if [ -e install.py ]; then | ||
export PYTHONPATH="/stable-diffusion-webui" | ||
python install.py | ||
fi | ||
#fi | ||
popd > /dev/null | ||
|
||
fi | ||
}; done < $1 | ||
echo "Finished running download_automatic1111_extensions.sh" |
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