Skip to content

Commit c6b2e7c

Browse files
author
legionfu
committed
Implementing dropdownbox operations using python
1 parent 9a4eda5 commit c6b2e7c

File tree

2 files changed

+375
-246
lines changed

2 files changed

+375
-246
lines changed

javascript/state.core.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -653,14 +653,13 @@ state.core = (function () {
653653
store.clear();
654654
store.load(json_obj);
655655
actions.applyState();
656-
657-
const button = gradioApp().getElementById("lightdiffusionflow_set_elements");
658-
button.click();
659656

660657
return;
661658
},
662659
startImportImage: function (index){
663660

661+
console.log(`---------${img_elem_keys}---------------`)
662+
console.log(`---------${index}-----${img_elem_keys.length}-----------`)
664663
switch_tab_dict = {
665664
"txt2img_invisible_img2img_image": "switch_to_img2img()",
666665
"txt2img_invisible_img2img_sketch": "switch_to_sketch()",
@@ -678,7 +677,6 @@ state.core = (function () {
678677
}
679678

680679
state.utils.sleep(300).then(() => {
681-
682680
try{
683681
key = "txt2img_invisible_"+img_elem_keys[Number(index)+1]
684682
//console.log(key)
@@ -688,9 +686,14 @@ state.core = (function () {
688686
} catch (error) {
689687
console.warn('[startImportImage]: Error:', error);
690688
}
691-
692689
});
693690

691+
if(Number(index)+1 >= img_elem_keys.length){ // 图片导入完成
692+
console.log(lightdiffusionflow_set_dropdowns)
693+
const button = gradioApp().getElementById("lightdiffusionflow_set_dropdowns");
694+
button.click();
695+
}
696+
694697
},
695698
output_log: function (msg, style=""){
696699
fetch(`/lightdiffusionflow/local/output_log?msg=${msg}&style=${style}`).then(() => {

0 commit comments

Comments
 (0)