aboutsummaryrefslogtreecommitdiff
path: root/javascript/ui.js
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-01-14 22:43:01 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-01-14 22:43:01 +0300
commit86359535d6fb0899fa9e838d27f2006b929331d5 (patch)
tree48664577978963392b8d1714b6f49852608bcf58 /javascript/ui.js
parentf8c512478568293155539f616dce26c5e4495055 (diff)
add buttons to copy images between img2img tabs
Diffstat (limited to 'javascript/ui.js')
-rw-r--r--javascript/ui.js21
1 files changed, 19 insertions, 2 deletions
diff --git a/javascript/ui.js b/javascript/ui.js
index 1e04a8f4..f8279124 100644
--- a/javascript/ui.js
+++ b/javascript/ui.js
@@ -45,10 +45,27 @@ function switch_to_txt2img(){
return args_to_array(arguments);
}
-function switch_to_img2img(){
+function switch_to_img2img_tab(no){
gradioApp().querySelector('#tabs').querySelectorAll('button')[1].click();
- gradioApp().getElementById('mode_img2img').querySelectorAll('button')[0].click();
+ gradioApp().getElementById('mode_img2img').querySelectorAll('button')[no].click();
+}
+function switch_to_img2img(){
+ switch_to_img2img_tab(0);
+ return args_to_array(arguments);
+}
+
+function switch_to_sketch(){
+ switch_to_img2img_tab(1);
+ return args_to_array(arguments);
+}
+
+function switch_to_inpaint(){
+ switch_to_img2img_tab(2);
+ return args_to_array(arguments);
+}
+function switch_to_inpaint_sketch(){
+ switch_to_img2img_tab(3);
return args_to_array(arguments);
}