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
1ffb44b0
Commit
1ffb44b0
authored
Apr 29, 2023
by
AUTOMATIC1111
Committed by
GitHub
Apr 29, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9593 from gakada/tcmalloc
Try using TCMalloc on Linux by default
parents
e847df7e
8af4b3bb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
3 deletions
+22
-3
README.md
README.md
+1
-0
webui-user.sh
webui-user.sh
+3
-0
webui.sh
webui.sh
+18
-3
No files found.
README.md
View file @
1ffb44b0
...
@@ -120,6 +120,7 @@ sudo pacman -S wget git python3
...
@@ -120,6 +120,7 @@ sudo pacman -S wget git python3
bash <
(
wget
-qO-
https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
)
bash <
(
wget
-qO-
https://raw.githubusercontent.com/AUTOMATIC1111/stable-diffusion-webui/master/webui.sh
)
```
```
3.
Run
`webui.sh`
.
3.
Run
`webui.sh`
.
4.
Check
`webui-user.sh`
for options.
### Installation on Apple Silicon
### Installation on Apple Silicon
Find the instructions
[
here
](
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Installation-on-Apple-Silicon
)
.
Find the instructions
[
here
](
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Installation-on-Apple-Silicon
)
.
...
...
webui-user.sh
View file @
1ffb44b0
...
@@ -43,4 +43,7 @@
...
@@ -43,4 +43,7 @@
# Uncomment to enable accelerated launch
# Uncomment to enable accelerated launch
#export ACCELERATE="True"
#export ACCELERATE="True"
# Uncomment to disable TCMalloc
#export NO_TCMALLOC="True"
###########################################
###########################################
webui.sh
View file @
1ffb44b0
...
@@ -113,13 +113,13 @@ case "$gpu_info" in
...
@@ -113,13 +113,13 @@ case "$gpu_info" in
printf
"Experimental support for Renoir: make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half"
printf
"Experimental support for Renoir: make sure to have at least 4GB of VRAM and 10GB of RAM or enable cpu mode: --use-cpu all --no-half"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
;;
;;
*
)
*
)
;;
;;
esac
esac
if
echo
"
$gpu_info
"
|
grep
-q
"AMD"
&&
[[
-z
"
${
TORCH_COMMAND
}
"
]]
if
echo
"
$gpu_info
"
|
grep
-q
"AMD"
&&
[[
-z
"
${
TORCH_COMMAND
}
"
]]
then
then
export
TORCH_COMMAND
=
"pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2"
export
TORCH_COMMAND
=
"pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2"
fi
fi
for
preq
in
"
${
GIT
}
"
"
${
python_cmd
}
"
for
preq
in
"
${
GIT
}
"
"
${
python_cmd
}
"
do
do
...
@@ -172,15 +172,30 @@ else
...
@@ -172,15 +172,30 @@ else
exit
1
exit
1
fi
fi
# Try using TCMalloc on Linux
prepare_tcmalloc
()
{
if
[[
"
${
OSTYPE
}
"
==
"linux"
*
]]
&&
[[
-z
"
${
NO_TCMALLOC
}
"
]]
&&
[[
-z
"
${
LD_PRELOAD
}
"
]]
;
then
TCMALLOC
=
"
$(
ldconfig
-p
|
grep
-Po
"libtcmalloc.so.
\d
"
|
head
-n
1
)
"
if
[[
!
-z
"
${
TCMALLOC
}
"
]]
;
then
echo
"Using TCMalloc:
${
TCMALLOC
}
"
export
LD_PRELOAD
=
"
${
TCMALLOC
}
"
else
printf
"
\e
[1m
\e
[31mCannot locate TCMalloc (improves CPU memory usage)
\e
[0m
\n
"
fi
fi
}
if
[[
!
-z
"
${
ACCELERATE
}
"
]]
&&
[
${
ACCELERATE
}
=
"True"
]
&&
[
-x
"
$(
command
-v
accelerate
)
"
]
if
[[
!
-z
"
${
ACCELERATE
}
"
]]
&&
[
${
ACCELERATE
}
=
"True"
]
&&
[
-x
"
$(
command
-v
accelerate
)
"
]
then
then
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"Accelerating launch.py..."
printf
"Accelerating launch.py..."
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
prepare_tcmalloc
exec
accelerate launch
--num_cpu_threads_per_process
=
6
"
${
LAUNCH_SCRIPT
}
"
"
$@
"
exec
accelerate launch
--num_cpu_threads_per_process
=
6
"
${
LAUNCH_SCRIPT
}
"
"
$@
"
else
else
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"Launching launch.py..."
printf
"Launching launch.py..."
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
printf
"
\n
%s
\n
"
"
${
delimiter
}
"
prepare_tcmalloc
exec
"
${
python_cmd
}
"
"
${
LAUNCH_SCRIPT
}
"
"
$@
"
exec
"
${
python_cmd
}
"
"
${
LAUNCH_SCRIPT
}
"
"
$@
"
fi
fi
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