Skip to content

Conversation

@anotherjesse
Copy link
Contributor

load the CompVis/stable-diffusion-safety-checker and filter SD2.1 results using it

Update diffusers to more recent version

@anotherjesse
Copy link
Contributor Author

image

@anotherjesse
Copy link
Contributor Author

@bfirsh points out that we should probably raise an exception if there are no generated images - similar to how it worked for SD 1.5

        if len(samples) == 0:
            raise Exception(
                f"NSFW content detected. Try running it again, or try a different prompt."
            )

@anotherjesse
Copy link
Contributor Author

Here we can see it throws an exception rather than returning an empty list

image

@anotherjesse
Copy link
Contributor Author

The exception properly shows NSFW detection

image

while the default prompt works:

image

@anotherjesse anotherjesse merged commit 05496d2 into replicate:main Dec 23, 2022
BoatFlyMan pushed a commit to BoatFlyMan/cog-stable-diffusion that referenced this pull request Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant