aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspace-nuko <24979496+space-nuko@users.noreply.github.com>2023-03-23 13:36:15 -0400
committerspace-nuko <24979496+space-nuko@users.noreply.github.com>2023-03-25 12:53:03 -0400
commit75e7eb9172fb62eb6fbbcaf71bdd4273b44acc52 (patch)
tree0233d28a2b6fabcb6272c4052d07d22846b8472e
parent7ea5d395c44be208f654b07ec7993aa2952f2510 (diff)
img2img resolution preview should use currently selected tab's image
-rw-r--r--javascript/ui.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/javascript/ui.js b/javascript/ui.js
index 8aa4a459..e564aabb 100644
--- a/javascript/ui.js
+++ b/javascript/ui.js
@@ -106,7 +106,14 @@ function create_tab_index_args(tabId, args){
function get_img2img_tab_index() {
let res = args_to_array(arguments)
- res.splice(-2)
+ res.splice(-2) // gradio also sends outputs to the arguments, pop them off
+ res[0] = get_tab_index('mode_img2img')
+ return res
+}
+
+function get_img2img_tab_index_for_res_preview() {
+ let res = args_to_array(arguments)
+ res.splice(-1) // gradio also sends outputs to the arguments, pop them off
res[0] = get_tab_index('mode_img2img')
return res
}
@@ -345,7 +352,7 @@ function selectCheckpoint(name){
}
-function onCalcResolutionImg2Img(init_img, scale, width, height, resize_mode){
+function onCalcResolutionImg2Img(mode, scale, width, height, resize_mode, init_img, sketch, init_img_with_mask, inpaint_color_sketch, init_img_inpaint){
i2iScale = gradioApp().getElementById('img2img_scale')
i2iWidth = gradioApp().getElementById('img2img_width')
i2iHeight = gradioApp().getElementById('img2img_height')
@@ -354,5 +361,5 @@ function onCalcResolutionImg2Img(init_img, scale, width, height, resize_mode){
setInactive(i2iWidth, scale > 1)
setInactive(i2iHeight, scale > 1)
- return [init_img, width, height, scale, resize_mode]
+ return [];
}