aboutsummaryrefslogtreecommitdiff
path: root/javascript/ui.js
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/ui.js')
-rw-r--r--javascript/ui.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/javascript/ui.js b/javascript/ui.js
index 133d6ff3..dbb8132f 100644
--- a/javascript/ui.js
+++ b/javascript/ui.js
@@ -442,5 +442,31 @@ function updateImg2imgResizeToTextAfterChangingImage() {
gradioApp().getElementById('img2img_update_resize_to').click();
}, 500);
+ return []
+
+}
+
+
+
+function setRandomSeed(elem_id) {
+ var input = gradioApp().querySelector("#" + elem_id + " input");
+ if (!input) return [];
+
+ input.value = "-1";
+ updateInput(input);
+ return [];
+}
+
+function switchWidthHeight(tabname) {
+ var width = gradioApp().querySelector("#" + tabname + "_width input[type=number]");
+ var height = gradioApp().querySelector("#" + tabname + "_height input[type=number]");
+ if (!width || !height) return [];
+
+ var tmp = width.value;
+ width.value = height.value;
+ height.value = tmp;
+
+ updateInput(width);
+ updateInput(height);
return [];
}