Change default value for clip_type to exception

This commit is contained in:
Max Tretikov 2024-06-14 14:14:00 -06:00
parent 54e6b82d2c
commit 36326226f7

View File

@ -850,9 +850,12 @@ class DualCLIPLoader:
def load_clip(self, clip_name1, clip_name2, type):
clip_path1 = folder_paths.get_full_path("clip", clip_name1)
clip_path2 = folder_paths.get_full_path("clip", clip_name2)
clip_type = sd.CLIPType.STABLE_DIFFUSION
if type == "sd3":
if type == "sdxl":
clip_type = sd.CLIPType.STABLE_DIFFUSION
elif type == "sd3":
clip_type = sd.CLIPType.SD3
else:
raise ValueError(f"Unknown clip type argument passed: {type} for model {clip_name1} and {clip_name2}")
clip = sd.load_clip(ckpt_paths=[clip_path1, clip_path2], embedding_directory=folder_paths.get_folder_paths("embeddings"), clip_type=clip_type)
return (clip,)