ShivamShrirao / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch
https://huggingface.co/docs/diffusers
Apache License 2.0
1.88k stars 506 forks source link

Turn safety_checker=None into functioning Boolean #122

Closed Daryl149 closed 1 year ago

Daryl149 commented 1 year ago

Hi there! First of all, awesome repo!! Thanks to you I am able to run it locally on a GPU!

Is your feature request related to a problem? Please describe. In the pipeline step the safety_checker is set to None. But it does not act like a toggle. Looking in the stable diffusion pipelines code, it looks like the filter is completely disabled.

Describe the solution you'd like For a project I am working on in a public space, I would like to be able to enable/disable the switch by setting the parameter in the pipeline to True or False, instead of None.

Describe alternatives you've considered I reversed the nsfw related lines in commits 0c931ada2601f889c8af924452e8c77ae086b271 and 1067ed862d5839f9888bb78672f9bfb1e07e6fac But it does not seem to be able to reactivate the nsfw checker, so I cannot turn it into a Boolean that can be toggled myself right now.

ShivamShrirao commented 1 year ago

Hi, I can't change it to boolean as I plan to keep this fork as close to the main branch. I have completely disabled nsfw checker. To use it you can use the main branch https://github.com/huggingface/diffusers The main branch also has the optimizations as in my fork now.