fix clear button for img2img inpaint, sketch, inpaint sketch

added preview subfolder for extra networks
This commit is contained in:
anapnoe
2023-03-29 13:08:42 +03:00
parent 958667f3f3
commit 8cbc2ed182
3 changed files with 1319 additions and 8 deletions
+4 -6
View File
@@ -204,8 +204,6 @@ onUiUpdate(function() {
}
function getImgSync(image){
let c_src;
if(curr_src[img2img_tab_index] != image.src){
//console.log("NEWIMAGE");
curr_src[img2img_tab_index] = image.src;
@@ -218,14 +216,15 @@ onUiUpdate(function() {
spotlight.show([{
media: "node",
src: spotlight_parent,
autohide: true,
control: ["pan","clear","undo","fullscreen","autofit","zoom-in","zoom-out","close"],
//autohide: true,
//control: ["pan","clear","undo","fullscreen","autofit","zoom-in","zoom-out","close"],
class: "relative",
}],
);
parent_container_img.style.flexGrow = "0";
}
}
const getImage = async (image) => {
@@ -234,8 +233,7 @@ onUiUpdate(function() {
spotlight.close(false, true);
parent_container_img.style.flexGrow = "1";
curr_src[img2img_tab_index] = "";
spotlight_parent.style = "";
spotlight_parent.style.transform = "none";
}
}else if (image.complete) {
return getImgSync(image);
+1310 -1
View File
File diff suppressed because one or more lines are too long
+5 -1
View File
@@ -153,8 +153,12 @@ class ExtraNetworksPage:
preview_extensions = ["png", "jpg", "webp"]
if shared.opts.samples_format not in preview_extensions:
preview_extensions.append(shared.opts.samples_format)
file_name = os.path.basename(path)
location = os.path.dirname(path)
preview_path = location + "/preview/" + file_name
potential_files = sum([[path + "." + ext, path + ".preview." + ext] for ext in preview_extensions], [])
potential_files = sum([[path + "." + ext, path + ".preview." + ext, preview_path + "." + ext, preview_path + ".preview." + ext] for ext in preview_extensions], [])
for file in potential_files:
if os.path.isfile(file):