""" Module for web application """ import gradio from inference import generate_image with gradio.Blocks() as block: gradio.Markdown("

Image Generator

") text = gradio.Textbox( label = "Text prompt", max_lines = 1, ) btn = gradio.Button("Run") gallery = gradio.Gallery( label = "Result image", ).style( # Number of images per category columns = [3], height = "auto", ) btn.click(fn=generate_image, inputs=text, outputs=gallery) gradio.Markdown("

2019130032 - Fedora Yoshe Juandy

") # Use 'queue' if the inference's time > 60s # Use 'share' for more than one user usage block.queue().launch()