TenPoisk commited on
Commit
cc06673
·
1 Parent(s): ce1e5a1

Update sd-xl.py

Browse files
Files changed (1) hide show
  1. sd-xl.py +2 -14
sd-xl.py CHANGED
@@ -1,15 +1,3 @@
1
- import requests
2
 
3
- API_URL = "https://api-inference.huggingface.co/models/stabilityai/stable-diffusion-xl-refiner-1.0"
4
- headers = {"Authorization": "Bearer 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"}
5
-
6
- def query(payload):
7
- response = requests.post(API_URL, headers=headers, json=payload)
8
- return response.content
9
- image_bytes = query({
10
- "inputs": "Astronaut riding a horse",
11
- })
12
- # You can access the image with PIL.Image for example
13
- import io
14
- from PIL import Image
15
- image = Image.open(io.BytesIO(image_bytes))
 
1
+ import gradio as gr
2
 
3
+ gr.Interface.load("models/stabilityai/stable-diffusion-xl-refiner-1.0").launch()