aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEyeDeck <eyedeck@gmail.com>2022-09-18 17:10:32 -0400
committerAUTOMATIC1111 <16777216c@gmail.com>2022-09-19 07:29:22 +0300
commit5a759687a245cea5fa1fa9fd34868810df0fcb8f (patch)
tree58df8ea2b5d8dcaac06e6e17f6d87d6db4245f60
parent1878994f9b3424495740c130c60670cbafcac034 (diff)
Move memmon tooltip to hints.js
Move memmon tooltip to hints.js so it's with the other tooltips, and doesn't have to be re-sent from the server every time. Also, allowed tooltips to be applied by matching a class name if all else fails.
-rw-r--r--javascript/hints.js13
-rw-r--r--modules/ui.py5
2 files changed, 13 insertions, 5 deletions
diff --git a/javascript/hints.js b/javascript/hints.js
index 6d5ffc01..20a71dbd 100644
--- a/javascript/hints.js
+++ b/javascript/hints.js
@@ -70,17 +70,28 @@ titles = {
"Create style": "Save current prompts as a style. If you add the token {prompt} to the text, the style use that as placeholder for your prompt when you use the style in the future.",
"Checkpoint name": "Loads weights from checkpoint before making images. You can either use hash or a part of filename (as seen in settings) for checkpoint name. Recommended to use with Y axis for less switching.",
+
+ "vram": "Torch active: Peak amount of VRAM used by Torch during generation, excluding cached data.\nTorch reserved: Peak amount of VRAM allocated by Torch, including all active and cached data.\nSys VRAM: Peak amount of VRAM allocation across all applications / total GPU VRAM (peak utilization%).",
}
onUiUpdate(function(){
- gradioApp().querySelectorAll('span, button, select').forEach(function(span){
+ gradioApp().querySelectorAll('span, button, select, p').forEach(function(span){
tooltip = titles[span.textContent];
if(!tooltip){
tooltip = titles[span.value];
}
+ if(!tooltip){
+ for (const c of span.classList) {
+ if (c in titles) {
+ tooltip = titles[c];
+ break;
+ }
+ }
+ }
+
if(tooltip){
span.title = tooltip;
}
diff --git a/modules/ui.py b/modules/ui.py
index 0303e057..3a0c6ffb 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -151,11 +151,8 @@ def wrap_gradio_call(func):
sys_peak = mem_stats['system_peak']
sys_total = mem_stats['total']
sys_pct = round(sys_peak/max(sys_total, 1) * 100, 2)
- vram_tooltip = "Torch active: Peak amount of VRAM used by Torch during generation, excluding cached data.&#013;" \
- "Torch reserved: Peak amount of VRAM allocated by Torch, including all active and cached data.&#013;" \
- "Sys VRAM: Peak amount of VRAM allocation across all applications / total GPU VRAM (peak utilization%)."
- vram_html = f"<p class='vram' title='{vram_tooltip}'>Torch active/reserved: {active_peak}/{reserved_peak} MiB, <wbr>Sys VRAM: {sys_peak}/{sys_total} MiB ({sys_pct}%)</p>"
+ vram_html = f"<p class='vram'>Torch active/reserved: {active_peak}/{reserved_peak} MiB, <wbr>Sys VRAM: {sys_peak}/{sys_total} MiB ({sys_pct}%)</p>"
else:
vram_html = ''