diff --git a/ai/disable-nsfw-filter.patch b/ai/disable-nsfw-filter.patch index e7420bb..6853110 100644 --- a/ai/disable-nsfw-filter.patch +++ b/ai/disable-nsfw-filter.patch @@ -1,12 +1,12 @@ --- a/facefusion/content_analyser.py +++ b/facefusion/content_analyser.py @@ -194,7 +194,8 @@ def analyse_frame(vision_frame : VisionFrame) -> bool: - is_nsfw_1 = forward(nsfw_1_model, vision_frame) - is_nsfw_2 = forward(nsfw_2_model, vision_frame) - is_nsfw_3 = forward(nsfw_3_model, vision_frame) + is_nsfw_2 = detect_with_nsfw_2(vision_frame) + is_nsfw_3 = detect_with_nsfw_3(vision_frame) + - return is_nsfw_1 and is_nsfw_2 or is_nsfw_1 and is_nsfw_3 or is_nsfw_2 and is_nsfw_3 + # Patched to disable NSFW filter - always return False (content is safe) + return False - def forward(nsfw_model : NsfwModel, vision_frame : VisionFrame) -> bool: + def detect_with_nsfw_1(vision_frame : VisionFrame) -> bool: diff --git a/ai/entrypoint.sh b/ai/entrypoint.sh index 05dc039..5c6a25c 100755 --- a/ai/entrypoint.sh +++ b/ai/entrypoint.sh @@ -1,8 +1,16 @@ #!/bin/sh echo "Patching Facefusion to disable NSFW filter..." -# Patch content_analyser.py to always return False (content is safe) +# Patch content_analyser.py line 197 to always return False (content is safe) sed -i '197s/.*/\treturn False # Patched: NSFW filter disabled/' /facefusion/facefusion/content_analyser.py -echo "NSFW filter disabled. Starting Facefusion..." +# Verify the patch was applied +if grep -q 'return False.*Patched' /facefusion/facefusion/content_analyser.py; then + echo "NSFW filter successfully disabled" +else + echo "ERROR: Patch failed!" + exit 1 +fi + +echo "Starting Facefusion..." exec python -u facefusion.py run