-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to change the strength of safety_checker #9068
base: main
Are you sure you want to change the base?
Conversation
However, I could not solve the following two problems by myself.
Please let me know if there are other problems. |
Hello, @yiyixuxu |
Hi @suzukimain |
Hi, @yiyixuxu It is intended to be used in classes such as pip install git+https://github.com/suzukimain/diffusers@safety_checker
from diffusers import StableDiffusionPipeline
import torch
pipe = StableDiffusionPipeline.from_pretrained(
"stable-diffusion-v1-5/stable-diffusion-v1-5",
torch_dtype=torch.float16
).to("cuda")
#To see the filter strength.
print(f"Default filter strength: {pipe.filter_level()}") # 0.0
pipe.safety_checker_level("STRONG")
print(f"Filter strength: {pipe.filter_level()}") # 0.5
img=pipe("An image of a squirrel in Picasso style").images[0]
img |
thanks I'm trying to understand whether it would be a common/meaningful use case that people need this feature - |
Currently, the safety checker only allows for enabling or disabling its functionality. |
What does this PR do?
Fixes #9003
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.