charliebaby2023 commited on
Commit
2e9080b
Β·
verified Β·
1 Parent(s): 1a0c870

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -85,14 +85,14 @@ def gen_fn(model_str, prompt, negative_prompt):
85
  # Ensure the response is an image or image-like object
86
  if isinstance(image_response, gr.Image):
87
  return image_response
88
- # elif isinstance(image_response, str): # If the response is a path or URL, pass it as a string
89
- # return gr.Image(image_response) # You can handle it based on your model's return type
90
- # else:
91
- # print(f"Unexpected response type: {type(image_response)}")
92
- # return None
93
  except Exception as e:
94
  print(f"Error occurred: {e}")
95
- return e
96
  #None
97
 
98
 
 
85
  # Ensure the response is an image or image-like object
86
  if isinstance(image_response, gr.Image):
87
  return image_response
88
+ elif isinstance(image_response, str): # If the response is a path or URL, pass it as a string
89
+ return gr.Image(image_response) # You can handle it based on your model's return type
90
+ else:
91
+ print(f"Unexpected response type: {type(image_response)}")
92
+ return None
93
  except Exception as e:
94
  print(f"Error occurred: {e}")
95
+ return None
96
  #None
97
 
98