From 0b43299ffdf63881ce886e9573dc3e7666523d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Thu, 13 Nov 2025 06:16:14 +0100 Subject: [PATCH] fix: update content_analyser hash check in core.py for patched version --- ai/Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ai/Dockerfile b/ai/Dockerfile index de21d0c..d48b090 100644 --- a/ai/Dockerfile +++ b/ai/Dockerfile @@ -4,5 +4,13 @@ FROM facefusion/facefusion:3.5.0-cpu RUN sed -i '197s/.*/\treturn False # Patched: NSFW filter disabled/' /facefusion/facefusion/content_analyser.py && \ grep -q 'return False.*Patched' /facefusion/facefusion/content_analyser.py || (echo "ERROR: Patch failed!" && exit 1) -# Verify patch was applied +# Calculate new hash for patched content_analyser +RUN python3 -c "import inspect; import sys; sys.path.insert(0, '/facefusion'); from facefusion import content_analyser; from facefusion.hash_helper import create_hash; content = inspect.getsource(content_analyser).encode(); print('New hash:', create_hash(content))" + +# Update hash check in core.py to accept patched version +RUN NEW_HASH=$(python3 -c "import inspect; import sys; sys.path.insert(0, '/facefusion'); from facefusion import content_analyser; from facefusion.hash_helper import create_hash; content = inspect.getsource(content_analyser).encode(); print(create_hash(content))") && \ + sed -i "s/content_analyser_hash == 'b14e7b92'/content_analyser_hash == '$NEW_HASH'/" /facefusion/facefusion/core.py && \ + echo "Updated hash check in core.py to: $NEW_HASH" + +# Verify both patches were applied RUN echo "NSFW filter patch successfully applied to image"