change gradio callback from change to release in a bunch of places now that it's fixed in gradio

This commit is contained in:
AUTOMATIC
2023-04-29 19:39:22 +03:00
parent a95dc02535
commit e40b2d947d
2 changed files with 21 additions and 2 deletions

View File

@@ -366,3 +366,14 @@ 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 []
}