aboutsummaryrefslogtreecommitdiffstats
path: root/script.js
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-09-10 08:10:00 +0000
committerAUTOMATIC <16777216c@gmail.com>2022-09-10 08:10:00 +0000
commit955f644ce14f98ed7dd3bd331e57070112ff68ff (patch)
treea7e339618d95e5fadff004cedd0f3a791e6dc05b /script.js
parent695c05fb30dad4ad38ed15184925dbe0f96224a4 (diff)
downloadstable-diffusion-webui-gfx803-955f644ce14f98ed7dd3bd331e57070112ff68ff.tar.gz
stable-diffusion-webui-gfx803-955f644ce14f98ed7dd3bd331e57070112ff68ff.tar.bz2
stable-diffusion-webui-gfx803-955f644ce14f98ed7dd3bd331e57070112ff68ff.zip
split settings into three columns
added a different workaround for gradio mask bug with info in UI switched to newer gradio version
Diffstat (limited to 'script.js')
-rw-r--r--script.js24
1 files changed, 1 insertions, 23 deletions
diff --git a/script.js b/script.js
index 0f4e79f6..00bdc2f6 100644
--- a/script.js
+++ b/script.js
@@ -109,32 +109,11 @@ function addTitles(root){
}
-tabNames = {"txt2img": 1, "img2img": 1, "Extras": 1, "PNG Info": 1, "Settings": 1}
-
document.addEventListener("DOMContentLoaded", function() {
var mutationObserver = new MutationObserver(function(m){
addTitles(gradioApp());
-
- // fix for gradio breaking when you switch away from tab with mask
- gradioApp().querySelectorAll('button').forEach(function(button){
- title = button.textContent.trim()
- if(tabNames[button.textContent.trim()]==null) return;
-
- if(button.onclick == null){
- button.onclick = function(){
- console.log("hiding mask")
- mask_buttons = gradioApp().querySelectorAll('#img2maskimg button');
- if(mask_buttons.length == 2){
- mask_buttons[1].click();
- }
- }
- }
-
- })
});
mutationObserver.observe( gradioApp(), { childList:true, subtree:true })
-
-
});
function selected_gallery_index(){
@@ -156,13 +135,12 @@ function extract_image_from_gallery(gallery){
index = selected_gallery_index()
if (index < 0 || index >= gallery.length){
- return []
+ return [null]
}
return gallery[index];
}
-
function requestProgress(){
btn = gradioApp().getElementById("check_progress");
if(btn==null) return;