Spaces:
Runtime error
Runtime error
fix main, add few writes
Browse files
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 |
-
|
| 63 |
|
| 64 |
if prompt is None:
|
| 65 |
-
|
| 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)
|