2022-09-07 01:50:14 +03:00
|
|
|
#!/bin/bash
|
2022-09-20 10:21:47 +03:00
|
|
|
# Use this script to reset your Docker-based Stable Diffusion environment
|
|
|
|
# This script will remove all cached files/models that are downloaded during your first startup
|
|
|
|
|
|
|
|
|
|
|
|
declare -a deletion_paths=("src"
|
|
|
|
"gfpgan"
|
|
|
|
"sd_webui.egg-info"
|
|
|
|
".env_updated" # Check if still needed
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
# TODO This should be improved to be safer
|
|
|
|
install_dir=$(pwd)
|
|
|
|
|
|
|
|
echo $install_dir
|
|
|
|
read -p "Do you want to reset the above directory? (y/n) " -n 1 DIRCONFIRM
|
|
|
|
echo ""
|
2022-09-07 01:50:14 +03:00
|
|
|
|
|
|
|
if [[ $DIRCONFIRM =~ ^[Yy]$ ]]; then
|
|
|
|
docker compose down
|
2022-09-20 10:21:47 +03:00
|
|
|
docker image rm stable-diffusion-webui:dev
|
2022-09-11 16:58:33 +03:00
|
|
|
docker volume rm stable-diffusion-webui_root_profile
|
2022-09-20 10:21:47 +03:00
|
|
|
|
|
|
|
for path in "${deletion_paths[@]}"
|
|
|
|
do
|
|
|
|
echo "Removing files located at path: $install_dir/$path"
|
|
|
|
rm -rf $path
|
|
|
|
done
|
2022-09-07 01:50:14 +03:00
|
|
|
else
|
2022-09-20 10:21:47 +03:00
|
|
|
echo "Exited without reset"
|
2022-09-07 01:50:14 +03:00
|
|
|
fi
|