Spaces:
Running
Running
Update frontend/webui/ui.py
Browse files- frontend/webui/ui.py +7 -11
frontend/webui/ui.py
CHANGED
@@ -34,7 +34,7 @@ def _get_footer_message() -> str:
|
|
34 |
" Rupesh Sreeraman</a></p></center>"
|
35 |
)
|
36 |
return footer_msg
|
37 |
-
mycss=""" #
|
38 |
|
39 |
def get_web_ui() -> gr.Blocks:
|
40 |
def change_mode(mode):
|
@@ -45,31 +45,27 @@ def get_web_ui() -> gr.Blocks:
|
|
45 |
app_settings.settings.lcm_diffusion_setting.use_lcm_lora = True
|
46 |
elif mode == "LCM-OpenVINO":
|
47 |
app_settings.settings.lcm_diffusion_setting.use_openvino = True
|
48 |
-
|
49 |
with gr.Blocks(
|
50 |
css=mycss,
|
51 |
title="FastSD CPU",
|
52 |
) as fastsd_web_ui:
|
53 |
gr.HTML("<center><H1>FastSD CPU</H1></center>")
|
54 |
-
with gr.Column(scale=1):
|
55 |
current_mode = "LCM"
|
56 |
if app_settings.settings.lcm_diffusion_setting.use_openvino:
|
57 |
current_mode = "LCM-OpenVINO"
|
58 |
elif app_settings.settings.lcm_diffusion_setting.use_lcm_lora:
|
59 |
current_mode = "LCM-LoRA"
|
60 |
with gr.Column(scale=1):
|
61 |
-
with gr.Row(elem_id="
|
62 |
-
model_text_area2 = gr.Textbox(value=" ", lines=
|
63 |
update_button = gr.Button("Update Dropdown" )
|
64 |
-
model_dropdown = gr.Dropdown(choices=model_list, label=""
|
65 |
model_dropdown.change( fn=update_choice, inputs=[], outputs=[], )
|
66 |
model_text_area = gr.Textbox(visible=False, value="\n".join(model_list), lines=10, label="")
|
|
|
67 |
update_button.click( fn=update_model_array, inputs=model_text_area2, outputs=[model_dropdown, model_text_area], )
|
68 |
-
mode = gr.Radio(
|
69 |
-
["LCM", "LCM-LoRA", "LCM-OpenVINO"],
|
70 |
-
label="Mode",
|
71 |
-
info="Current working mode",
|
72 |
-
value=current_mode,
|
73 |
)
|
74 |
mode.change(change_mode, inputs=mode)
|
75 |
|
|
|
34 |
" Rupesh Sreeraman</a></p></center>"
|
35 |
)
|
36 |
return footer_msg
|
37 |
+
mycss=""" #snake1 div label span{display:none;}"""
|
38 |
|
39 |
def get_web_ui() -> gr.Blocks:
|
40 |
def change_mode(mode):
|
|
|
45 |
app_settings.settings.lcm_diffusion_setting.use_lcm_lora = True
|
46 |
elif mode == "LCM-OpenVINO":
|
47 |
app_settings.settings.lcm_diffusion_setting.use_openvino = True
|
48 |
+
|
49 |
with gr.Blocks(
|
50 |
css=mycss,
|
51 |
title="FastSD CPU",
|
52 |
) as fastsd_web_ui:
|
53 |
gr.HTML("<center><H1>FastSD CPU</H1></center>")
|
|
|
54 |
current_mode = "LCM"
|
55 |
if app_settings.settings.lcm_diffusion_setting.use_openvino:
|
56 |
current_mode = "LCM-OpenVINO"
|
57 |
elif app_settings.settings.lcm_diffusion_setting.use_lcm_lora:
|
58 |
current_mode = "LCM-LoRA"
|
59 |
with gr.Column(scale=1):
|
60 |
+
with gr.Row(elem_id="snake1"):
|
61 |
+
model_text_area2 = gr.Textbox(value=" ", lines=1, placeholder="Enter a new model")
|
62 |
update_button = gr.Button("Update Dropdown" )
|
63 |
+
model_dropdown = gr.Dropdown(choices=model_list, label="models" )
|
64 |
model_dropdown.change( fn=update_choice, inputs=[], outputs=[], )
|
65 |
model_text_area = gr.Textbox(visible=False, value="\n".join(model_list), lines=10, label="")
|
66 |
+
with gr.Row(elem_id="snake"):
|
67 |
update_button.click( fn=update_model_array, inputs=model_text_area2, outputs=[model_dropdown, model_text_area], )
|
68 |
+
mode = gr.Radio(choices=["LCM", "LCM-LoRA", "LCM-OpenVINO"], label="Mode", info="Current working mode", value=current_mode,
|
|
|
|
|
|
|
|
|
69 |
)
|
70 |
mode.change(change_mode, inputs=mode)
|
71 |
|