Skip to content

Commit

Permalink
add negative_prompt_embeds to zero_out_negative_prompt check
Browse files Browse the repository at this point in the history
  • Loading branch information
jazcollins committed Oct 3, 2023
1 parent 0a1f31a commit 67e0316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diffusion/models/stable_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def generate(
# negative prompt is given in place of the unconditional input in classifier free guidance
pooled_embeddings = None
if do_classifier_free_guidance:
if not negative_prompt and not tokenized_negative_prompts and zero_out_negative_prompt:
if not negative_prompt and not tokenized_negative_prompts and not negative_prompt_embeds and zero_out_negative_prompt:
# Negative prompt is empty and we want to zero it out
unconditional_embeddings = torch.zeros_like(text_embeddings)
pooled_unconditional_embeddings = torch.zeros_like(pooled_text_embeddings) if self.sdxl else None
Expand Down

0 comments on commit 67e0316

Please sign in to comment.