stop_at_clip_layer can be set in CLIPSetLastLayer so it can be removed

from the CLIPLoader node.
This commit is contained in:
comfyanonymous 2023-03-03 14:27:55 -05:00
parent ebfcf0a9c9
commit b9e3f52240
1 changed files with 1 additions and 3 deletions

View File

@ -359,17 +359,15 @@ class CLIPLoader:
@classmethod
def INPUT_TYPES(s):
return {"required": { "clip_name": (filter_files_extensions(recursive_search(s.clip_dir), supported_pt_extensions), ),
"stop_at_clip_layer": ("INT", {"default": -1, "min": -24, "max": -1, "step": 1}),
}}
RETURN_TYPES = ("CLIP",)
FUNCTION = "load_clip"
CATEGORY = "loaders"
def load_clip(self, clip_name, stop_at_clip_layer):
def load_clip(self, clip_name):
clip_path = os.path.join(self.clip_dir, clip_name)
clip = comfy.sd.load_clip(ckpt_path=clip_path, embedding_directory=CheckpointLoader.embedding_directory)
clip.clip_layer(stop_at_clip_layer)
return (clip,)
class EmptyLatentImage: