stable-diffusion-webui-nsfw-censor icon indicating copy to clipboard operation
stable-diffusion-webui-nsfw-censor copied to clipboard

Is it possible to integrate with A1111? As a built-in feature rather than extension

Open VictorZakharov opened this issue 2 years ago • 11 comments

I'm investigating this issue: https://github.com/Kilvoctu/aiyabot/issues/103

In short, a bot using A1111 API can bypass nsfw extension and generate nsfw images as normal. It appears that extensions only apply when image is generated from A1111 web UI, but not when called via API.

So if nsfw checker was built-in, it would help with this issue I'm having.

VictorZakharov avatar Feb 13 '23 00:02 VictorZakharov

Did you find a solution to the problem? I can’t filter the nsfw image when I call the api

Elziy avatar Feb 26 '23 04:02 Elziy

@Elziy To the API in general, or to the bot in question?

VictorZakharov avatar Feb 26 '23 12:02 VictorZakharov

@Elziy一般是 API,还是有问题的机器人? I just called the api of webui, the principle should be the same as that of a robot, and the shielding of nsfw does not take effect. After reading other Issues, it seems that the api does not support plug-ins. I don’t know how to solve it now.

Elziy avatar Feb 26 '23 12:02 Elziy

@Elziy There are two options.

  1. Convince A1111 devs to implement it as part of API - this ticket, or make another.
  2. Use an additional layer on top of A1111 API, such as aiyabot. Depending on your intent, this might not be applicable.

VictorZakharov avatar Feb 26 '23 12:02 VictorZakharov

FWIW, this is a feature I am also interested in and will likely become more important over time with all the models coming out and the growing list of potential usecases that involve avoiding NSFW generations. I am not familiar enough with the A1111 codebase to be able to contribute to this integration but I agree that applying the filter on API calls when the extension is installed would be great.

I hope this gets traction! Thanks for raising this!

im-kent avatar Feb 28 '23 07:02 im-kent

i'm develop in API wrapper of UE5 plugin, so i need that feature too!!

cyy1133 avatar Mar 04 '23 15:03 cyy1133

Hi guys, I made this a selectable script. You can try it: https://github.com/IOMisaka/sdapi-scripts

IOMisaka avatar Mar 15 '23 08:03 IOMisaka

Hi guys, I made this a selectable script. You can try it: https://github.com/IOMisaka/sdapi-scripts

Changing this into script make it impossible to use when you need to run xy plot. Although mosaic instead of black image is cool idea.

Kepler-16b avatar Apr 21 '23 10:04 Kepler-16b

@IOMisaka How does it help if I'm not using web ui?

VictorZakharov avatar Apr 21 '23 10:04 VictorZakharov

@Kepler-16b Modifying the webui procedure may be the best solution, but it looks not that easy.

@VictorZakharov A standalone censor tool could be an alternative and more flexible.

IOMisaka avatar Apr 26 '23 05:04 IOMisaka

你找到解决问题的方法了吗?调用 api 时无法过滤 nsfw 图像 'filter_nsfw' = true in you code

huangzhitian avatar Jul 03 '23 07:07 huangzhitian