aboutsummaryrefslogtreecommitdiff
path: root/javascript/ui.js
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-03-28 22:23:40 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-03-28 22:23:40 +0300
commitd667fc435f6210575ba50a6f3a05d3853b233caa (patch)
tree37935bc0eaadd1a2983cc6d834a291294197ec3c /javascript/ui.js
parent3856ada5cc9ac4124e20ff311ce7aa77330845d9 (diff)
add "resize by" and "resize to" tabs to img2img
Diffstat (limited to 'javascript/ui.js')
-rw-r--r--javascript/ui.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/javascript/ui.js b/javascript/ui.js
index 4a440193..dc538231 100644
--- a/javascript/ui.js
+++ b/javascript/ui.js
@@ -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]
+}