diff --git a/gpl3/__init__.py b/gpl3/__init__.py index 31e903c..9074f11 100644 --- a/gpl3/__init__.py +++ b/gpl3/__init__.py @@ -89,12 +89,18 @@ class DarkLoraTagLoader: lora = comfy.utils.load_torch_file(lora_path, safe_load=True) self.loaded_lora = (lora_path, lora) - strength_model = float(wModel) - strength_clip = float(wClip) - model_lora, clip_lora = comfy.sd.load_lora_for_models( - model_lora, clip_lora, lora, strength_model, strength_clip - ) - lora_stack.extend([(lora_name, strength_model, strength_clip)]) + try: + strength_model = float(wModel) + strength_clip = float(wClip) + model_lora, clip_lora = comfy.sd.load_lora_for_models( + model_lora, clip_lora, lora, strength_model, strength_clip + ) + lora_stack.extend([(lora_name, strength_model, strength_clip)]) + except ValueError: + print( + "Unable to load LoRA %s due to invalid floats: %s and %s" + % (lora_name, wModel, wClip) + ) plain_prompt = re.sub(self.tag_pattern, "", text) return (