Skip to content

Commit 7ee2755

Browse files
author
legionfu
committed
add elem_id
1 parent 160efc9 commit 7ee2755

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/state_api.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -919,26 +919,26 @@ def custom_ui(self):
919919
State_Comps["export"] = []
920920
State_Comps["outlog"] = []
921921

922-
with gr.Accordion('LightDiffusionFlow '+lightdiffusionflow_version.lightdiffusionflow_version, open=True, visible=True):
922+
cur_mode = "img2img" if self.is_img2img else "txt2img"
923+
with gr.Accordion('LightDiffusionFlow '+lightdiffusionflow_version.lightdiffusionflow_version, open=True, visible=True, elem_id=cur_mode+'_lightdiffusionflow'):
923924
with gr.Row():
924-
lightdiffusionflow_file = gr.File(label="LightDiffusionFlow File",file_count="single", file_types=[File_extension])
925+
lightdiffusionflow_file = gr.File(label="LightDiffusionFlow File",file_count="single", file_types=[File_extension], elem_id=cur_mode+'_ldf_import')
925926
State_Comps["import"].append(lightdiffusionflow_file)
926927

927928
with gr.Column(scale=1):
928929
gr.HTML(label="",value='''
929930
<a style ="text-decoration:underline;color:cornflowerblue;",
930931
href="https://www.lightflow.ai/">开源社区</a>''')
931-
State_Comps["outlog"].append(gr.HTML(label="Output Log",value='''
932+
State_Comps["outlog"].append(gr.HTML(label="Output Log",elem_id=cur_mode+'_ldf_outlog',value='''
932933
<p style=color:Tomato;>Welcome to LightDiffusionFlow! \(^o^)/~</p>
933934
<p style=color:MediumSeaGreen;>Welcome to LightDiffusionFlow! \(^o^)/~</p>
934935
<p style=color:DodgerBlue;>Welcome to LightDiffusionFlow! \(^o^)/~</p>'''))
935936

936937
with gr.Row():
937-
export_config = gr.Button(value='Export')
938+
export_config = gr.Button(value='Export',elem_id=cur_mode+'_ldf_export')
938939
State_Comps["export"].append(export_config)
939940

940941
if(not self.is_img2img):
941-
942942
State_Comps["background_import"] = gr.File(label="LightDiffusionFlow File",file_count="single",
943943
file_types=[File_extension],visible=False)
944944
State_Comps["json2js"] = gr.Textbox(label="json2js",visible=False)

0 commit comments

Comments
 (0)