File size: 397 Bytes
37959ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio
import requests
import io

from PIL import Image

#define API URL, where we want to send request to
#API token is used for acess
from huggingface_hub import InferenceClient

client = InferenceClient(
	provider="hf-inference",
	api_key="hf_#############"
)

# output is a PIL.Image object
image = client.text_to_image(
	"Astronaut riding a horse",
	model="sd-community/sdxl-flash"
)