Skip to content

Commit

Permalink
safety guidance in sld
Browse files Browse the repository at this point in the history
  • Loading branch information
joycenerd committed Nov 26, 2024
1 parent f625627 commit 9615e7d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion model/p4dk/modified_sld_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def _expand_safe_text_embeddings(self, text_embeddings, num_images_per_prompt):
return text_embeddings


def _new_encode_prompt(self, prompt, num_images_per_prompt, do_classifier_free_guidance, negative_prompt, enable_safety_guidance, prompt_ids=None, prompt_embeddings=None):
def _new_encode_prompt(self, prompt, num_images_per_prompt, do_classifier_free_guidance, negative_prompt, enable_safety_guidance=True, prompt_ids=None, prompt_embeddings=None):
r"""
Encodes the prompt into text encoder hidden states.
Args:
Expand Down
2 changes: 1 addition & 1 deletion model/p4dn/modified_sld_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _expand_safe_text_embeddings(self, text_embeddings, num_images_per_prompt):
return text_embeddings


def _new_encode_prompt(self, prompt, num_images_per_prompt, do_classifier_free_guidance, negative_prompt, enable_safety_guidance, prompt_ids=None, prompt_embeddings=None):
def _new_encode_prompt(self, prompt, num_images_per_prompt, do_classifier_free_guidance, negative_prompt, enable_safety_guidance=True, prompt_ids=None, prompt_embeddings=None):
r"""
Encodes the prompt into text encoder hidden states.
Args:
Expand Down

0 comments on commit 9615e7d

Please sign in to comment.