Skip to content

Conversation

lstein
Copy link
Collaborator

@lstein lstein commented Mar 10, 2023

Several issues noted that NSFW images were coming out black even when --no-nsfw specified

Cause of the problem was inadvertent activation of the safety checker.

When conversion occurs on disk, the safety checker is disabled during loading. However, when converting in RAM, the safety checker was not removed, resulting in it activating even when user specified --no-nsfw_checker.

This PR fixes the problem by detecting when the caller has requested the InvokeAi StableDiffusionGeneratorPipeline class to be returned and setting safety checker to None. Do not do this with diffusers models destined for disk because then they will be incompatible with the merge script!!

Closes #2836

…n RAM

Cause of the problem was inadvertent activation of the safety checker.

When conversion occurs on disk, the safety checker is disabled during loading.
However, when converting in RAM, the safety checker was not removed, resulting
in it activating even when user specified --no-nsfw_checker.

This PR fixes the problem by detecting when the caller has requested the InvokeAi
StableDiffusionGeneratorPipeline class to be returned and setting safety checker
to None. Do not do this with diffusers models destined for disk because then they
will be incompatible with the merge script!!

Closes #2836
Copy link
Contributor

@damian0815 damian0815 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@damian0815 damian0815 enabled auto-merge (squash) March 10, 2023 17:46
@damian0815 damian0815 merged commit 685df33 into main Mar 10, 2023
@damian0815 damian0815 deleted the bugfix/black-images-ckpt-convert branch March 10, 2023 18:11
ElrikUnderlake pushed a commit to ElrikUnderlake/InvokeAI that referenced this pull request Mar 12, 2023
…n RAM (invoke-ai#2914)

Cause of the problem was inadvertent activation of the safety checker.

When conversion occurs on disk, the safety checker is disabled during loading.
However, when converting in RAM, the safety checker was not removed, resulting
in it activating even when user specified --no-nsfw_checker.

This PR fixes the problem by detecting when the caller has requested the InvokeAi
StableDiffusionGeneratorPipeline class to be returned and setting safety checker
to None. Do not do this with diffusers models destined for disk because then they
will be incompatible with the merge script!!

Closes invoke-ai#2836
ElrikUnderlake pushed a commit to ElrikUnderlake/InvokeAI that referenced this pull request Mar 13, 2023
…n RAM (invoke-ai#2914)

Cause of the problem was inadvertent activation of the safety checker.

When conversion occurs on disk, the safety checker is disabled during loading.
However, when converting in RAM, the safety checker was not removed, resulting
in it activating even when user specified --no-nsfw_checker.

This PR fixes the problem by detecting when the caller has requested the InvokeAi
StableDiffusionGeneratorPipeline class to be returned and setting safety checker
to None. Do not do this with diffusers models destined for disk because then they
will be incompatible with the merge script!!

Closes invoke-ai#2836
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.

[bug]: black images with--ckpt-convert in init when generating NSFW images

3 participants