How to turn off the NSFW filter in Stable Diffusion

When the Stable Diffusion AI image generator creates pictures, it sometimes flags ordinary outputs as Not Safe For Work (NSFW). If you use the software at home on your personal computer you may disable the NSFW filter.

  • Open the scripts/ file in a text editor
  • Add a new first line to the check_safety function to immediately return the original image and an empty string without checking. Leave the rest of the code as is, as it will not be executed.
    def check_safety(x_image):
        return x_image, ' '

Leave a comment

Your email address will not be published. Required fields are marked *