Hacker News new | ask | show | jobs
by gpm 1376 days ago
"Stable Diffusion" is referring to one specific set of models, which were trained on a dataset including some porn.

The official implementation has a second model that detects pornography, and replaces outputs including it with a picture of this dude https://www.youtube.com/watch?v=dQw4w9WgXcQ (Not kidding). Removing that is a really simple a one line change in the official script.

2 comments

> Not kidding

I was amused by this when reading the source. Here’s the function that loads the replacement.

https://github.com/CompVis/stable-diffusion/blob/69ae4b35e0a...

It looks like removing line 309 of the same file would disable the check, but I haven’t tried it.

This is the line to change to disable the nsfw filter: https://github.com/CompVis/stable-diffusion/blob/69ae4b35e0a...
I dont see this line in V2.1
I guess the question is whether this toggle is available in the GUI, or if someone has to edit source code
For the CLI version, there was no UI, you have to open the python file and stub out the NSFW check. (trivial though)