|
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() |
|
|