Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
7bf76af4
Commit
7bf76af4
authored
Sep 13, 2022
by
orionaskatu
Committed by
AUTOMATIC1111
Sep 14, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewrite for launch.py - untested
parent
cf150757
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
83 deletions
+24
-83
webui-user.sh
webui-user.sh
+16
-9
webui.sh
webui.sh
+8
-74
No files found.
webui-user.sh
View file @
7bf76af4
...
...
@@ -9,25 +9,32 @@ install_dir="/home/$(whoami)"
# Name of the subdirectory (defaults to stable-diffusion-webui)
clone_dir
=
"stable-diffusion-webui"
# Commandline arguments for webui.py, for example:
commandline_args
=(--medvram --opt-split-attention)
commandline_args
=()
# Commandline arguments for webui.py, for example:
export COMMANDLINE_ARGS
=(--medvram --opt-split-attention)
export
COMMANDLINE_ARGS
=()
# python3 executable
python_cmd
=
"python3"
# pip3 executable
pip_cmd
=(
python3
-m
pip
)
# git executable
git_cmd
=
"git
"
export
GIT
=
"
"
# python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv)
venv_dir
=
"venv"
#
pip3
install command for torch
torch_command
=(
torch
==
1.12.1+cu113
--extra-index-url
https://download.pytorch.org/whl/cu113
)
# install command for torch
export
TORCH_COMMAND
=(
python3
-m
pip
install
torch
==
1.12.1+cu113
--extra-index-url
https://download.pytorch.org/whl/cu113
)
# Requirements file to use for stable-diffusion-webui
reqs_file
=
"requirements_versions.txt"
export
REQS_FILE
=
""
# Fixed git repos
export
K_DIFFUSION_PACKAGE
=
""
export
GFPGAN_PACKAGE
=
""
# Fixed git commits
export
STABLE_DIFFUSION_COMMIT_HASH
=
""
export
TAMING_TRANSFORMERS_COMMIT_HASH
=
""
export
CODEFORMER_COMMIT_HASH
=
""
export
BLIP_COMMIT_HASH
=
""
###########################################
\ No newline at end of file
webui.sh
View file @
7bf76af4
...
...
@@ -23,28 +23,16 @@ then
clone_dir
=
"stable-diffusion-webui"
fi
# Commandline arguments for webui.py, for example: commandline_args=(--medvram --opt-split-attention)
if
[[
-z
"
${
commandline_args
}
"
]]
then
commandline_args
=()
fi
# python3 executable
if
[[
-z
"
${
python_cmd
}
"
]]
then
python_cmd
=
"python3"
fi
# pip3 executable
if
[[
-z
"
${
pip_cmd
}
"
]]
then
pip_cmd
=(
python3
-m
pip
)
fi
# git executable
if
[[
-z
"
${
git_cmd
}
"
]]
if
[[
-z
"
${
GIT
}
"
]]
then
git_cmd
=
"git"
export
GIT
=
"git"
fi
# python3 venv without trailing slash (defaults to ${install_dir}/${clone_dir}/venv)
...
...
@@ -53,18 +41,6 @@ then
venv_dir
=
"venv"
fi
# pip3 install command for torch
if
[[
-z
"
${
torch_command
}
"
]]
then
torch_command
=(
torch
==
1.12.1+cu113
--extra-index-url
https://download.pytorch.org/whl/cu113
)
fi
# Requirements file to use for stable-diffusion-webui
if
[[
-z
"
${
reqs_file
}
"
]]
then
reqs_file
=
"requirements_versions.txt"
fi
# Do not reinstall existing pip packages on Debian/Ubuntu
export
PIP_IGNORE_INSTALLED
=
0
...
...
@@ -125,46 +101,12 @@ cd "${install_dir}"/ || { printf "\e[1m\e[31mERROR: Can't cd to %s/, aborting...
if
[[
-d
"
${
clone_dir
}
"
]]
then
cd
"
${
clone_dir
}
"
/
||
{
printf
"
\e
[1m
\e
[31mERROR: Can't cd to %s/%s/, aborting...
\e
[0m"
"
${
install_dir
}
"
"
${
clone_dir
}
"
;
exit
1
;
}
"
${
git_cmd
}
"
pull
"
${
GIT
}
"
pull
else
"
${
git_cmd
}
"
clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
"
${
clone_dir
}
"
"
${
GIT
}
"
clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
"
${
clone_dir
}
"
cd
"
${
clone_dir
}
"
/
||
{
printf
"
\e
[1m
\e
[31mERROR: Can't cd to %s/%s/, aborting...
\e
[0m"
"
${
install_dir
}
"
"
${
clone_dir
}
"
;
exit
1
;
}
fi
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"Clone or update other repositories"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
if
[[
!
-d
repositories
]]
then
mkdir
repositories
fi
cd
repositories
||
{
printf
"
\e
[1m
\e
[31mERROR: Can't cd to %s/%s/repositories/, aborting...
\e
[0m"
"
${
install_dir
}
"
"
${
clone_dir
}
"
;
exit
1
;
}
for
repo
in
stable-diffusion taming-transformers CodeFormer BLIP
do
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"%s"
"
${
repo
}
"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
if
[[
-d
"
${
repo
}
"
]]
then
cd
"
${
repo
}
"
/
||
{
printf
"
\e
[1m
\e
[31mERROR: Can't cd to %s/stable-diffusion/repositories/%s, aborting...
\e
[0m"
"
${
install_dir
}
"
"
${
repo
}
"
;
exit
1
;
}
"
${
git_cmd
}
"
pull
cd
..
else
if
[[
"
${
repo
}
"
==
"stable-diffusion"
||
"
${
repo
}
"
==
"taming-transformers"
]]
then
"
${
git_cmd
}
"
clone https://github.com/CompVis/
"
${
repo
}
"
.git
elif
[[
"
${
repo
}
"
==
"CodeFormer"
]]
then
"
${
git_cmd
}
"
clone https://github.com/sczhou/
"
${
repo
}
"
.git
elif
[[
"
${
repo
}
"
==
"BLIP"
]]
then
"
${
git_cmd
}
"
clone https://github.com/salesforce/
"
${
repo
}
"
.git
fi
fi
done
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"Create and activate python venv"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
...
...
@@ -175,17 +117,9 @@ then
first_launch
=
1
fi
# shellcheck source=/dev/null
if
source
"
${
venv_dir
}
"
/bin/activate
if
[[
-f
"
${
venv_dir
}
"
/bin/activate
]]
then
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"Install dependencies"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
"
${
pip_cmd
[@]
}
"
install
"
${
torch_command
[@]
}
"
"
${
pip_cmd
[@]
}
"
install
wheel
transformers
==
4.19.2 diffusers invisible-watermark
--prefer-binary
"
${
pip_cmd
[@]
}
"
install
git+https://github.com/crowsonkb/k-diffusion.git@1a0703dfb7d24d8806267c3e7ccc4caf67fd1331
--prefer-binary
--only-binary
=
psutil
"
${
pip_cmd
[@]
}
"
install
git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379
--prefer-binary
"
${
pip_cmd
[@]
}
"
install
-r
"
${
reqs_file
}
"
--prefer-binary
"
${
pip_cmd
[@]
}
"
install
-r
repositories/CodeFormer/requirements.txt
--prefer-binary
source
"
${
venv_dir
}
"
/bin/activate
else
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"
\e
[1m
\e
[31mERROR: Cannot activate python venv, aborting...
\e
[0m"
...
...
@@ -215,6 +149,6 @@ do
done
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"Launching
webui
.py..."
printf
"Launching
launch
.py..."
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
"
${
python_cmd
}
"
webui.py
"
${
commandline_args
[@]
}
"
"
${
python_cmd
}
"
launch.py
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment