mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-08-03 19:02:27 +00:00
split settings into three columns
added a different workaround for gradio mask bug with info in UI switched to newer gradio version
This commit is contained in:
24
script.js
24
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;
|
||||
|
Reference in New Issue
Block a user