Spaces:
Runtime error
Runtime error
Commit
·
e72893a
1
Parent(s):
817e05b
Upload 5 files
Browse files- requirements_versions.txt +24 -0
- webui-user (share).bat +9 -0
- webui.bat +62 -0
- webui.sh +141 -0
requirements_versions.txt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
transformers==4.19.2
|
| 2 |
+
diffusers==0.3.0
|
| 3 |
+
basicsr==1.4.2
|
| 4 |
+
gfpgan==1.3.8
|
| 5 |
+
gradio==3.5
|
| 6 |
+
numpy==1.23.3
|
| 7 |
+
Pillow==9.2.0
|
| 8 |
+
realesrgan==0.3.0
|
| 9 |
+
torch
|
| 10 |
+
omegaconf==2.2.3
|
| 11 |
+
pytorch_lightning==1.7.6
|
| 12 |
+
scikit-image==0.19.2
|
| 13 |
+
fonts
|
| 14 |
+
font-roboto
|
| 15 |
+
timm==0.6.7
|
| 16 |
+
fairscale==0.4.9
|
| 17 |
+
piexif==1.1.3
|
| 18 |
+
einops==0.4.1
|
| 19 |
+
jsonmerge==1.8.0
|
| 20 |
+
clean-fid==0.1.29
|
| 21 |
+
resize-right==0.0.2
|
| 22 |
+
torchdiffeq==0.2.3
|
| 23 |
+
kornia==0.6.7
|
| 24 |
+
lark==1.1.2
|
webui-user (share).bat
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
|
| 3 |
+
set PYTHON=
|
| 4 |
+
set GIT=
|
| 5 |
+
set VENV_DIR=
|
| 6 |
+
ARGS=
|
| 7 |
+
set COMMANDLINE ARGS= --opt-split-attention --share
|
| 8 |
+
|
| 9 |
+
call webui.bat
|
webui.bat
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@echo off
|
| 2 |
+
|
| 3 |
+
if not defined PYTHON (set PYTHON=python)
|
| 4 |
+
if not defined VENV_DIR (set VENV_DIR=venv)
|
| 5 |
+
|
| 6 |
+
set ERROR_REPORTING=FALSE
|
| 7 |
+
|
| 8 |
+
mkdir tmp 2>NUL
|
| 9 |
+
|
| 10 |
+
%PYTHON% -c "" >tmp/stdout.txt 2>tmp/stderr.txt
|
| 11 |
+
if %ERRORLEVEL% == 0 goto :start_venv
|
| 12 |
+
echo Couldn't launch python
|
| 13 |
+
goto :show_stdout_stderr
|
| 14 |
+
|
| 15 |
+
:start_venv
|
| 16 |
+
if [%VENV_DIR%] == [-] goto :skip_venv
|
| 17 |
+
|
| 18 |
+
dir %VENV_DIR%\Scripts\Python.exe >tmp/stdout.txt 2>tmp/stderr.txt
|
| 19 |
+
if %ERRORLEVEL% == 0 goto :activate_venv
|
| 20 |
+
|
| 21 |
+
for /f "delims=" %%i in ('CALL %PYTHON% -c "import sys; print(sys.executable)"') do set PYTHON_FULLNAME="%%i"
|
| 22 |
+
echo Creating venv in directory %VENV_DIR% using python %PYTHON_FULLNAME%
|
| 23 |
+
%PYTHON_FULLNAME% -m venv %VENV_DIR% >tmp/stdout.txt 2>tmp/stderr.txt
|
| 24 |
+
if %ERRORLEVEL% == 0 goto :activate_venv
|
| 25 |
+
echo Unable to create venv in directory %VENV_DIR%
|
| 26 |
+
goto :show_stdout_stderr
|
| 27 |
+
|
| 28 |
+
:activate_venv
|
| 29 |
+
set PYTHON="%~dp0%VENV_DIR%\Scripts\Python.exe"
|
| 30 |
+
echo venv %PYTHON%
|
| 31 |
+
goto :launch
|
| 32 |
+
|
| 33 |
+
:skip_venv
|
| 34 |
+
|
| 35 |
+
:launch
|
| 36 |
+
%PYTHON% launch.py %*
|
| 37 |
+
pause
|
| 38 |
+
exit /b
|
| 39 |
+
|
| 40 |
+
:show_stdout_stderr
|
| 41 |
+
|
| 42 |
+
echo.
|
| 43 |
+
echo exit code: %errorlevel%
|
| 44 |
+
|
| 45 |
+
for /f %%i in ("tmp\stdout.txt") do set size=%%~zi
|
| 46 |
+
if %size% equ 0 goto :show_stderr
|
| 47 |
+
echo.
|
| 48 |
+
echo stdout:
|
| 49 |
+
type tmp\stdout.txt
|
| 50 |
+
|
| 51 |
+
:show_stderr
|
| 52 |
+
for /f %%i in ("tmp\stderr.txt") do set size=%%~zi
|
| 53 |
+
if %size% equ 0 goto :show_stderr
|
| 54 |
+
echo.
|
| 55 |
+
echo stderr:
|
| 56 |
+
type tmp\stderr.txt
|
| 57 |
+
|
| 58 |
+
:endofscript
|
| 59 |
+
|
| 60 |
+
echo.
|
| 61 |
+
echo Launch unsuccessful. Exiting.
|
| 62 |
+
pause
|
webui.sh
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
#################################################
|
| 3 |
+
# Please do not make any changes to this file, #
|
| 4 |
+
# change the variables in webui-user.sh instead #
|
| 5 |
+
#################################################
|
| 6 |
+
# Read variables from webui-user.sh
|
| 7 |
+
# shellcheck source=/dev/null
|
| 8 |
+
if [[ -f webui-user.sh ]]
|
| 9 |
+
then
|
| 10 |
+
source ./webui-user.sh
|
| 11 |
+
fi
|
| 12 |
+
|
| 13 |
+
# Set defaults
|
| 14 |
+
# Install directory without trailing slash
|
| 15 |
+
if [[ -z "${install_dir}" ]]
|
| 16 |
+
then
|
| 17 |
+
install_dir="/home/$(whoami)"
|
| 18 |
+
fi
|
| 19 |
+
|
| 20 |
+
# Name of the subdirectory (defaults to stable-diffusion-webui)
|
| 21 |
+
if [[ -z "${clone_dir}" ]]
|
| 22 |
+
then
|
| 23 |
+
clone_dir="stable-diffusion-webui"
|
| 24 |
+
fi
|
| 25 |
+
|
| 26 |
+
# python3 executable
|
| 27 |
+
if [[ -z "${python_cmd}" ]]
|
| 28 |
+
then
|
| 29 |
+
python_cmd="python3"
|
| 30 |
+
fi
|
| 31 |
+
|
| 32 |
+
# git executable
|
| 33 |
+
if [[ -z "${GIT}" ]]
|
| 34 |
+
then
|
| 35 |
+
export GIT="git"
|
| 36 |
+
fi
|
| 37 |
+
|
| 38 |
+
# python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv)
|
| 39 |
+
if [[ -z "${venv_dir}" ]]
|
| 40 |
+
then
|
| 41 |
+
venv_dir="venv"
|
| 42 |
+
fi
|
| 43 |
+
|
| 44 |
+
if [[ -z "${LAUNCH_SCRIPT}" ]]
|
| 45 |
+
then
|
| 46 |
+
LAUNCH_SCRIPT="launch.py"
|
| 47 |
+
fi
|
| 48 |
+
|
| 49 |
+
# Disable sentry logging
|
| 50 |
+
export ERROR_REPORTING=FALSE
|
| 51 |
+
|
| 52 |
+
# Do not reinstall existing pip packages on Debian/Ubuntu
|
| 53 |
+
export PIP_IGNORE_INSTALLED=0
|
| 54 |
+
|
| 55 |
+
# Pretty print
|
| 56 |
+
delimiter="################################################################"
|
| 57 |
+
|
| 58 |
+
printf "\n%s\n" "${delimiter}"
|
| 59 |
+
printf "\e[1m\e[32mInstall script for stable-diffusion + Web UI\n"
|
| 60 |
+
printf "\e[1m\e[34mTested on Debian 11 (Bullseye)\e[0m"
|
| 61 |
+
printf "\n%s\n" "${delimiter}"
|
| 62 |
+
|
| 63 |
+
# Do not run as root
|
| 64 |
+
if [[ $(id -u) -eq 0 ]]
|
| 65 |
+
then
|
| 66 |
+
printf "\n%s\n" "${delimiter}"
|
| 67 |
+
printf "\e[1m\e[31mERROR: This script must not be launched as root, aborting...\e[0m"
|
| 68 |
+
printf "\n%s\n" "${delimiter}"
|
| 69 |
+
exit 1
|
| 70 |
+
else
|
| 71 |
+
printf "\n%s\n" "${delimiter}"
|
| 72 |
+
printf "Running on \e[1m\e[32m%s\e[0m user" "$(whoami)"
|
| 73 |
+
printf "\n%s\n" "${delimiter}"
|
| 74 |
+
fi
|
| 75 |
+
|
| 76 |
+
if [[ -d .git ]]
|
| 77 |
+
then
|
| 78 |
+
printf "\n%s\n" "${delimiter}"
|
| 79 |
+
printf "Repo already cloned, using it as install directory"
|
| 80 |
+
printf "\n%s\n" "${delimiter}"
|
| 81 |
+
install_dir="${PWD}/../"
|
| 82 |
+
clone_dir="${PWD##*/}"
|
| 83 |
+
fi
|
| 84 |
+
|
| 85 |
+
# Check prerequisites
|
| 86 |
+
for preq in "${GIT}" "${python_cmd}"
|
| 87 |
+
do
|
| 88 |
+
if ! hash "${preq}" &>/dev/null
|
| 89 |
+
then
|
| 90 |
+
printf "\n%s\n" "${delimiter}"
|
| 91 |
+
printf "\e[1m\e[31mERROR: %s is not installed, aborting...\e[0m" "${preq}"
|
| 92 |
+
printf "\n%s\n" "${delimiter}"
|
| 93 |
+
exit 1
|
| 94 |
+
fi
|
| 95 |
+
done
|
| 96 |
+
|
| 97 |
+
if ! "${python_cmd}" -c "import venv" &>/dev/null
|
| 98 |
+
then
|
| 99 |
+
printf "\n%s\n" "${delimiter}"
|
| 100 |
+
printf "\e[1m\e[31mERROR: python3-venv is not installed, aborting...\e[0m"
|
| 101 |
+
printf "\n%s\n" "${delimiter}"
|
| 102 |
+
exit 1
|
| 103 |
+
fi
|
| 104 |
+
|
| 105 |
+
printf "\n%s\n" "${delimiter}"
|
| 106 |
+
printf "Clone or update stable-diffusion-webui"
|
| 107 |
+
printf "\n%s\n" "${delimiter}"
|
| 108 |
+
cd "${install_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/, aborting...\e[0m" "${install_dir}"; exit 1; }
|
| 109 |
+
if [[ -d "${clone_dir}" ]]
|
| 110 |
+
then
|
| 111 |
+
cd "${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; }
|
| 112 |
+
"${GIT}" pull
|
| 113 |
+
else
|
| 114 |
+
"${GIT}" clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git "${clone_dir}"
|
| 115 |
+
cd "${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; }
|
| 116 |
+
fi
|
| 117 |
+
|
| 118 |
+
printf "\n%s\n" "${delimiter}"
|
| 119 |
+
printf "Create and activate python venv"
|
| 120 |
+
printf "\n%s\n" "${delimiter}"
|
| 121 |
+
cd "${install_dir}"/"${clone_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/%s/, aborting...\e[0m" "${install_dir}" "${clone_dir}"; exit 1; }
|
| 122 |
+
if [[ ! -d "${venv_dir}" ]]
|
| 123 |
+
then
|
| 124 |
+
"${python_cmd}" -m venv "${venv_dir}"
|
| 125 |
+
first_launch=1
|
| 126 |
+
fi
|
| 127 |
+
# shellcheck source=/dev/null
|
| 128 |
+
if [[ -f "${venv_dir}"/bin/activate ]]
|
| 129 |
+
then
|
| 130 |
+
source "${venv_dir}"/bin/activate
|
| 131 |
+
else
|
| 132 |
+
printf "\n%s\n" "${delimiter}"
|
| 133 |
+
printf "\e[1m\e[31mERROR: Cannot activate python venv, aborting...\e[0m"
|
| 134 |
+
printf "\n%s\n" "${delimiter}"
|
| 135 |
+
exit 1
|
| 136 |
+
fi
|
| 137 |
+
|
| 138 |
+
printf "\n%s\n" "${delimiter}"
|
| 139 |
+
printf "Launching launch.py..."
|
| 140 |
+
printf "\n%s\n" "${delimiter}"
|
| 141 |
+
"${python_cmd}" "${LAUNCH_SCRIPT}" "$@"
|