Skip to content

Commit

Permalink
fix incorrect run step on safety checker
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy committed Aug 21, 2024
1 parent 4c73a9a commit 8f8206b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions daras_ai_v2/safety_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions recipes/Img2Img.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8f8206b

Please sign in to comment.