-
Notifications
You must be signed in to change notification settings - Fork 2.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
feat: nsfw/watermark updates #6260
Conversation
@psychedelicious If you like I'd be happy to work on this after getting the model manager API updates in. Both the NSFW and watermarking features do have real use cases, even if they aren't used all that frequently. |
@lstein Sure thing. After thinking about it more, I'm leaning towards:
If that makes sense, there would only be some minor changes needed for this PR. |
This sounds reasonable. I'll see if I can get this working later this week. |
Note: The NSFW checker model fails when the image isn't RGB.
dde058c
to
60d16fd
Compare
After thinking through things, this approach isn't viable. We need NSFW and watermark to be user-configurable via the UI, it cannot be something that is set in the config file. This is superseded by #6360. |
Summary
Currently, NSFW checking doesn't work on new installs due to a catch-22. See #6252.
I had an idea to move NSFW and watermark to be config settings, then do the check/watermark in the invocation API as images are saved. The NSFW check and watermarking are thus fully automatic and transparent, and works on workflows too - without any user changes. This was really easy to implement.
It works well, but there is a problem on canvas where a graph does many image-saving operations.
For example, an inpaint graph does at least 6x image saves: 4x resize, 1x VAE decode and 1x paste-back. Each time, the image is checked - possibly blurred - and watermarked.
Watermark changes the image
Watermarking subtly changes the images each time an image is saved and this introduces some chaos which impact how the model handles the images. The final output is markedly different than what you would have gotten without any watermarking.
NSFW detection early borks the rest of generation
If an early image in the "chain" is NSFW, it still gets passed along. There are two possible outcomes:
Other ideas
Ok, so this isn't viable. Some other ideas:
NSFWImageError
on NSFW detection - IMO, this is how it should work anyways. The user would get a toast with the error.Related Issues / Discussions
Closes #6252
Closes #6092
QA Instructions
n/a for now
Merge Plan
n/a
Checklist