janedata commited on
Commit
37959ba
·
verified ·
1 Parent(s): 95bc182

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -1
app.py CHANGED
@@ -1 +1,21 @@
1
- #main file for placeholder
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+ import requests
3
+ import io
4
+
5
+ from PIL import Image
6
+
7
+ #define API URL, where we want to send request to
8
+ #API token is used for acess
9
+ from huggingface_hub import InferenceClient
10
+
11
+ client = InferenceClient(
12
+ provider="hf-inference",
13
+ api_key="hf_#############"
14
+ )
15
+
16
+ # output is a PIL.Image object
17
+ image = client.text_to_image(
18
+ "Astronaut riding a horse",
19
+ model="sd-community/sdxl-flash"
20
+ )
21
+