From 0e2653ad57039583244b971f31fbc7077c17579c Mon Sep 17 00:00:00 2001 From: ljleb Date: Sun, 19 Mar 2023 19:49:44 -0400 Subject: [PATCH] update model tags --- comfy_extras/nodes_upscale_model.py | 3 +-- folder_paths.py | 4 ++-- main.py | 2 +- nodes.py | 10 +++++----- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/comfy_extras/nodes_upscale_model.py b/comfy_extras/nodes_upscale_model.py index b79b78511..16fcaa17c 100644 --- a/comfy_extras/nodes_upscale_model.py +++ b/comfy_extras/nodes_upscale_model.py @@ -1,4 +1,3 @@ -import os from comfy_extras.chainner_models import model_loading from comfy.sd import load_torch_file import model_management @@ -17,7 +16,7 @@ class UpscaleModelLoader: CATEGORY = "loaders" def load_model(self, model_name): - model_path = folder_paths.get_full_path("upscale_models", model_name) + model_path = folder_paths.get_full_path("upscale_model", model_name) sd = load_torch_file(model_path) out = model_loading.load_state_dict(sd).eval() return (out, ) diff --git a/folder_paths.py b/folder_paths.py index 751b28d5c..e08ffd1f7 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -62,7 +62,7 @@ def get_filename_list(model_tag): # default model types -register_model_type('ckpt', supported_ckpt_extensions) +register_model_type('checkpoint', supported_ckpt_extensions) register_model_type('config', ['.yaml']) register_model_type('lora', supported_pt_extensions) register_model_type('vae', supported_pt_extensions) @@ -75,7 +75,7 @@ register_model_type('upscale_model', supported_pt_extensions) # default search paths models_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "models") -add_model_search_path('ckpt', os.path.join(models_dir, "checkpoints")) +add_model_search_path('checkpoint', os.path.join(models_dir, "checkpoints")) add_model_search_path('config', os.path.join(models_dir, "configs")) add_model_search_path('lora', os.path.join(models_dir, "loras")) add_model_search_path('vae', os.path.join(models_dir, "vae")) diff --git a/main.py b/main.py index 4f34fc9db..928c24aef 100644 --- a/main.py +++ b/main.py @@ -16,7 +16,7 @@ if __name__ == "__main__": print("\t--port 8188\t\t\tSet the listen port.") dummy_path = os.path.join('path', 'to', 'dir') - print(f"\t--ckpt-dir {dummy_path}\t\t\tAdd a path to a checkpoint directory.") + print(f"\t--checkpoint-dir {dummy_path}\t\t\tAdd a path to a checkpoint directory.") print(f"\t--config-dir {dummy_path}\t\t\tAdd a path to a model config directory.") print(f"\t--clip-dir {dummy_path}\t\t\tAdd a path to a clip directory.") print(f"\t--clip-vision-dir {dummy_path}\tAdd a path to a clip vision directory.") diff --git a/nodes.py b/nodes.py index 7589a0abb..863025781 100644 --- a/nodes.py +++ b/nodes.py @@ -198,8 +198,8 @@ class CheckpointLoader: CATEGORY = "loaders" def load_checkpoint(self, config_name, ckpt_name, output_vae=True, output_clip=True): - config_path = folder_paths.get_full_path("configs", config_name) - ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name) + config_path = folder_paths.get_full_path("config", config_name) + ckpt_path = folder_paths.get_full_path("checkpoint", ckpt_name) return comfy.sd.load_checkpoint(config_path, ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings")) class CheckpointLoaderSimple: @@ -213,7 +213,7 @@ class CheckpointLoaderSimple: CATEGORY = "loaders" def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True): - ckpt_path = folder_paths.get_full_path("checkpoints", ckpt_name) + ckpt_path = folder_paths.get_full_path("checkpoint", ckpt_name) out = comfy.sd.load_checkpoint_guess_config(ckpt_path, output_vae=True, output_clip=True, embedding_directory=folder_paths.get_folder_paths("embeddings")) return out @@ -248,7 +248,7 @@ class LoraLoader: CATEGORY = "loaders" def load_lora(self, model, clip, lora_name, strength_model, strength_clip): - lora_path = folder_paths.get_full_path("loras", lora_name) + lora_path = folder_paths.get_full_path("lora", lora_name) model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora_path, strength_model, strength_clip) return (model_lora, clip_lora) @@ -381,7 +381,7 @@ class StyleModelLoader: CATEGORY = "loaders" def load_style_model(self, style_model_name): - style_model_path = folder_paths.get_full_path("style_models", style_model_name) + style_model_path = folder_paths.get_full_path("style_model", style_model_name) style_model = comfy.sd.load_style_model(style_model_path) return (style_model,)