mirror of
https://github.com/Paillat-dev/viralfactory.git
synced 2026-01-02 01:06:19 +00:00
Add visibility option for engine dropdown
This commit is contained in:
@@ -46,6 +46,7 @@ class GenerateUI:
|
|||||||
with gr.Blocks() as col1:
|
with gr.Blocks() as col1:
|
||||||
for engine_type, engines in ENGINES.items():
|
for engine_type, engines in ENGINES.items():
|
||||||
multiselect = engines["multiple"]
|
multiselect = engines["multiple"]
|
||||||
|
show_dropdown = engines.get("show_dropdown", True)
|
||||||
engines = engines["classes"]
|
engines = engines["classes"]
|
||||||
with gr.Tab(engine_type) as engine_tab:
|
with gr.Tab(engine_type) as engine_tab:
|
||||||
engine_names = [engine.name for engine in engines]
|
engine_names = [engine.name for engine in engines]
|
||||||
@@ -54,6 +55,7 @@ class GenerateUI:
|
|||||||
value=engine_names[0],
|
value=engine_names[0],
|
||||||
multiselect=multiselect,
|
multiselect=multiselect,
|
||||||
label="Engine provider:" if not multiselect else "Engine providers:",
|
label="Engine provider:" if not multiselect else "Engine providers:",
|
||||||
|
visible=show_dropdown,
|
||||||
)
|
)
|
||||||
inputs.append(engine_dropdown)
|
inputs.append(engine_dropdown)
|
||||||
engine_rows = []
|
engine_rows = []
|
||||||
@@ -61,7 +63,7 @@ class GenerateUI:
|
|||||||
with gr.Group(
|
with gr.Group(
|
||||||
visible=(i == 0)
|
visible=(i == 0)
|
||||||
) as engine_row:
|
) as engine_row:
|
||||||
gr.Label(engine.name)
|
gr.Markdown(value = " ", label=f"{engine.name}", show_label=True)
|
||||||
engine_rows.append(engine_row)
|
engine_rows.append(engine_row)
|
||||||
options = engine.get_options()
|
options = engine.get_options()
|
||||||
inputs.extend(options)
|
inputs.extend(options)
|
||||||
|
|||||||
Reference in New Issue
Block a user