diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-04-29 20:29:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-29 20:29:23 +0300 |
commit | 0d32cb2cf5ce1927295dcf8de0b2989968e95c38 (patch) | |
tree | b4c96b7d9056890fde266cd9f09afc6c9aa09db4 /javascript/ui.js | |
parent | aac478cb9d39354bdb7778a37529d931dc3f87d6 (diff) | |
parent | 90e465982270b85812c94961696b7ba4d2c4d38c (diff) |
Merge branch 'dev' into master
Diffstat (limited to 'javascript/ui.js')
-rw-r--r-- | javascript/ui.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/javascript/ui.js b/javascript/ui.js index 4a440193..0ba92ef8 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -361,3 +361,19 @@ 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] +} + +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 [] +} |