update model tags

This commit is contained in:
ljleb 2023-03-19 19:49:44 -04:00
parent e7ae514422
commit 0e2653ad57
4 changed files with 9 additions and 10 deletions

View File

@ -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, )

View File

@ -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"))

View File

@ -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.")

View File

@ -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,)