pseudotheos commited on
Commit
e52fd17
1 Parent(s): 11d974d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -109,12 +109,6 @@ def convert_to_base64(pil_image):
109
  base64_image = processing_utils.encode_pil_to_base64(pil_image)
110
  return base64_image
111
 
112
- def tensor_to_pil_image(tensor):
113
- # Convert the tensor to a PIL Image
114
- tensor = tensor.squeeze().detach().cpu()
115
- tensor = transforms.ToPILImage()(tensor)
116
- return tensor
117
-
118
  def inference(
119
  control_image: Image.Image,
120
  prompt: str,
@@ -187,8 +181,8 @@ def inference(
187
  print(f"Inference ended at {end_time_formatted}, taking {end_time-start_time}s")
188
  logger.debug("Output Types: generated_image=%s", type(None))
189
  logger.debug("Output Values: generated_image=None")
190
- print(out_image["images"][0].shape)
191
- return tensor_to_pil_image(out_image["images"][0])
192
 
193
 
194
  except Exception as e:
 
109
  base64_image = processing_utils.encode_pil_to_base64(pil_image)
110
  return base64_image
111
 
 
 
 
 
 
 
112
  def inference(
113
  control_image: Image.Image,
114
  prompt: str,
 
181
  print(f"Inference ended at {end_time_formatted}, taking {end_time-start_time}s")
182
  logger.debug("Output Types: generated_image=%s", type(None))
183
  logger.debug("Output Values: generated_image=None")
184
+ print("Type of output image:", type(out_image["images"][0]))
185
+ return out_image["images"][0]
186
 
187
 
188
  except Exception as e: