Update README.md
#2
by
hy6757r
- opened
README.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
| 1 |
-
|
| 2 |
-
license: creativeml-openrail-m
|
| 3 |
-
language:
|
| 4 |
-
- en
|
| 5 |
-
library_name: diffusers
|
| 6 |
-
pipeline_tag: text-to-image
|
| 7 |
-
tags:
|
| 8 |
-
- stable-diffusion
|
| 9 |
-
- stable-diffusion-diffusers
|
| 10 |
-
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
API_URL = "https://api-inference.huggingface.co/models/xiaolxl/Stable-diffusion-models"
|
| 4 |
+
headers = {"Authorization": f"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": "MASTER",
|
| 11 |
+
})
|
| 12 |
+
import io
|
| 13 |
+
from PIL import Image
|
| 14 |
+
image = Image.open(io.BytesIO(image_bytes))
|