empty list if diffusers directory doesn't exist

This commit is contained in:
sALTaccount 2023-04-06 00:24:52 -07:00
parent c418d988ba
commit 3d16077e38
1 changed files with 5 additions and 2 deletions

View File

@ -223,8 +223,11 @@ class CheckpointLoaderSimple:
class DiffusersLoader:
@classmethod
def INPUT_TYPES(cls):
return {"required": {"model_path": (os.listdir(os.path.join(folder_paths.models_dir, 'diffusers'), ),),
}}
paths = []
search_path = os.path.join(folder_paths.models_dir, 'diffusers')
if os.path.exists(search_path):
paths = next(os.walk(search_path))[1]
return {"required": {"model_path": (paths,), }}
RETURN_TYPES = ("MODEL", "CLIP", "VAE")
FUNCTION = "load_checkpoint"