odi commited on
Commit
29f1069
·
1 Parent(s): aa6554b
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -8,9 +8,12 @@ def generate_image(prompt, style_id):
8
  try:
9
  styles = Somnium.Styles()
10
  image = Somnium.Generate(prompt, styles[style_id])
11
- return image
 
 
 
12
  except Exception as e:
13
- raise gr.Error("Process failed or contains NSFW")
14
 
15
  # create interface
16
  iface = gr.Interface(
 
8
  try:
9
  styles = Somnium.Styles()
10
  image = Somnium.Generate(prompt, styles[style_id])
11
+ if image == None:
12
+ raise gr.Error("Process contains NSFW")
13
+ else:
14
+ return image
15
  except Exception as e:
16
+ raise gr.Error("Process failed")
17
 
18
  # create interface
19
  iface = gr.Interface(