From 95099a443e0d8208bb952385b979e05f3ec5922d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Thu, 13 Nov 2025 06:05:42 +0100 Subject: [PATCH] feat: build custom Facefusion image with NSFW filter patch baked in --- ai/Dockerfile | 8 ++++++++ ai/compose.yaml | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 ai/Dockerfile diff --git a/ai/Dockerfile b/ai/Dockerfile new file mode 100644 index 0000000..de21d0c --- /dev/null +++ b/ai/Dockerfile @@ -0,0 +1,8 @@ +FROM facefusion/facefusion:3.5.0-cpu + +# Patch content_analyser.py to disable NSFW filter +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 +RUN echo "NSFW filter patch successfully applied to image" diff --git a/ai/compose.yaml b/ai/compose.yaml index 959fd82..48802cb 100644 --- a/ai/compose.yaml +++ b/ai/compose.yaml @@ -158,7 +158,10 @@ services: # Facefusion - AI face swapping and enhancement facefusion: - image: ${AI_FACEFUSION_IMAGE:-facefusion/facefusion:3.5.0-cpu} + build: + context: . + dockerfile: Dockerfile + image: facefusion-patched:3.5.0-cpu container_name: ${AI_COMPOSE_PROJECT_NAME}_facefusion restart: unless-stopped command: ['python', '-u', 'facefusion.py', 'run']