w-e-w / sd-webui-nudenet-nsfw-censor

NSFW regions censoring using NudeNet for Stable Diffusion Web UI
GNU Affero General Public License v3.0
79 stars 15 forks source link

[Feature request] NSFW info as API param or image metadata #17

Open czzs opened 6 months ago

czzs commented 6 months ago

Hello @w-e-w,

I know that there is a separate API endpoint, but is there an easy way to receive the NSFW info in an existing (img2img or txt2img) API call?

Right now you will get the censored images, but it would be great to get the info as an API param or maybe inserted as metadata.

Any idea for that?

Thanks in advance

w-e-w commented 6 months ago

so I'm guessing you wish to receive the detective coordinates and the confidence and label type?

I would need to separate out the parsing of the output from the drawing of the mask to currently the way I have implemented basically it's integrated inside

the processing of the output is in this block of code https://github.com/w-e-w/sd-webui-nudenet-nsfw-censor/blob/8162bc8a925f5a6884323a141331148a677396de/scripts/nudenet_nsfw_censor_scripts/pil_nude_detector.py#L133-L213

pribeh commented 3 months ago

Bump. Great library btw