From 245d3f82c3f74ad0614771d17a4fa26ed91f3d6c Mon Sep 17 00:00:00 2001 From: chflame163 Date: Tue, 24 Sep 2024 10:35:05 +0800 Subject: [PATCH] fix bug of scan font files --- py/evf_sam_ultra.py | 7 ++++--- py/imagefunc.py | 4 ++-- py/text_image_v2.py | 1 - pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/py/evf_sam_ultra.py b/py/evf_sam_ultra.py index 49d1f5a..a90adb6 100644 --- a/py/evf_sam_ultra.py +++ b/py/evf_sam_ultra.py @@ -14,7 +14,8 @@ class EVF_SAM_Ultra: @classmethod def INPUT_TYPES(cls): - model_list = ["evf-sam2","evf-sam"] + # model_list = ["evf-sam2","evf-sam", "evf-sam2-multitask", "evf-sam-multitask"] + model_list = ["evf-sam2", "evf-sam"] precision_list = ["fp16", "bf16", "fp32"] load_in_bit_list = ["full", "8", "4"] method_list = ['VITMatte', 'VITMatte(local)', 'PyMatting', 'GuidedFilter', ] @@ -55,9 +56,9 @@ class EVF_SAM_Ultra: else: local_files_only = False - if model == 'evf-sam2': + if model == 'evf-sam2' or model == 'evf-sam2-multitask': model_type = 'sam2' - elif model == 'evf-sam': + elif model == 'evf-sam' or model == 'evf-sam-multitask': model_type = 'ori' else: model_type = 'effi' diff --git a/py/imagefunc.py b/py/imagefunc.py index e71d40a..d59d7b8 100644 --- a/py/imagefunc.py +++ b/py/imagefunc.py @@ -2276,8 +2276,8 @@ def get_resource_dir() -> list: elif line.startswith('FONT_dir='): _fdir = line[line.find('=') + 1:].rstrip().lstrip() for dir in extract_substr_from_str(_fdir): - if os.path.exists(_fdir): - default_font_dir.append(_fdir) + if os.path.exists(dir): + default_font_dir.append(dir) except Exception as e: log(f'Warning: {resource_dir_ini_file} not found' + f", default directory to be used. ") diff --git a/py/text_image_v2.py b/py/text_image_v2.py index 14fe733..ad2ddd0 100644 --- a/py/text_image_v2.py +++ b/py/text_image_v2.py @@ -10,7 +10,6 @@ class TextImage_v2: @classmethod def INPUT_TYPES(self): - (_, FONT_DICT) = get_resource_dir() FONT_LIST = list(FONT_DICT.keys()) diff --git a/pyproject.toml b/pyproject.toml index e12aa03..15d6954 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "comfyui_layerstyle" description = "A set of nodes for ComfyUI it generate image like Adobe Photoshop's Layer Style. the Drop Shadow is first completed node, and follow-up work is in progress." -version = "1.0.64" +version = "1.0.65" license = "MIT" dependencies = ["numpy", "pillow", "torch", "matplotlib", "Scipy", "scikit_image", "scikit_learn", "opencv-contrib-python", "pymatting", "segment_anything", "timm", "addict", "yapf", "colour-science", "wget", "mediapipe", "loguru", "typer_config", "fastapi", "rich", "google-generativeai", "diffusers", "omegaconf", "tqdm", "transformers", "kornia", "image-reward", "ultralytics", "blend_modes", "blind-watermark", "qrcode", "pyzbar", "transparent-background", "huggingface_hub", "accelerate", "bitsandbytes", "torchscale", "wandb", "hydra-core", "psd-tools", "inference-cli[yolo-world]", "inference-gpu[yolo-world]", "onnxruntime"]