uruguayai commited on
Commit
7a18980
·
verified ·
1 Parent(s): 08d8997

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -26,7 +26,10 @@ def process_image(prompt, image, style, upscale_factor, inpaint):
26
  image = Image.fromarray(image)
27
  elif isinstance(image, torch.Tensor):
28
  image = transforms.ToPILImage()(image)
29
- elif not isinstance(image, Image.Image):
 
 
 
30
  return None, f"Error: Unsupported image format. Received {type(image)}."
31
 
32
  # Log the input parameters
 
26
  image = Image.fromarray(image)
27
  elif isinstance(image, torch.Tensor):
28
  image = transforms.ToPILImage()(image)
29
+ elif isinstance(image, Image.Image):
30
+ # Image is already in the correct format
31
+ pass
32
+ else:
33
  return None, f"Error: Unsupported image format. Received {type(image)}."
34
 
35
  # Log the input parameters