File size: 1,392 Bytes
1a77711
 
a326592
ed96bd7
0352e1e
90dd709
3dd37c8
ed96bd7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dda0c31
 
 
 
3dd37c8
ed96bd7
a326592
ed96bd7
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import gradio as gr

proc1 = gr.Interface.load("models/prompthero/funko-diffusion")

async def send_it1(inputs,proc1=proc1):
    output1= proc1(inputs)
    print(output1)
    return output1

with gr.Blocks() as myface:
    with gr.Group():
        with gr.Box():
            with gr.Row(elem_id="prompt-container").style(mobile_collapse=False, equal_height=True):
                with gr.Column():
                    text = gr.Textbox(
                        label="Enter your prompt",
                        show_label=False,
                        max_lines=1,
                        placeholder="Enter your prompt",
                        elem_id="prompt-text-input",
                    ).style(
                        border=(True, False, True, True),
                        rounded=(True, False, False, True),
                        container=False,
                    )
                    
                btn = gr.Button("Generate image").style(
                    margin=False,
                    rounded=(False, True, True, False),
                    full_width=False,
                )

        gallery = gr.Gallery(
            label="Generated images", show_label=False, elem_id="gallery"
        ).style(grid=[2], height="auto")

    

        btn.click(send_it1, inputs=[text], outputs=[gallery], api_name="text")

if __name__ == "__main__":
     myface.launch()