sergeipetrov commited on
Commit
bfbe48c
1 Parent(s): 8c0bc42

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +5 -3
handler.py CHANGED
@@ -24,9 +24,11 @@ class EndpointHandler():
24
  """
25
 
26
 
27
- image_data = data.pop("inputs", data)
28
- parameters = data.pop("parameters", data)
29
- prompt = parameters['prompt']
 
 
30
 
31
  images = self.pipe(prompt, image=image, num_inference_steps=10, image_guidance_scale=1).images
32
  return images[0]
 
24
  """
25
 
26
 
27
+ inputs = data.pop("inputs", data)
28
+
29
+ # decode base64 image to PIL
30
+ image = Image.open(BytesIO(base64.b64decode(inputs['image'])))
31
+ prompt = inputs['prompt']
32
 
33
  images = self.pipe(prompt, image=image, num_inference_steps=10, image_guidance_scale=1).images
34
  return images[0]