import gradio as gr def greet(name): return "Hello " + name + "!" with gr.Blocks() as demo: with gr.Row(): with gr.Column(scale=1): text1 = gr.Textbox(label="API Key") name = gr.Textbox(label="Prompt") greet_btn = gr.Button("Greet") with gr.Column(scale=1): output = gr.Image() greet_btn.click(fn=greet, inputs=name, outputs=output, api_name="greet") demo.launch()