def generate_art(character_dropdown, seed_slider): if character_dropdown == "NONE": return "NULL" else: return "NOT NULL" return "Hello There!" HTML_TEMPLATE = """

Shakespeare Dialogue Generator

Generate new dialogue for Shakespearean character by selecting character from dropdown.

Romeo
Midjourney Style
Juliet
Dreams Style
MacBeth
Moebius Style
A
Hong Kong born artist inspired by western and eastern influences
S
WLOP (Born 1987) is known for Digital Art (NFTs)
""" with gr.Blocks() as interface: gr.HTML(value=HTML_TEMPLATE, show_label=False) with gr.Row(): character_dropdown = gr.Dropdown( label="Select a Character", choices=["NONE","ROMEO","OPHELIA","DESDEMONA","MACDUFF"], value='Dream' ) seed_slider = gr.Slider( label="Random Seed", minimum=0, maximum=1000, step=1, value=42 ) inputs = [character_dropdown, seed_slider] with gr.Row(): outputs = gr.Textbox( label="Generated Dialogue" ) with gr.Row(): button = gr.Button("Generate Dialogue") button.click(generate_art, inputs=inputs, outputs=outputs) if __name__ == "__main__": interface.launch(enable_queue=True)