From 51a8b1b8d81ba9cf4af83b8a5103c152b73e4541 Mon Sep 17 00:00:00 2001 From: Bryce Date: Wed, 14 Sep 2022 20:01:12 -0700 Subject: [PATCH] fix: filter logic was wrong --- imaginairy/api.py | 2 +- setup.py | 2 +- tox.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/imaginairy/api.py b/imaginairy/api.py index 6e6e83e..81e4859 100755 --- a/imaginairy/api.py +++ b/imaginairy/api.py @@ -255,7 +255,7 @@ def imagine( if IMAGINAIRY_SAFETY_MODE != SafetyMode.DISABLED: if is_nsfw(img, x_sample, half_mode=half_mode): is_nsfw_img = True - if IMAGINAIRY_SAFETY_MODE == SafetyMode.FILTER: + if is_nsfw_img and IMAGINAIRY_SAFETY_MODE == SafetyMode.FILTER: logger.info(" ⚠️ Filtering NSFW image") img = img.filter(ImageFilter.GaussianBlur(radius=40)) diff --git a/setup.py b/setup.py index 4cdd174..231385c 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ setup( name="imaginAIry", author="Bryce Drennan", # author_email="b r y p y d o t io", - version="1.1.1", + version="1.1.2", description="AI imagined images. Pythonic generation of stable diffusion images.", long_description=readme, long_description_content_type="text/markdown", diff --git a/tox.ini b/tox.ini index 22b8e95..a7338b9 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ filterwarnings = [pylama] format = pylint -skip = */.tox/*,*/.env/*,build/*,*/downloads/*,other/*,prolly_delete/* +skip = */.tox/*,*/.env/*,build/*,*/downloads/*,other/*,prolly_delete/*,downloads/* linters = pylint,pycodestyle,pydocstyle,pyflakes,mypy ignore = Z999,C0103,C0301,C0114,C0115,C0116,