Skip to content

Commit 5b37270

Browse files
Add a lora loader node for models with no CLIP.
1 parent 5d6dfce commit 5b37270

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

nodes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,19 @@ def load_lora(self, model, clip, lora_name, strength_model, strength_clip):
572572
model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, strength_model, strength_clip)
573573
return (model_lora, clip_lora)
574574

575+
class LoraLoaderModelOnly(LoraLoader):
576+
@classmethod
577+
def INPUT_TYPES(s):
578+
return {"required": { "model": ("MODEL",),
579+
"lora_name": (folder_paths.get_filename_list("loras"), ),
580+
"strength_model": ("FLOAT", {"default": 1.0, "min": -20.0, "max": 20.0, "step": 0.01}),
581+
}}
582+
RETURN_TYPES = ("MODEL",)
583+
FUNCTION = "load_lora_model_only"
584+
585+
def load_lora_model_only(self, model, lora_name, strength_model):
586+
return (self.load_lora(model, None, lora_name, strength_model, 0)[0],)
587+
575588
class VAELoader:
576589
@staticmethod
577590
def vae_list():
@@ -1703,6 +1716,7 @@ def expand_image(self, image, left, top, right, bottom, feathering):
17031716

17041717
"ConditioningZeroOut": ConditioningZeroOut,
17051718
"ConditioningSetTimestepRange": ConditioningSetTimestepRange,
1719+
"LoraLoaderModelOnly": LoraLoaderModelOnly,
17061720
}
17071721

17081722
NODE_DISPLAY_NAME_MAPPINGS = {

0 commit comments

Comments
 (0)