sergeipetrov commited on
Commit
5581cd6
1 Parent(s): 2a3656e

Update handler.py

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