diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-04-29 19:13:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-29 19:13:40 +0000 |
commit | 15c4e78b44e14d70b82dcb5b563251fed7be0766 (patch) | |
tree | 6f1acaae50a49544a08384b52739df3e2d803a10 /javascript/ui.js | |
parent | 3e5b3c79e49ec3a10174c250815dabce6efdddca (diff) | |
parent | 2e78e65a22bfa6b116ae18d12fdcb85ec8acd727 (diff) | |
download | stable-diffusion-webui-gfx803-15c4e78b44e14d70b82dcb5b563251fed7be0766.tar.gz stable-diffusion-webui-gfx803-15c4e78b44e14d70b82dcb5b563251fed7be0766.tar.bz2 stable-diffusion-webui-gfx803-15c4e78b44e14d70b82dcb5b563251fed7be0766.zip |
Merge branch 'dev' into feature/restore-progress
Diffstat (limited to 'javascript/ui.js')
-rw-r--r-- | javascript/ui.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/javascript/ui.js b/javascript/ui.js index c9df066d..e50b44ee 100644 --- a/javascript/ui.js +++ b/javascript/ui.js @@ -386,4 +386,21 @@ function restoreProgress (task_tag) { res[0] = 0 return res -}
\ No newline at end of file +} + +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 [] +} + |