From 557e06e4b393e3fa1d48e91f1fb4bdf7a6bbe049 Mon Sep 17 00:00:00 2001 From: codepiano Date: Wed, 24 May 2023 02:05:26 +0800 Subject: [PATCH] fix all image took as nsfw image problem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nsfw values: "None"、"X"、"Soft"... --- scripts/ch_lib/civitai.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ch_lib/civitai.py b/scripts/ch_lib/civitai.py index 2a15ae7..6721bf8 100644 --- a/scripts/ch_lib/civitai.py +++ b/scripts/ch_lib/civitai.py @@ -342,8 +342,8 @@ def get_preview_image_by_model_path(model_path:str, max_size_preview, skip_nsfw_ if model_info["images"]: for img_dict in model_info["images"]: if "nsfw" in img_dict.keys(): - if img_dict["nsfw"]: - util.printD("This image is NSFW") + if img_dict["nsfw"] != "" and img_dict["nsfw"] != "None": + util.printD("This image is NSFW: " + str(img_dict["nsfw"])) if skip_nsfw_preview: util.printD("Skip NSFW image") continue