Commit ·
cebbecd
1
Parent(s): 335f64a
Update handler.py
Browse files- handler.py +4 -3
handler.py
CHANGED
|
@@ -22,9 +22,10 @@ class EndpointHandler():
|
|
| 22 |
|
| 23 |
images = self.pipe(prompt, image=raw_images, num_inference_steps=25, image_guidance_scale=1).images
|
| 24 |
img=images[0]
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
|
| 29 |
|
| 30 |
|
|
|
|
| 22 |
|
| 23 |
images = self.pipe(prompt, image=raw_images, num_inference_steps=25, image_guidance_scale=1).images
|
| 24 |
img=images[0]
|
| 25 |
+
img.save("./1.png")
|
| 26 |
+
with open('./1.png','rb') as img_file:
|
| 27 |
+
encoded_string = base64.b64encode(img_file.read()).decode('utf-8')
|
| 28 |
+
return {'image':encoded_string}
|
| 29 |
|
| 30 |
|
| 31 |
|