Update README.md
Browse files
README.md
CHANGED
@@ -34,6 +34,26 @@ LoRA for the text encoder was enabled: False.
|
|
34 |
|
35 |
Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
## Download model
|
38 |
|
39 |
Weights for this model are available in Safetensors format.
|
|
|
34 |
|
35 |
Special VAE used for training: madebyollin/sdxl-vae-fp16-fix.
|
36 |
|
37 |
+
##### How to use
|
38 |
+
|
39 |
+
```python
|
40 |
+
import requests
|
41 |
+
|
42 |
+
API_URL = "https://api-inference.huggingface.co/models/ZB-Tech/Text-to-Image"
|
43 |
+
headers = {"Authorization": "Bearer HF_API_KEY"}
|
44 |
+
|
45 |
+
def query(payload):
|
46 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
47 |
+
return response.content
|
48 |
+
image_bytes = query({
|
49 |
+
"inputs": "Astronaut riding a horse",
|
50 |
+
})
|
51 |
+
# You can access the image with PIL.Image for example
|
52 |
+
import io
|
53 |
+
from PIL import Image
|
54 |
+
image = Image.open(io.BytesIO(image_bytes))
|
55 |
+
```
|
56 |
+
|
57 |
## Download model
|
58 |
|
59 |
Weights for this model are available in Safetensors format.
|