Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

suzukimain
Copy link
Contributor

What does this PR do?

Fixes #9003

"""
About safety_Level.
`int` or `float` or one of the following
'WEAK',
'MEDIUM',
'NOMAL',
'STRONG',
'MAX'.
"""

#To see the filter strength.
pipe.filter_level() # 0.0 (default)

#--------------
#If you want to change the intensity.
pipe.safety_checker_level("STRONG")
pipe.filter_level() # 1.0

#--------------
# If numbers are used
pipe.safety_checker_level(3.0)
pipe.filter_level() # 3.0

Before submitting

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.

@suzukimain
Copy link
Contributor Author

However, I could not solve the following two problems by myself.

  1. regarding the warning message when safety_checker is weakened, the message when safety_checker=None is passed is used as is.
    (I was going to put in a modified message, but I was worried, so I decided it was better not to change it and copied it as is.)

  2. for the number to replace when a string such as 'NOMAL' is entered, I have set the following, but I am not sure if this is the best value.

"WEAK": -1.0
"MEDIUM": -0.5
"NOMAL": 0.0
"STRONG": 0.5
"MAX": 1.0

Please let me know if there are other problems.
thank you

@a-r-r-o-w a-r-r-o-w requested a review from yiyixuxu August 3, 2024 15:55
@suzukimain
Copy link
Contributor Author

Hello, @yiyixuxu
Is there any problem?
I hope to not have caused any inconvenience. thank you for your cooperation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to select the strength of the safety_checker
1 participant