From f2140e3cd00fa9965a5cfd7ffdb904f31efbe2c4 Mon Sep 17 00:00:00 2001 From: Yolan Date: Sun, 24 Dec 2023 20:37:33 -0800 Subject: [PATCH] Fix empty lora --- __init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index c80ce31..2c6bc3e 100644 --- a/__init__.py +++ b/__init__.py @@ -124,8 +124,11 @@ class DTLorasLoader: # split each lora by colons. 0: name, 1: strength_model (optional=1), 2: strength_clip (optional=1) lora_request = l.split(":") lora_name = lora_request[0] + if len(lora_name) == 0: + continue + # if the name doesn't have an extension add .safetensors - if not lora_name.endswith(".safetensors"): + if not lora_name.endswith(".safetensors") and len(lora_name) > 0: lora_name += ".safetensors" strength_model = float(lora_request[1]) if len(lora_request) > 1 else 1.0 strength_clip = float(lora_request[2]) if len(lora_request) > 2 else 1.0