mirror of
https://github.com/brycedrennan/imaginAIry
synced 2024-11-19 03:25:41 +00:00
Merge pull request #1 from wseagar/ws/nsfw_fix
fix: is_nsfw_img is None rather than false
This commit is contained in:
commit
8c064587d9
@ -253,8 +253,7 @@ def imagine(
|
|||||||
upscaled_img = None
|
upscaled_img = None
|
||||||
is_nsfw_img = None
|
is_nsfw_img = None
|
||||||
if IMAGINAIRY_SAFETY_MODE != SafetyMode.DISABLED:
|
if IMAGINAIRY_SAFETY_MODE != SafetyMode.DISABLED:
|
||||||
if is_nsfw(img, x_sample, half_mode=half_mode):
|
is_nsfw_img = is_nsfw(img, x_sample, half_mode=half_mode)
|
||||||
is_nsfw_img = True
|
|
||||||
if is_nsfw_img and IMAGINAIRY_SAFETY_MODE == SafetyMode.FILTER:
|
if is_nsfw_img and IMAGINAIRY_SAFETY_MODE == SafetyMode.FILTER:
|
||||||
logger.info(" ⚠️ Filtering NSFW image")
|
logger.info(" ⚠️ Filtering NSFW image")
|
||||||
img = img.filter(ImageFilter.GaussianBlur(radius=40))
|
img = img.filter(ImageFilter.GaussianBlur(radius=40))
|
||||||
|
Loading…
Reference in New Issue
Block a user