Spaces:
Paused
Paused
johann-foerster
commited on
Commit
·
725fd8a
1
Parent(s):
347eac7
minor cleanups
Browse files
webui.py
CHANGED
@@ -121,17 +121,16 @@ with shared.gradio_root:
|
|
121 |
with gr.Row():
|
122 |
with gr.Column(scale=5):
|
123 |
gr.Markdown("##### Prompt (Englisch)", elem_classes="input-label")
|
124 |
-
prompt = gr.Textbox(
|
125 |
-
|
126 |
-
autofocus=True, container=False, lines=2)
|
127 |
with gr.Column(scale=1, min_width="80px"):
|
128 |
gr.Markdown("##### Stil", elem_classes="input-label")
|
129 |
-
style_selection = gr.Dropdown(choices=style_keys, value='Kinofilm', container=False, elem_id="style-selection")
|
130 |
with gr.Column(scale=1, min_width="80px"):
|
131 |
progress_html = gr.HTML(visible=True, elem_id='progress-bar', elem_classes='progress-bar')
|
132 |
run_button = gr.Button(value="Weihnachtskarte\nerstellen", variant='primary', elem_id='generate-button', )
|
133 |
with gr.Row():
|
134 |
-
promt_example_de = gr.Textbox(visible=False)
|
135 |
gr.Examples(elem_id="prompt-examples", examples=PROMPT_EXAMPLES, inputs=[promt_example_de], cache_examples=False)
|
136 |
|
137 |
toggle_greet = gr.Checkbox(label="Persönliche Weihnachtsgrüße hinzufügen", elem_id="toggle-greet-checkbox",
|
@@ -140,16 +139,16 @@ with shared.gradio_root:
|
|
140 |
greeting_row=gr.Row(elem_classes='panel-container')
|
141 |
with greeting_row:
|
142 |
with gr.Column():
|
143 |
-
greet = gr.Textbox(value=EXAMPLE_GREETINGS[0], placeholder="", interactive=True, container=False, lines=2, max_lines=2)
|
144 |
-
greet_active = gr.Textbox(value=EXAMPLE_GREETINGS[0], visible=False)
|
145 |
greet_examples = gr.Examples(elem_id="greet-examples", examples=EXAMPLE_GREETINGS, inputs=[greet])
|
146 |
|
147 |
|
148 |
generated_image = gr.Image(visible=False, type='pil', label="Erstelle Weihnachtskarte...", elem_classes="generated-image", width=1280,
|
149 |
-
|
150 |
generated_image_overlayed = gr.Image(label="Weihnachtskarte", type='pil', elem_classes="generated-image", width=1280,
|
151 |
value=overlay_image(INIT_IMAGE_PATH, toggle_greet.value, greet.value))
|
152 |
-
generated_image_path = gr.Text(visible=False, value=INIT_IMAGE_PATH)
|
153 |
|
154 |
promt_example_de.change(fn=translate_promt_example, inputs=[promt_example_de], outputs=[prompt], queue=False)
|
155 |
toggle_greet.change(fn=toggle_greet_visibility, inputs=[toggle_greet], outputs=[greeting_row], queue=False, show_progress=False)\
|
|
|
121 |
with gr.Row():
|
122 |
with gr.Column(scale=5):
|
123 |
gr.Markdown("##### Prompt (Englisch)", elem_classes="input-label")
|
124 |
+
prompt = gr.Textbox(value="", placeholder="Was möchtest Du auf der Weihnachtskarte abbilden?",
|
125 |
+
autofocus=True, container=False, show_label=False, lines=2)
|
|
|
126 |
with gr.Column(scale=1, min_width="80px"):
|
127 |
gr.Markdown("##### Stil", elem_classes="input-label")
|
128 |
+
style_selection = gr.Dropdown(choices=style_keys, value='Kinofilm', container=False, show_label=False, elem_id="style-selection")
|
129 |
with gr.Column(scale=1, min_width="80px"):
|
130 |
progress_html = gr.HTML(visible=True, elem_id='progress-bar', elem_classes='progress-bar')
|
131 |
run_button = gr.Button(value="Weihnachtskarte\nerstellen", variant='primary', elem_id='generate-button', )
|
132 |
with gr.Row():
|
133 |
+
promt_example_de = gr.Textbox(visible=False, container=False, show_label=False)
|
134 |
gr.Examples(elem_id="prompt-examples", examples=PROMPT_EXAMPLES, inputs=[promt_example_de], cache_examples=False)
|
135 |
|
136 |
toggle_greet = gr.Checkbox(label="Persönliche Weihnachtsgrüße hinzufügen", elem_id="toggle-greet-checkbox",
|
|
|
139 |
greeting_row=gr.Row(elem_classes='panel-container')
|
140 |
with greeting_row:
|
141 |
with gr.Column():
|
142 |
+
greet = gr.Textbox(value=EXAMPLE_GREETINGS[0], placeholder="", interactive=True, container=False, lines=2, max_lines=2, show_label=False)
|
143 |
+
greet_active = gr.Textbox(value=EXAMPLE_GREETINGS[0], visible=False, container=False, show_label=False)
|
144 |
greet_examples = gr.Examples(elem_id="greet-examples", examples=EXAMPLE_GREETINGS, inputs=[greet])
|
145 |
|
146 |
|
147 |
generated_image = gr.Image(visible=False, type='pil', label="Erstelle Weihnachtskarte...", elem_classes="generated-image", width=1280,
|
148 |
+
value=INIT_IMAGE_PATH, interactive=False, show_share_button=False, show_download_button=False)
|
149 |
generated_image_overlayed = gr.Image(label="Weihnachtskarte", type='pil', elem_classes="generated-image", width=1280,
|
150 |
value=overlay_image(INIT_IMAGE_PATH, toggle_greet.value, greet.value))
|
151 |
+
generated_image_path = gr.Text(visible=False, value=INIT_IMAGE_PATH, container=False, show_label=False)
|
152 |
|
153 |
promt_example_de.change(fn=translate_promt_example, inputs=[promt_example_de], outputs=[prompt], queue=False)
|
154 |
toggle_greet.change(fn=toggle_greet_visibility, inputs=[toggle_greet], outputs=[greeting_row], queue=False, show_progress=False)\
|