Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -102,6 +102,9 @@ with gr.Blocks(css=css) as demo:
|
|
102 |
# Add a textbox to display the prompts used for generation
|
103 |
prompt_info = gr.Textbox(label="Prompts Used", lines=3, interactive=False)
|
104 |
|
|
|
|
|
|
|
105 |
# Tabbed interface to select either Prompt or Tags
|
106 |
with gr.Tabs() as tabs:
|
107 |
with gr.TabItem("Prompt Input") as prompt_tab:
|
@@ -112,6 +115,7 @@ with gr.Blocks(css=css) as demo:
|
|
112 |
placeholder="Enter your prompt",
|
113 |
container=False,
|
114 |
)
|
|
|
115 |
|
116 |
with gr.TabItem("Tag Selection") as tag_tab:
|
117 |
# Tag selection checkboxes for each tag group
|
@@ -129,6 +133,7 @@ with gr.Blocks(css=css) as demo:
|
|
129 |
selected_location_tags = gr.CheckboxGroup(choices=list(location_tags.keys()), label="Location Tags")
|
130 |
selected_camera_tags = gr.CheckboxGroup(choices=list(camera_tags.keys()), label="Camera Tags")
|
131 |
selected_atmosphere_tags = gr.CheckboxGroup(choices=list(atmosphere_tags.keys()), label="Atmosphere Tags")
|
|
|
132 |
|
133 |
# Full-width "Run" button
|
134 |
run_button = gr.Button("Run", scale=0, elem_id="run-button")
|
@@ -196,7 +201,7 @@ with gr.Blocks(css=css) as demo:
|
|
196 |
selected_participant_tags, selected_tribe_tags, selected_skin_tone_tags, selected_body_type_tags,
|
197 |
selected_tattoo_tags, selected_piercing_tags, selected_expression_tags, selected_eye_tags,
|
198 |
selected_hair_style_tags, selected_position_tags, selected_fetish_tags, selected_location_tags,
|
199 |
-
selected_camera_tags, selected_atmosphere_tags,
|
200 |
outputs=[result, seed, prompt_info]
|
201 |
)
|
202 |
|
|
|
102 |
# Add a textbox to display the prompts used for generation
|
103 |
prompt_info = gr.Textbox(label="Prompts Used", lines=3, interactive=False)
|
104 |
|
105 |
+
# State to track active tab
|
106 |
+
active_tab = gr.State("Prompt Input")
|
107 |
+
|
108 |
# Tabbed interface to select either Prompt or Tags
|
109 |
with gr.Tabs() as tabs:
|
110 |
with gr.TabItem("Prompt Input") as prompt_tab:
|
|
|
115 |
placeholder="Enter your prompt",
|
116 |
container=False,
|
117 |
)
|
118 |
+
prompt_tab.select(lambda: "Prompt Input", inputs=None, outputs=active_tab)
|
119 |
|
120 |
with gr.TabItem("Tag Selection") as tag_tab:
|
121 |
# Tag selection checkboxes for each tag group
|
|
|
133 |
selected_location_tags = gr.CheckboxGroup(choices=list(location_tags.keys()), label="Location Tags")
|
134 |
selected_camera_tags = gr.CheckboxGroup(choices=list(camera_tags.keys()), label="Camera Tags")
|
135 |
selected_atmosphere_tags = gr.CheckboxGroup(choices=list(atmosphere_tags.keys()), label="Atmosphere Tags")
|
136 |
+
tag_tab.select(lambda: "Tag Selection", inputs=None, outputs=active_tab)
|
137 |
|
138 |
# Full-width "Run" button
|
139 |
run_button = gr.Button("Run", scale=0, elem_id="run-button")
|
|
|
201 |
selected_participant_tags, selected_tribe_tags, selected_skin_tone_tags, selected_body_type_tags,
|
202 |
selected_tattoo_tags, selected_piercing_tags, selected_expression_tags, selected_eye_tags,
|
203 |
selected_hair_style_tags, selected_position_tags, selected_fetish_tags, selected_location_tags,
|
204 |
+
selected_camera_tags, selected_atmosphere_tags, active_tab],
|
205 |
outputs=[result, seed, prompt_info]
|
206 |
)
|
207 |
|