Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -280,7 +280,9 @@ def _generate_video(
|
|
| 280 |
# NSFW 检测
|
| 281 |
if nsfw_model and nsfw_processor:
|
| 282 |
num_total_frames = len(output_frames_list)
|
| 283 |
-
|
|
|
|
|
|
|
| 284 |
msg = "Generated video contains NSFW content and cannot be displayed. Please modify the input image or prompt and try again."
|
| 285 |
raise Exception(msg)
|
| 286 |
|
|
|
|
| 280 |
# NSFW 检测
|
| 281 |
if nsfw_model and nsfw_processor:
|
| 282 |
num_total_frames = len(output_frames_list)
|
| 283 |
+
sample_count = max(1, int(num_total_frames // (FIXED_FPS / 2)))
|
| 284 |
+
|
| 285 |
+
if detect_frames_nsfw(output_frames_list,sample_count,0.6):
|
| 286 |
msg = "Generated video contains NSFW content and cannot be displayed. Please modify the input image or prompt and try again."
|
| 287 |
raise Exception(msg)
|
| 288 |
|