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.
When you clone the Stable Diffusion GitHub repository, the txt2img.py file should appear in the scripts directory. If it is not there, clone the repository again from https://github.com/CompVis/stable-diffusion.git
- Open the scripts/txt2img.py 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 function as is, as it will not be executed.
def check_safety(x_image):
return x_image, ' '
safety_checker_input = ...
Total unbrauchbar weil keine txt2img.py gibt!
Hi Gotra,
My “scripts” directory has the txt2img.py file. Please see the screen shot in the updated post. I hope this helps.
txt2img.py is not in the file list on my installation.
C:\Users\username\stable-diffusion-webui\scripts
Any other place to make this change?
Hi Dude,
When you clone the Stable Diffusion GitHub repository, the txt2img.py file should appear in the scripts directory. If it is not there, clone the repository again from https://github.com/CompVis/stable-diffusion.git
Please see the GitHub screen shot in the updated post above.
I hope this helps.