classifier free guidance fix

This commit is contained in:
Johannes Stelzer 2024-01-09 14:14:51 +01:00
parent b6b921788c
commit e280494162
1 changed files with 2 additions and 1 deletions

View File

@ -93,12 +93,13 @@ class DiffusersHolder():
self.negative_prompt = [self.negative_prompt[0]] self.negative_prompt = [self.negative_prompt[0]]
def get_text_embedding(self, prompt): def get_text_embedding(self, prompt):
do_classifier_free_guidance = self._guidance_scale > 1 and self.unet.config.time_cond_proj_dim is None
text_embeddings = self.pipe.encode_prompt( text_embeddings = self.pipe.encode_prompt(
prompt=prompt, prompt=prompt,
prompt_2=prompt, prompt_2=prompt,
device=self.pipe._execution_device, device=self.pipe._execution_device,
num_images_per_prompt=1, num_images_per_prompt=1,
do_classifier_free_guidance=self.pipe.do_classifier_free_guidance, do_classifier_free_guidance=do_classifier_free_guidance,
negative_prompt=self.negative_prompt, negative_prompt=self.negative_prompt,
negative_prompt_2=self.negative_prompt, negative_prompt_2=self.negative_prompt,
prompt_embeds=None, prompt_embeds=None,