How to Disable NSFW Filter in FaceFusion 3.2.0
Ijash

Ijash @ijash

About: Well, here I am. What are your other two wishes?

Location:
Longitude‎: ‎-97.8220 Latitude‎: ‎37.7510. pick me up
Joined:
Jan 24, 2019

How to Disable NSFW Filter in FaceFusion 3.2.0

Publish Date: Apr 30
58 24

Update:
for FaceFusion 3.3.0, go to this page


FaceFusion 3.2.0 — How to Disable NSFW Filter

So, the old method using PROBABILITY_LIMIT doesn't work anymore in FaceFusion 3.2.0 (based on this update 28-04-2025).

But here's a new way that worked for me — no coding skills needed, just follow these steps:


🚧 Steps:

Open this file:

  • Go into the facefusion folder
  • Then open the file facefusion/content_analyser.py like in this github using notepad or any text editor.
  • In pinokio: pinokio/api/facefusion-pinokio.git/facefusion/facefusion/content_analyser.py. or just click view folder in the files section.

Find this part in the file:

  • Look for the line that starts with:

     def detect_nsfw
    
  • This section is where FaceFusion checks if content is NSFW (Not Safe for Work).

  • You'll see several lines below it that are indented (moved slightly to the right). That's normal.

Find this line:

   keep_indices = numpy.where(nsfw_scores_raw > 0.2)[0]
Enter fullscreen mode Exit fullscreen mode

Change it to:

   keep_indices = numpy.where(nsfw_scores_raw < 0.0)[0]
Enter fullscreen mode Exit fullscreen mode

✅ That’s the only change.

⚠️ Important:

  • Don’t change the spacing in front of the line.
  • Python uses indentation (spaces at the beginning of lines) to group code.
  • If you break the spacing, the app might crash with a "IndentationError".

Save and Restart

  • Save the file after editing.
  • Restart FaceFusion if it's already running.

⚠️ Reminder

This disables the NSFW filter — so be responsible with what you use. (I'll be damned, really? I'm too much of a hypocrite for this..)
This is just from trial and error — no guarantee it'll always work.

❤️ Support Me

If this guide helped you, please consider supporting me.
Even a small tip helps me keep creating helpful tutorials like this.

ko-fi
👉 Buy me a coffee on Ko-fi

Your support means a lot and keeps me motivated to make more beginner-friendly guides. 🙌

Comments 24 total

  • Alves Franclim
    Alves FranclimMay 1, 2025

    muito obrigado, e muito sucesso!!!

    • Ijash
      IjashMay 5, 2025

      Agradeço! E para você também!

  • Jonathan Adlas
    Jonathan AdlasMay 1, 2025

    we need a video tuto, iam to stupid for that, everytime when i change the two to a Zero , the complete text disappears

    • Ijash
      IjashMay 1, 2025

      you use windows?

      • Jonathan Adlas
        Jonathan AdlasMay 2, 2025

        yes windows 11

        • Ijash
          IjashMay 5, 2025

          Sorry, I use linux. even if i did make it, there'll be some visual difference. but the underlying concept is the same. I'll see what I can do, meanwhile, please wait. Because I'm not too keen in video editing.

  • Alpa Patel
    Alpa PatelMay 1, 2025

    not working

    • Ijash
      IjashMay 5, 2025

      give me your code screenshot.

  • Frank
    FrankMay 2, 2025

    It doesn't seem to work, even using 3.2.0.
    Not even trying to do NSFW.
    Just messing around with family photos and videos right now, and even someone on a rollercoaster can't be swapped.

    • Kenny
      KennyMay 2, 2025

      You might not be following his instructions properly. Perhaps you could send him a message and ask for personal guidance. Don't forget to buy him a coffee.

      anyway, thanks @ijash !

      • Frank
        FrankMay 2, 2025

        Don't see how I'm not following the instructions. While I'm not the smartest person in the room, they seem simple enough for someone who was able to install FaceFusion in the first place.
        Perhaps I'm wrong, but here are screenshots. (I purposely blurred the faces in the original photo, but you can see that the whole picture is blurred in the preview. This happens even if I put in a new subject for input)

        Image description

        Image description

        • Nack
          NackMay 2, 2025

          You need to change the ">" to a "<" as well; it looks like you forgot to change it.

          • Frank
            FrankMay 3, 2025

            Fudge...
            I feel SUPER stupid right now.
            Thanks for that, I DID totally miss that and just looked at the numbers.
            Ugh...

  • ahmed abd elazeem
    ahmed abd elazeemMay 10, 2025

    Is there a way to run it on colab without errors? Thx in advance 🙏

    • Ijash
      IjashMay 10, 2025

      have you tried?

  • Obb
    ObbMay 10, 2025

    still have error

    Analysing: 100%|================================================================ | 4524/4537 [00:15<00:00, 283.78frame/s, rate=0]
    Traceback (most recent call last):
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git.env\lib\site-packages\gradio\queueing.py", line 625, in process_events
    response = await route_utils.call_process_api(
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git.env\lib\site-packages\gradio\route_utils.py", line 322, in call_process_api
    output = await app.get_blocks().process_api(
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git.env\lib\site-packages\gradio\blocks.py", line 2146, in process_api
    result = await self.call_function(
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git.env\lib\site-packages\gradio\blocks.py", line 1664, in call_function
    prediction = await anyio.to_thread.run_sync( # type: ignore
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git.env\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git.env\lib\site-packages\anyio_backends_asyncio.py", line 2470, in run_sync_in_worker_thread
    return await future
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git.env\lib\site-packages\anyio_backends_asyncio.py", line 967, in run
    result = context.run(func, *args)
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git.env\lib\site-packages\gradio\utils.py", line 884, in wrapper
    response = f(*args, **kwargs)
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\uis\components\instant_runner.py", line 82, in run
    create_and_run_job(step_args)
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\uis\components\instant_runner.py", line 97, in create_and_run_job
    return job_manager.create_job(job_id) and job_manager.add_step(job_id, step_args) and job_manager.submit_job(job_id) and job_runner.run_job(job_id, process_step)
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\jobs\job_runner.py", line 11, in run_job
    if run_steps(job_id, process_step) and finalize_steps(job_id):
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\jobs\job_runner.py", line 72, in run_steps
    if not run_step(job_id, index, step, process_step):
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\jobs\job_runner.py", line 58, in run_step
    if job_manager.set_step_status(job_id, step_index, 'started') and process_step(job_id, step_index, step_args):
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\core.py", line 323, in process_step
    error_code = conditional_process()
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\core.py", line 340, in conditional_process
    return process_video(start_time)
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\core.py", line 418, in process_video
    if analyse_video(state_manager.get_item('target_path'), trim_frame_start, trim_frame_end):
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\content_analyser.py", line 102, in analyse_video
    if analyse_frame(vision_frame):
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\content_analyser.py", line 77, in analyse_frame

    nsfw_scores = detect_nsfw(vision_frame)
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\content_analyser.py", line 115, in detect_nsfw

    temp_vision_frame = fit_frame(vision_frame, model_size)
    File "D:\AISoftware\pinokio\api\facefusion-pinokio.git\facefusion\facefusion\vision.py", line 243, in fit_frame
    height, width = vision_frame.shape[:2]
    AttributeError: 'NoneType' object has no attribute 'shape'
    Image description

    • Ijash
      IjashMay 10, 2025

      The error occurs before the nsfw detection at temp_vision_frame = fit_frame(vision_frame, model_size). it's not even invoking the keep_indices = numpy.where(nsfw_scores_raw < 0.0)[0] yet.

      It's irrelevant to my topic.
      you can contact the developer. because, AFAIK, in this 3.2.0, they use new method of nsfw detection that I believe raise this error.

      • Enhance NSFW validation using a YOLO powered detector

      full changelogs

      you should report the bug to them.

  • Tom
    TomMay 15, 2025

    Can you just comment out the whole function and return a safe score value? The NSFW analyzing function still runs, which slows the overall process down, why not just avoid it altogether?

    • Ijash
      IjashMay 15, 2025

      i am aware of that. but i'm no python expert, in my best guess, every time this function called, it expect a certain type of value. that's why I don't really avoid it.

      may be it can be substituted with empty array.. maybe..

  • codeFX
    codeFXMay 19, 2025

    Load up the content_analyser.py file as above, search for 'def analyse_frame' and edit the one found on line 70 with the following;

    def analyse_frame(vision_frame : VisionFrame) -> bool:
    return False

    Save and reload FF

  • Zsolt Pinter
    Zsolt PinterMay 23, 2025

    solution:
    def detect_nsfw(vision_frame : VisionFrame) -> List[Score]:
    return [] # Disabled NSFW check

  • Ἑρμῆς Trismégiste
    Ἑρμῆς TrismégisteMay 27, 2025

    keep_indices = numpy.where(nsfw_scores_raw < 0.0)[0] ==>>> No works for me, but....

    keep_indices = numpy.where(nsfw_scores_raw > 0.0)[0]==>>> Works very well , Thanks from France ;)

  • Mojo
    MojoJun 27, 2025

    Instructions given don't work for me. Indentation and < > permuted and combined. Why can't someone just upload a working version of their file? Would've been really helpful.

Add comment