Merge pull request #9108 from AUTOMATIC1111/img2img-scale-by

add "resize by" and "resize to" tabs to img2img
This commit is contained in:
AUTOMATIC1111
2023-04-29 18:21:28 +03:00
committed by GitHub
4 changed files with 78 additions and 7 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]
}