File size: 446 Bytes
8370647
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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()