From 8f0ffa5def47a56155a469103c35700eda54dffc Mon Sep 17 00:00:00 2001 From: David Chatel Date: Sun, 5 Oct 2025 17:26:44 +0200 Subject: [PATCH] fix: improve get_highlow function to handle model file extension and enhance image masking logic --- nodes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index 12a3887..4848e0f 100644 --- a/nodes.py +++ b/nodes.py @@ -281,7 +281,7 @@ class ApplyMask: _, _, h, w = image.shape mask = F.resize(mask, (h, w), InterpolationMode.BICUBIC) image = image.permute(0,2,3,1)[:,:,:,:3] - image *= mask[...,None] + image = image * mask[...,None] return (image, ) class DStack: @@ -864,7 +864,9 @@ def viterbi_diff(a, b): return diff def get_highlow(lorapath, model): - x = glob(os.path.join(lorapath, '**', f'{model[:model.rfind(".")]}.safetensors'), recursive=True)[0] + if not model.endswith('.safetensors'): + model = f'{model}.safetensors' + x = glob(os.path.join(lorapath, '**', model), recursive=True)[0] x = os.path.relpath(x, lorapath) x = os.path.normpath(x) files = [os.path.relpath(f, lorapath) for f in glob(os.path.join(lorapath, os.path.dirname(x), '*.safetensors'))]