add "resize by" and "resize to" tabs to img2img

This commit is contained in:
AUTOMATIC
2023-03-28 22:23:40 +03:00
parent 3856ada5cc
commit d667fc435f
4 changed files with 75 additions and 5 deletions

View File

@@ -361,3 +361,8 @@ function selectCheckpoint(name){
desiredCheckpointName = name;
gradioApp().getElementById('change_checkpoint').click()
}
function currentImg2imgSourceResolution(_, _, scaleBy){
var img = gradioApp().querySelector('#mode_img2img > div[style="display: block;"] img')
return img ? [img.naturalWidth, img.naturalHeight, scaleBy] : [0, 0, scaleBy]
}