mfranzon commited on
Commit
afb1e96
·
1 Parent(s): a372eb9

fix main, add few writes

Browse files
Files changed (1) hide show
  1. main.py +4 -2
main.py CHANGED
@@ -59,15 +59,17 @@ if st.button('Submit'):
59
  comp_img = Image.new("RGB", img_size)
60
  comp_img = Image.blend(img_draw, img_back, alpha=0.5)
61
  else:
62
- raise "Upload an image or draw something"
63
 
64
  if prompt is None:
65
- raise "No prompt, no magic! :("
66
 
67
  with st.spinner('Wait for it...'):
68
  images = pipe_image(prompt=prompt,
69
  init_image=comp_img,
70
  strength=strength)
71
  st.success("Image is ready!")
 
 
72
  for image in images:
73
  st.image(image)
 
59
  comp_img = Image.new("RGB", img_size)
60
  comp_img = Image.blend(img_draw, img_back, alpha=0.5)
61
  else:
62
+ st.write("Upload an image or draw something")
63
 
64
  if prompt is None:
65
+ st.write("No prompt, no magic! :(")
66
 
67
  with st.spinner('Wait for it...'):
68
  images = pipe_image(prompt=prompt,
69
  init_image=comp_img,
70
  strength=strength)
71
  st.success("Image is ready!")
72
+ if len(images["nsfw_content_detected"]) > 0:
73
+ st.write("NSFW content detected, retry with another prompt or image")
74
  for image in images:
75
  st.image(image)