Update app.py
Browse files
app.py
CHANGED
@@ -77,12 +77,12 @@ def generate_api():
|
|
77 |
try:
|
78 |
# Check for explicit content
|
79 |
if is_prompt_explicit(prompt):
|
80 |
-
# Return the pre-defined "
|
81 |
return send_file(
|
82 |
-
"
|
83 |
-
mimetype='image/
|
84 |
as_attachment=False,
|
85 |
-
download_name='
|
86 |
)
|
87 |
|
88 |
# Call the generate_image function with the provided parameters
|
|
|
77 |
try:
|
78 |
# Check for explicit content
|
79 |
if is_prompt_explicit(prompt):
|
80 |
+
# Return the pre-defined "NSFW.jpg" image if the content is explicit
|
81 |
return send_file(
|
82 |
+
"NSFW.jpg", # Make sure this file exists in your project directory
|
83 |
+
mimetype='image/jpeg',
|
84 |
as_attachment=False,
|
85 |
+
download_name='NSFW_detected.jpg' # The name for download (optional)
|
86 |
)
|
87 |
|
88 |
# Call the generate_image function with the provided parameters
|