Skip to content

Commit

Permalink
Merge pull request #430 from GooeyAI/safety-checker-faceinpainting
Browse files Browse the repository at this point in the history
Add safety checker for face inpainting recipe
  • Loading branch information
nikochiko authored Aug 13, 2024
2 parents cb30353 + fd3ac84 commit 2bc7859
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion recipes/FaceInpainting.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,10 @@ def render_usage_guide(self):
def run(self, state: dict):
if not self.request.user.disable_safety_checker:
yield "Running safety checker..."
safety_checker(image=state["input_image"])
safety_checker(
text=state["text_prompt"],
image=state["input_image"],
)

yield "Extracting Face..."

Expand Down
1 change: 1 addition & 0 deletions recipes/Img2Img.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def run(self, state: dict) -> typing.Iterator[str | None]:
yield "Generating Image..."

if not self.request.user.disable_safety_checker:
yield "Running safety checker..."
safety_checker(text=request.text_prompt, image=request.input_image)

if request.selected_model == Img2ImgModels.instruct_pix2pix.name:
Expand Down

0 comments on commit 2bc7859

Please sign in to comment.