abidlabs HF Staff commited on
Commit
8165e64
·
verified ·
1 Parent(s): 9e0b026

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from gradio_client import Client
3
+
4
+ def text_to_image(prompt):
5
+ client = Client("hysts/SDXL", headers={"x-ip-token": x_ip_token})
6
+ img = client.predict(prompt, api_name="/predict")
7
+ return img
8
+
9
+ def generate(prompt):
10
+ return text_to_image(prompt)
11
+
12
+ with gr.Blocks() as demo:
13
+ image = gr.Image()
14
+ prompt = gr.Textbox(max_lines=1)
15
+ prompt.submit(text_to_image, [prompt], [image])
16
+
17
+ demo.launch()