hy6757r commited on
Commit
95d44fe
1 Parent(s): f6bb141

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -11
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))