Update README.md
#1
by
jakobixdeen
- opened
README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
| 1 |
---
|
| 2 |
license: afl-3.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: afl-3.0
|
| 3 |
+
datasets:
|
| 4 |
+
- animelover/genshin-impact-images
|
| 5 |
+
language:
|
| 6 |
+
- de
|
| 7 |
+
metrics:
|
| 8 |
+
- bleurt
|
| 9 |
+
library_name: transformers
|
| 10 |
+
pipeline_tag: text-to-image
|
| 11 |
+
tags:
|
| 12 |
+
- art
|
| 13 |
---
|
| 14 |
+
import requests
|
| 15 |
+
|
| 16 |
+
API_URL = "https://api-inference.huggingface.co/models/runwayml/stable-diffusion-v1-5"
|
| 17 |
+
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
| 18 |
+
|
| 19 |
+
def query(payload):
|
| 20 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 21 |
+
return response.content
|
| 22 |
+
image_bytes = query({
|
| 23 |
+
"inputs": "Astronaut riding a horse",
|
| 24 |
+
})
|
| 25 |
+
# You can access the image with PIL.Image for example
|
| 26 |
+
import io
|
| 27 |
+
from PIL import Image
|
| 28 |
+
image = Image.open(io.BytesIO(image_bytes))
|