krita-ai-diffusion icon indicating copy to clipboard operation
krita-ai-diffusion copied to clipboard

Activate NSFW filter?

Open The-unknown-Shadowman opened this issue 1 year ago • 5 comments

Hi. I want to use Krita and the AI Diffusion plugin in youthwork with children. Is there a switch, model or lora or anything else to activate NSFW secure filters? Negative prompts dont help. Some curious kids bypass negative prompts.

Thx.

The-unknown-Shadowman avatar Apr 24 '24 18:04 The-unknown-Shadowman

There's nothing implemented at the moment. I doubt any model or lora is safe. I think usually people use

  1. a list of banned words/expressions which are filtered from the prompt
  2. an image classification model which runs on the generated output and determines if it's safe

Ideally both. Depending with choice of classification model you will likely always either have things slip through, or end up with quite a few false positives, but that might be okay.

It's probably not difficult to integrate, but I don't have much time to search for good filter lists or models at the moment. There are some you can try online:

  1. https://huggingface.co/spaces/5m4ck3r/nsfw_image_detection
  2. https://huggingface.co/spaces/aka7774/safetychecker
  3. https://nudenet.notai.tech/

Acly avatar Apr 24 '24 19:04 Acly

Thank you very much for answering this fast. I'll give it a try.

The-unknown-Shadowman avatar Apr 25 '24 07:04 The-unknown-Shadowman

I found this plugin for comfyui but dont know how to implement it: https://github.com/42lux/ComfyUI-safety-checker

The-unknown-Shadowman avatar Apr 25 '24 10:04 The-unknown-Shadowman

some authors make SFW models. you can find them and try. SFW

Drakosha405 avatar Apr 25 '24 12:04 Drakosha405

I found this plugin for comfyui but dont know how to implement it: https://github.com/42lux/ComfyUI-safety-checker

Yea that uses the model from 2. link I posted. There is a node for option 1. too, but not sure which is better.

Acly avatar Apr 25 '24 21:04 Acly

You can setup a negative prompt to disallow certain things

NeoLoger avatar Jun 16 '24 11:06 NeoLoger

Done, release v1.21.0

Uses https://huggingface.co/CompVis/stable-diffusion-safety-checker - the others only worked on the most obvious images. This one seems quite robust especially in "Strict" mode, although at that point it does filter out quite a few innocent images too.

There's always the chance something slips through, especially if you're really trying to get around it.

Acly avatar Jul 25 '24 13:07 Acly