Backstory: I created a discord bot for my friend group's server that amongst other things can take an image and prompt from a specific channel, generate a new image using sd-3.5-large-turbo, and post it back to the same channel. Today, one of my friends shared the image below with the prompt "leg day" and instead of returning a new image, replicate returned an empty list. I tried some other images and prompts which worked, so I looked at my replicate dashboard and it says that it failed because nsfw content was detected in the generated image. Weird, but okay.
Request: Rather than just an empty list, can an exception be raised or something be returned indicating why the prediction failed?
Thanks for the report, the replicate.run() call should raise a ModelError if the prediction fails for NSFW error or otherwise. Let me take a look at the model you've provided and see if there's something off.
Backstory: I created a discord bot for my friend group's server that amongst other things can take an image and prompt from a specific channel, generate a new image using sd-3.5-large-turbo, and post it back to the same channel. Today, one of my friends shared the image below with the prompt "leg day" and instead of returning a new image, replicate returned an empty list. I tried some other images and prompts which worked, so I looked at my replicate dashboard and it says that it failed because nsfw content was detected in the generated image. Weird, but okay.
Request: Rather than just an empty list, can an exception be raised or something be returned indicating why the prediction failed?
Relevant code: