This commit is contained in:
anapnoe
2023-04-29 21:03:19 +03:00
60 changed files with 1429 additions and 348 deletions
+20 -1
View File
@@ -1546,6 +1546,7 @@ function selectCheckpoint(name){
desiredCheckpointName = name;
gradioApp().getElementById('change_checkpoint').click()
}
document.addEventListener('readystatechange', function (e) {
document.body.style.display = "none";
if(localStorage.hasOwnProperty('bg_color')){
@@ -1560,4 +1561,22 @@ window.onload = function() {
document.body.style.display = "none";
setTimeout(function(){document.body.style.display = "block";},1000)
}
}
function currentImg2imgSourceResolution(_, _, scaleBy){
var img = gradioApp().querySelector('#mode_img2img > div[style="display: block;"] img')
return img ? [img.naturalWidth, img.naturalHeight, scaleBy] : [0, 0, scaleBy]
}
function updateImg2imgResizeToTextAfterChangingImage(){
// At the time this is called from gradio, the image has no yet been replaced.
// There may be a better solution, but this is simple and straightforward so I'm going with it.
setTimeout(function() {
gradioApp().getElementById('img2img_update_resize_to').click()
}, 500);
return []
}