From a01fdf60cd4c2fd0bc1ef0d220c93aaf77baf337 Mon Sep 17 00:00:00 2001 From: chflame163 Date: Tue, 25 Mar 2025 23:22:14 +0800 Subject: [PATCH] remove filmgrainer save cache file --- py/filmgrainer/filmgrainer.py | 23 ++++++++++++----------- pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/py/filmgrainer/filmgrainer.py b/py/filmgrainer/filmgrainer.py index 1df5108..6709212 100644 --- a/py/filmgrainer/filmgrainer.py +++ b/py/filmgrainer/filmgrainer.py @@ -36,17 +36,18 @@ def _getGrainMask(img_width:int, img_height:int, saturation:float, grayscale:boo str_sat = str(saturation) sat = saturation - filename = MASK_CACHE_PATH + "grain-%d-%d-%s-%s-%s-%d.png" % ( - img_width, img_height, str_sat, str(grain_size), str(grain_gauss), seed) - if os.path.isfile(filename): - # print("Reusing: %s" % filename) - mask = Image.open(filename) - else: - mask = graingen.grainGen(img_width, img_height, grain_size, grain_gauss, sat, seed) - # print("Saving: %s" % filename) - if not os.path.isdir(MASK_CACHE_PATH): - os.mkdir(MASK_CACHE_PATH) - mask.save(filename, format="png", compress_level=1) + # filename = MASK_CACHE_PATH + "grain-%d-%d-%s-%s-%s-%d.png" % ( + # img_width, img_height, str_sat, str(grain_size), str(grain_gauss), seed) + # if os.path.isfile(filename): + # # print("Reusing: %s" % filename) + # mask = Image.open(filename) + # else: + # mask = graingen.grainGen(img_width, img_height, grain_size, grain_gauss, sat, seed) + # # print("Saving: %s" % filename) + # if not os.path.isdir(MASK_CACHE_PATH): + # os.mkdir(MASK_CACHE_PATH) + # mask.save(filename, format="png", compress_level=1) + mask = graingen.grainGen(img_width, img_height, grain_size, grain_gauss, sat, seed) return mask diff --git a/pyproject.toml b/pyproject.toml index 79801b6..b7e42f6 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 = "2.0.16" +version = "2.0.17" license = {text = "MIT License"} dependencies = ["numpy", "pillow", "torch", "matplotlib", "Scipy", "scikit_image", "scikit_learn", "opencv-contrib-python", "pymatting", "timm", "colour-science", "transformers", "blend_modes", "huggingface_hub", "loguru"]