Merge pull request #1 from wseagar/ws/nsfw_fix

fix: is_nsfw_img is None rather than false
pull/6/head
Bryce Drennan 2 years ago committed by GitHub
commit 8c064587d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -253,8 +253,7 @@ def imagine(
upscaled_img = None
is_nsfw_img = None
if IMAGINAIRY_SAFETY_MODE != SafetyMode.DISABLED:
if is_nsfw(img, x_sample, half_mode=half_mode):
is_nsfw_img = True
is_nsfw_img = is_nsfw(img, x_sample, half_mode=half_mode)
if is_nsfw_img and IMAGINAIRY_SAFETY_MODE == SafetyMode.FILTER:
logger.info(" ⚠️ Filtering NSFW image")
img = img.filter(ImageFilter.GaussianBlur(radius=40))

Loading…
Cancel
Save