Quoc Bao Bui
commited on
Commit
·
322fe05
1
Parent(s):
b1bfbf4
Change inference flag, use byte instead of base64
Browse files- README.md +1 -1
- handler.py +1 -2
README.md
CHANGED
|
@@ -5,7 +5,7 @@ tags:
|
|
| 5 |
- stable-diffusion-diffusers
|
| 6 |
- text-to-image
|
| 7 |
- endpoints-template
|
| 8 |
-
inference:
|
| 9 |
duplicated_from: philschmid/stable-diffusion-v1-4-endpoints
|
| 10 |
---
|
| 11 |
# Fork of [CompVis/stable-diffusion-v1-4](https://huggingface.co/CompVis/stable-diffusion-v1-4)
|
|
|
|
| 5 |
- stable-diffusion-diffusers
|
| 6 |
- text-to-image
|
| 7 |
- endpoints-template
|
| 8 |
+
inference: true
|
| 9 |
duplicated_from: philschmid/stable-diffusion-v1-4-endpoints
|
| 10 |
---
|
| 11 |
# Fork of [CompVis/stable-diffusion-v1-4](https://huggingface.co/CompVis/stable-diffusion-v1-4)
|
handler.py
CHANGED
|
@@ -42,7 +42,6 @@ class EndpointHandler:
|
|
| 42 |
# encode image as base 64
|
| 43 |
buffered = BytesIO()
|
| 44 |
image.save(buffered, format="png")
|
| 45 |
-
img_str = base64.b64encode(buffered.getvalue())
|
| 46 |
|
| 47 |
# post process the prediction
|
| 48 |
-
return {"image":
|
|
|
|
| 42 |
# encode image as base 64
|
| 43 |
buffered = BytesIO()
|
| 44 |
image.save(buffered, format="png")
|
|
|
|
| 45 |
|
| 46 |
# post process the prediction
|
| 47 |
+
return {"image": buffered.getvalue()}
|