Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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