Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -77,9 +77,7 @@ css = """
|
|
77 |
with gr.Blocks(css=css) as demo:
|
78 |
|
79 |
with gr.Column(elem_id="col-container"):
|
80 |
-
gr.Markdown("""
|
81 |
-
# Text-to-Image Gradio Template
|
82 |
-
""")
|
83 |
|
84 |
# Display result image at the top
|
85 |
result = gr.Image(label="Result", show_label=False)
|
@@ -106,9 +104,10 @@ with gr.Blocks(css=css) as demo:
|
|
106 |
with gr.Column():
|
107 |
tag_selection_2 = gr.CheckboxGroup(choices=list(tag_options_2.keys()), label="Select Tags (Theme)")
|
108 |
with gr.Column():
|
109 |
-
tag_selection_3 = gr.CheckboxGroup(choices=list(tag_options_3.keys()), label="Select Tags (
|
110 |
with gr.Column():
|
111 |
-
tag_selection_4 = gr.CheckboxGroup(choices=list(tag_options_4.keys()), label="Select Tags (
|
|
|
112 |
use_tags = gr.State(True)
|
113 |
|
114 |
# Full-width "Run" button
|
@@ -166,15 +165,10 @@ with gr.Blocks(css=css) as demo:
|
|
166 |
value=35,
|
167 |
)
|
168 |
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
def check_tab(prompt, tag_selection_1, tag_selection_2, tag_selection_3, tag_selection_4, selected_tab):
|
175 |
-
return selected_tab == "Tag Selection"
|
176 |
-
|
177 |
-
tabs.change(check_tab, inputs=[prompt, tag_selection_1, tag_selection_2, tag_selection_3, tag_selection_4, tabs], outputs=use_tags)
|
178 |
|
179 |
gr.on(
|
180 |
triggers=[run_button.click, prompt.submit],
|
|
|
77 |
with gr.Blocks(css=css) as demo:
|
78 |
|
79 |
with gr.Column(elem_id="col-container"):
|
80 |
+
gr.Markdown("""# Text-to-Image Gradio Template""")
|
|
|
|
|
81 |
|
82 |
# Display result image at the top
|
83 |
result = gr.Image(label="Result", show_label=False)
|
|
|
104 |
with gr.Column():
|
105 |
tag_selection_2 = gr.CheckboxGroup(choices=list(tag_options_2.keys()), label="Select Tags (Theme)")
|
106 |
with gr.Column():
|
107 |
+
tag_selection_3 = gr.CheckboxGroup(choices=list(tag_options_3.keys()), label="Select Tags (Other)")
|
108 |
with gr.Column():
|
109 |
+
tag_selection_4 = gr.CheckboxGroup(choices=list(tag_options_4.keys()), label="Select Tags (Additional)")
|
110 |
+
|
111 |
use_tags = gr.State(True)
|
112 |
|
113 |
# Full-width "Run" button
|
|
|
165 |
value=35,
|
166 |
)
|
167 |
|
168 |
+
gr.Examples(
|
169 |
+
examples=examples,
|
170 |
+
inputs=[prompt]
|
171 |
+
)
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
gr.on(
|
174 |
triggers=[run_button.click, prompt.submit],
|