karimbenharrak commited on
Commit
3f9c34e
1 Parent(s): 79bb82a

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +9 -2
handler.py CHANGED
@@ -74,16 +74,23 @@ class EndpointHandler():
74
 
75
  self.pipe3.enable_xformers_memory_efficient_attention()
76
 
77
- image = self.pipe3(
78
  prompt=prompt,
79
  image=image,
80
  guidance_scale=8.0,
81
  num_inference_steps=100,
82
  strength=0.2,
83
  ).images[0]
 
 
 
 
 
 
 
84
 
85
  # return first generate PIL image
86
- return image
87
 
88
  # helper to decode input image
89
  def decode_base64_image(self, image_string):
 
74
 
75
  self.pipe3.enable_xformers_memory_efficient_attention()
76
 
77
+ image2 = self.pipe3(
78
  prompt=prompt,
79
  image=image,
80
  guidance_scale=8.0,
81
  num_inference_steps=100,
82
  strength=0.2,
83
  ).images[0]
84
+
85
+ result = {
86
+ "final_image": image2,
87
+ "pipe1_img": out,
88
+ "pipe1_img_resized": out.images[0].resize((1024, 1024)),
89
+ "pipe2_img": image
90
+ }
91
 
92
  # return first generate PIL image
93
+ return result
94
 
95
  # helper to decode input image
96
  def decode_base64_image(self, image_string):