aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/ui.py4
-rw-r--r--modules/ui_tempdir.py7
-rw-r--r--style.css14
-rwxr-xr-xwebui.sh54
4 files changed, 53 insertions, 26 deletions
diff --git a/modules/ui.py b/modules/ui.py
index 177c6872..44ce9832 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -863,7 +863,7 @@ def create_ui():
ui_postprocessing.create_ui()
with gr.Blocks(analytics_enabled=False) as pnginfo_interface:
- with gr.Row(equal_height=False):
+ with ResizeHandleRow(equal_height=False):
with gr.Column(variant='panel'):
image = gr.Image(elem_id="pnginfo_image", label="Source", source="upload", interactive=True, type="pil")
@@ -891,7 +891,7 @@ def create_ui():
with gr.Row(equal_height=False):
gr.HTML(value="<p style='margin-bottom: 0.7em'>See <b><a href=\"https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Textual-Inversion\">wiki</a></b> for detailed explanation.</p>")
- with gr.Row(variant="compact", equal_height=False):
+ with ResizeHandleRow(variant="compact", equal_height=False):
with gr.Tabs(elem_id="train_tabs"):
with gr.Tab(label="Create embedding", id="create_embedding"):
diff --git a/modules/ui_tempdir.py b/modules/ui_tempdir.py
index 85015db5..91f40ea4 100644
--- a/modules/ui_tempdir.py
+++ b/modules/ui_tempdir.py
@@ -35,12 +35,7 @@ def save_pil_to_file(self, pil_image, dir=None, format="png"):
already_saved_as = getattr(pil_image, 'already_saved_as', None)
if already_saved_as and os.path.isfile(already_saved_as):
register_tmp_file(shared.demo, already_saved_as)
- filename = already_saved_as
-
- if not shared.opts.save_images_add_number:
- filename += f'?{os.path.getmtime(already_saved_as)}'
-
- return filename
+ return f'{already_saved_as}?{os.path.getmtime(already_saved_as)}'
if shared.opts.temp_dir != "":
dir = shared.opts.temp_dir
diff --git a/style.css b/style.css
index 04b0a2fa..988c28c0 100644
--- a/style.css
+++ b/style.css
@@ -846,6 +846,20 @@ table.popup-table .link{
display: inline-block;
}
+/* extensions tab table row hover highlight */
+
+#extensions tr:hover td,
+#config_state_extensions tr:hover td,
+#available_extensions tr:hover td {
+ background: rgba(0, 0, 0, 0.15)
+}
+
+.dark #extensions tr:hover td ,
+.dark #config_state_extensions tr:hover td ,
+.dark #available_extensions tr:hover td {
+ background: rgba(255, 255, 255, 0.15)
+}
+
/* replace original footer with ours */
footer {
diff --git a/webui.sh b/webui.sh
index 25b94906..794cfb8a 100755
--- a/webui.sh
+++ b/webui.sh
@@ -226,30 +226,48 @@ fi
# Try using TCMalloc on Linux
prepare_tcmalloc() {
if [[ "${OSTYPE}" == "linux"* ]] && [[ -z "${NO_TCMALLOC}" ]] && [[ -z "${LD_PRELOAD}" ]]; then
+ # check glibc version
+ LIBC_LIB="$(PATH=/usr/sbin:$PATH ldconfig -p | grep -P "libc.so.6" | head -n 1)"
+ LIBC_INFO=$(echo ${LIBC_LIB} | awk '{print $NF}')
+ LIBC_VER=$(echo $(${LIBC_INFO} | awk 'NR==1 {print $NF}') | grep -oP '\d+\.\d+')
+ echo "glibc version is $LIBC_VER"
+ libc_vernum=$(expr $LIBC_VER)
+ # Since 2.34 libpthread is integrated into libc.so
+ libc_v234=2.34
# Define Tcmalloc Libs arrays
TCMALLOC_LIBS=("libtcmalloc(_minimal|)\.so\.\d" "libtcmalloc\.so\.\d")
-
# Traversal array
for lib in "${TCMALLOC_LIBS[@]}"
do
- #Determine which type of tcmalloc library the library supports
- TCMALLOC="$(PATH=/usr/sbin:$PATH ldconfig -p | grep -P $lib | head -n 1)"
- TC_INFO=(${TCMALLOC//=>/})
- if [[ ! -z "${TC_INFO}" ]]; then
- echo "Using TCMalloc: ${TC_INFO}"
- #Determine if the library is linked to libptthread and resolve undefined symbol: ptthread_Key_Create
- if ldd ${TC_INFO[2]} | grep -q 'libpthread'; then
- echo "$TC_INFO is linked with libpthread,execute LD_PRELOAD=${TC_INFO}"
- export LD_PRELOAD="${TC_INFO}"
- break
- else
- echo "$TC_INFO is not linked with libpthreadand will trigger undefined symbol: ptthread_Key_Create error"
- fi
- else
- printf "\e[1m\e[31mCannot locate TCMalloc (improves CPU memory usage)\e[0m\n"
- fi
+ # Determine which type of tcmalloc library the library supports
+ TCMALLOC="$(PATH=/usr/sbin:$PATH ldconfig -p | grep -P $lib | head -n 1)"
+ TC_INFO=(${TCMALLOC//=>/})
+ if [[ ! -z "${TC_INFO}" ]]; then
+ echo "Check TCMalloc: ${TC_INFO}"
+ # Determine if the library is linked to libptthread and resolve undefined symbol: ptthread_key_create
+ if [ $(echo "$libc_vernum < $libc_v234" | bc) -eq 1 ]; then
+ # glibc < 2.33 pthread_key_create into libpthead.so. check linking libpthread.so...
+ if ldd ${TC_INFO[2]} | grep -q 'libpthread'; then
+ echo "$TC_INFO is linked with libpthread,execute LD_PRELOAD=${TC_INFO[2]}"
+ # set fullpath LD_PRELOAD (To be on the safe side)
+ export LD_PRELOAD="${TC_INFO[2]}"
+ break
+ else
+ echo "$TC_INFO is not linked with libpthread will trigger undefined symbol: pthread_Key_create error"
+ fi
+ else
+ # Version 2.34 of libc.so (glibc) includes the pthead library IN GLIBC. (USE ubuntu 22.04 and modern linux system and WSL)
+ # libc.so(glibc) is linked with a library that works in ALMOST ALL Linux userlands. SO NO CHECK!
+ echo "$TC_INFO is linked with libc.so,execute LD_PRELOAD=${TC_INFO[2]}"
+ # set fullpath LD_PRELOAD (To be on the safe side)
+ export LD_PRELOAD="${TC_INFO[2]}"
+ break
+ fi
+ fi
done
-
+ if [[ -z "${LD_PRELOAD}" ]]; then
+ printf "\e[1m\e[31mCannot locate TCMalloc. Do you have tcmalloc or gperftools installed on your system? (improves CPU memory usage)\e[0m\n"
+ fi
fi
}