db0, 10 months ago You might be able however integrate with my AI Horde endpoint for NSFW checking between nginx and Lemmy. https://aihorde.net/api/v2/interrogate/async This might allow you to detect NSFW images before they are hosted Just send a payload like this <span style="color:#323232;">curl -X 'POST' </span><span style="color:#323232;"> 'https://aihorde.net/api/v2/interrogate/async' </span><span style="color:#323232;"> -H 'accept: application/json' </span><span style="color:#323232;"> -H 'apikey: 0000000000' </span><span style="color:#323232;"> -H 'Client-Agent: unknown:0:unknown' </span><span style="color:#323232;"> -H 'Content-Type: application/json' </span><span style="color:#323232;"> -d '{ </span><span style="color:#323232;"> "forms": [ </span><span style="color:#323232;"> { </span><span style="color:#323232;"> "name": "nsfw" </span><span style="color:#323232;"> } </span><span style="color:#323232;"> ], </span><span style="color:#323232;"> "source_image": "https://lemmy.dbzer0.com/pictrs/image/46c177f0-a7f8-43a3-a67b-7d2e4d696ced.jpeg?format=webp&thumbnail=256" </span><span style="color:#323232;">}' </span> Then retrieve the results asynchronously like this <span style="color:#323232;">{ </span><span style="color:#323232;"> "state": "done", </span><span style="color:#323232;"> "forms": [ </span><span style="color:#323232;"> { </span><span style="color:#323232;"> "form": "nsfw", </span><span style="color:#323232;"> "state": "done", </span><span style="color:#323232;"> "result": { </span><span style="color:#323232;"> "nsfw": false </span><span style="color:#323232;"> } </span><span style="color:#323232;"> } </span><span style="color:#323232;"> ] </span><span style="color:#323232;">} </span> or you could just run the nsfw model locally if you don’t have so many uploads. if you know a way to pre-process uploads before nginx sends them to lemmy, it might be useful
You might be able however integrate with my AI Horde endpoint for NSFW checking between nginx and Lemmy.
https://aihorde.net/api/v2/interrogate/async
This might allow you to detect NSFW images before they are hosted
Just send a payload like this
<span style="color:#323232;">curl -X 'POST' </span><span style="color:#323232;"> 'https://aihorde.net/api/v2/interrogate/async' </span><span style="color:#323232;"> -H 'accept: application/json' </span><span style="color:#323232;"> -H 'apikey: 0000000000' </span><span style="color:#323232;"> -H 'Client-Agent: unknown:0:unknown' </span><span style="color:#323232;"> -H 'Content-Type: application/json' </span><span style="color:#323232;"> -d '{ </span><span style="color:#323232;"> "forms": [ </span><span style="color:#323232;"> { </span><span style="color:#323232;"> "name": "nsfw" </span><span style="color:#323232;"> } </span><span style="color:#323232;"> ], </span><span style="color:#323232;"> "source_image": "https://lemmy.dbzer0.com/pictrs/image/46c177f0-a7f8-43a3-a67b-7d2e4d696ced.jpeg?format=webp&thumbnail=256" </span><span style="color:#323232;">}' </span>
Then retrieve the results asynchronously like this
<span style="color:#323232;">{ </span><span style="color:#323232;"> "state": "done", </span><span style="color:#323232;"> "forms": [ </span><span style="color:#323232;"> { </span><span style="color:#323232;"> "form": "nsfw", </span><span style="color:#323232;"> "state": "done", </span><span style="color:#323232;"> "result": { </span><span style="color:#323232;"> "nsfw": false </span><span style="color:#323232;"> } </span><span style="color:#323232;"> } </span><span style="color:#323232;"> ] </span><span style="color:#323232;">} </span>
or you could just run the nsfw model locally if you don’t have so many uploads.
if you know a way to pre-process uploads before nginx sends them to lemmy, it might be useful