Update README.md
Browse files
README.md
CHANGED
@@ -34,6 +34,20 @@ It is lora fine-tuned model based on stabilityai/sdxl-turbo
|
|
34 |
|
35 |
You can use it via interface api:
|
36 |
```Python
|
|
|
|
|
|
|
37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
```
|
39 |
Or donwload model from Files and Versions tab
|
|
|
34 |
|
35 |
You can use it via interface api:
|
36 |
```Python
|
37 |
+
import requests
|
38 |
+
import io
|
39 |
+
from PIL import Image
|
40 |
|
41 |
+
API_URL = "https://api-inference.huggingface.co/models/kviai/sdxl-turbo"
|
42 |
+
headers = {"Authorization": "Bearer YOUR_HF_API_TOKEN"}
|
43 |
+
|
44 |
+
def query(payload):
|
45 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
46 |
+
return response.content
|
47 |
+
image_bytes = query({
|
48 |
+
"inputs": "Astronaut riding a horse",
|
49 |
+
})
|
50 |
+
|
51 |
+
image = Image.open(io.BytesIO(image_bytes))
|
52 |
```
|
53 |
Or donwload model from Files and Versions tab
|