Zhibinhong commited on
Commit
cebbecd
1 Parent(s): 335f64a

Update handler.py

Browse files
Files changed (1) hide show
  1. 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
- img_data=img.tobytes()
26
- img_base64=base64.b64encode(img_data).decode('utf-8')
27
- return {'image':img_base64}
 
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