From 3d16077e3806b0817b1d43dc14f61e5dee5495c8 Mon Sep 17 00:00:00 2001 From: sALTaccount Date: Thu, 6 Apr 2023 00:24:52 -0700 Subject: [PATCH] empty list if diffusers directory doesn't exist --- nodes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nodes.py b/nodes.py index 776bc38..1af6288 100644 --- a/nodes.py +++ b/nodes.py @@ -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"