From 8f8206b12bc576fe7ba4598895d5304e62d83965 Mon Sep 17 00:00:00 2001 From: Dev Aggarwal Date: Wed, 21 Aug 2024 17:44:22 +0530 Subject: [PATCH] fix incorrect run step on safety checker --- daras_ai_v2/safety_checker.py | 4 ++-- recipes/Img2Img.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/daras_ai_v2/safety_checker.py b/daras_ai_v2/safety_checker.py index d4bc801f1..338d22614 100644 --- a/daras_ai_v2/safety_checker.py +++ b/daras_ai_v2/safety_checker.py @@ -16,8 +16,8 @@ def safety_checker(*, text: str | None = None, image: str | None = None): if text: safety_checker_text(text) - # if image: - # safety_checker_image(image) + if image: + safety_checker_image(image) def safety_checker_text(text_input: str): diff --git a/recipes/Img2Img.py b/recipes/Img2Img.py index 65f208a92..97de89ab7 100644 --- a/recipes/Img2Img.py +++ b/recipes/Img2Img.py @@ -155,12 +155,12 @@ def run(self, state: dict) -> typing.Iterator[str | None]: init_image = request.input_image init_image_bytes = requests.get(init_image).content - 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) + yield "Generating Image..." + if request.selected_model == Img2ImgModels.instruct_pix2pix.name: state["output_images"] = instruct_pix2pix( prompt=request.text_prompt,