|
@@ -143,14 +143,6 @@ function confirm_clear_prompt(prompt, negative_prompt) {
|
|
|
|
|
|
|
|
|
opts = {}
|
|
|
-function apply_settings(jsdata){
|
|
|
- console.log(jsdata)
|
|
|
-
|
|
|
- opts = JSON.parse(jsdata)
|
|
|
-
|
|
|
- return jsdata
|
|
|
-}
|
|
|
-
|
|
|
onUiUpdate(function(){
|
|
|
if(Object.keys(opts).length != 0) return;
|
|
|
|
|
@@ -160,7 +152,7 @@ onUiUpdate(function(){
|
|
|
textarea = json_elem.querySelector('textarea')
|
|
|
jsdata = textarea.value
|
|
|
opts = JSON.parse(jsdata)
|
|
|
-
|
|
|
+ executeCallbacks(optionsChangedCallbacks);
|
|
|
|
|
|
Object.defineProperty(textarea, 'value', {
|
|
|
set: function(newValue) {
|
|
@@ -171,6 +163,8 @@ onUiUpdate(function(){
|
|
|
if (oldValue != newValue) {
|
|
|
opts = JSON.parse(textarea.value)
|
|
|
}
|
|
|
+
|
|
|
+ executeCallbacks(optionsChangedCallbacks);
|
|
|
},
|
|
|
get: function() {
|
|
|
var valueProp = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, 'value');
|
|
@@ -201,6 +195,19 @@ onUiUpdate(function(){
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+
|
|
|
+onOptionsChanged(function(){
|
|
|
+ elem = gradioApp().getElementById('sd_checkpoint_hash')
|
|
|
+ sd_checkpoint_hash = opts.sd_checkpoint_hash || ""
|
|
|
+ shorthash = sd_checkpoint_hash.substr(0,10)
|
|
|
+
|
|
|
+ if(elem && elem.textContent != shorthash){
|
|
|
+ elem.textContent = shorthash
|
|
|
+ elem.title = sd_checkpoint_hash
|
|
|
+ elem.href = "https://google.com/search?q=" + sd_checkpoint_hash
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
let txt2img_textarea, img2img_textarea = undefined;
|
|
|
let wait_time = 800
|
|
|
let token_timeout;
|