Commit ·
725fd8a
1
Parent(s): 347eac7
minor cleanups
Browse files120 unmodified lines1211221231241251261271281291301311321331341351361372 unmodified lines140141142143144145146147148149150151152153154155120 unmodified lineswith gr.Row():with gr.Column(scale=5):gr.Markdown("##### Prompt (Englisch)", elem_classes="input-label")prompt = gr.Textbox(label="Prompt (Englisch)", value="",placeholder="Was möchtest Du auf der Weihnachtskarte abbilden?",autofocus=True, container=False, lines=2)with gr.Column(scale=1, min_width="80px"):gr.Markdown("##### Stil", elem_classes="input-label")style_selection = gr.Dropdown(choices=style_keys, value='Kinofilm', container=False, elem_id="style-selection")with gr.Column(scale=1, min_width="80px"):progress_html = gr.HTML(visible=True, elem_id='progress-bar', elem_classes='progress-bar')run_button = gr.Button(value="Weihnachtskarte\nerstellen", variant='primary', elem_id='generate-button', )with gr.Row():promt_example_de = gr.Textbox(visible=False)gr.Examples(elem_id="prompt-examples", examples=PROMPT_EXAMPLES, inputs=[promt_example_de], cache_examples=False)toggle_greet = gr.Checkbox(label="Persönliche Weihnachtsgrüße hinzufügen", elem_id="toggle-greet-checkbox",2 unmodified linesgreeting_row=gr.Row(elem_classes='panel-container')with greeting_row:with gr.Column():greet = gr.Textbox(value=EXAMPLE_GREETINGS[0], placeholder="", interactive=True, container=False, lines=2, max_lines=2)greet_active = gr.Textbox(value=EXAMPLE_GREETINGS[0], visible=False)greet_examples = gr.Examples(elem_id="greet-examples", examples=EXAMPLE_GREETINGS, inputs=[greet])generated_image = gr.Image(visible=False, type='pil', label="Erstelle Weihnachtskarte...", elem_classes="generated-image", width=1280,value=INIT_IMAGE_PATH, interactive=False, show_share_button=False, show_download_button=False)generated_image_overlayed = gr.Image(label="Weihnachtskarte", type='pil', elem_classes="generated-image", width=1280,value=overlay_image(INIT_IMAGE_PATH, toggle_greet.value, greet.value))generated_image_path = gr.Text(visible=False, value=INIT_IMAGE_PATH)promt_example_de.change(fn=translate_promt_example, inputs=[promt_example_de], outputs=[prompt], queue=False)toggle_greet.change(fn=toggle_greet_visibility, inputs=[toggle_greet], outputs=[greeting_row], queue=False, show_progress=False)\120 unmodified lines1211221231241251261271281291301311321331341351362 unmodified lines139140141142143144145146147148149150151152153154120 unmodified lineswith gr.Row():with gr.Column(scale=5):gr.Markdown("##### Prompt (Englisch)", elem_classes="input-label")prompt = gr.Textbox(value="", placeholder="Was möchtest Du auf der Weihnachtskarte abbilden?",autofocus=True, container=False, show_label=False, lines=2)with gr.Column(scale=1, min_width="80px"):gr.Markdown("##### Stil", elem_classes="input-label")style_selection = gr.Dropdown(choices=style_keys, value='Kinofilm', container=False, show_label=False, elem_id="style-selection")with gr.Column(scale=1, min_width="80px"):progress_html = gr.HTML(visible=True, elem_id='progress-bar', elem_classes='progress-bar')run_button = gr.Button(value="Weihnachtskarte\nerstellen", variant='primary', elem_id='generate-button', )with gr.Row():promt_example_de = gr.Textbox(visible=False, container=False, show_label=False)gr.Examples(elem_id="prompt-examples", examples=PROMPT_EXAMPLES, inputs=[promt_example_de], cache_examples=False)toggle_greet = gr.Checkbox(label="Persönliche Weihnachtsgrüße hinzufügen", elem_id="toggle-greet-checkbox",2 unmodified linesgreeting_row=gr.Row(elem_classes='panel-container')with greeting_row:with gr.Column():greet = gr.Textbox(value=EXAMPLE_GREETINGS[0], placeholder="", interactive=True, container=False, lines=2, max_lines=2, show_label=False)greet_active = gr.Textbox(value=EXAMPLE_GREETINGS[0], visible=False, container=False, show_label=False)greet_examples = gr.Examples(elem_id="greet-examples", examples=EXAMPLE_GREETINGS, inputs=[greet])generated_image = gr.Image(visible=False, type='pil', label="Erstelle Weihnachtskarte...", elem_classes="generated-image", width=1280,value=INIT_IMAGE_PATH, interactive=False, show_share_button=False, show_download_button=False)generated_image_overlayed = gr.Image(label="Weihnachtskarte", type='pil', elem_classes="generated-image", width=1280,value=overlay_image(INIT_IMAGE_PATH, toggle_greet.value, greet.value))generated_image_path = gr.Text(visible=False, value=INIT_IMAGE_PATH, container=False, show_label=False)promt_example_de.change(fn=translate_promt_example, inputs=[promt_example_de], outputs=[prompt], queue=False)toggle_greet.change(fn=toggle_greet_visibility, inputs=[toggle_greet], outputs=[greeting_row], queue=False, show_progress=False)\
webui.py+8-9