filenameget

This commit is contained in:
lilly
2023-03-30 13:57:08 +09:00
parent 98ae062bc0
commit f7d40d0b2d
2 changed files with 27 additions and 10 deletions
+13 -4
View File
@@ -1,8 +1,8 @@
import os
import comfy.sd
from nodes import *
import folder_paths
import random
from folder_paths import *
import random
import os
if __name__ == os.path.splitext(os.path.basename(__file__))[0] :
from ConsoleColor import print, console
@@ -35,10 +35,19 @@ class CheckpointLoaderSimpleText:
CATEGORY = "loaders"
def load_checkpoint(self, ckpt_name, output_vae=True, output_clip=True):
ckpt_path =check_name_ckpt(name_split_choice(ckpt_name))
#ckpt_path =check_name_ckpt(name_split_choice(ckpt_name))
print(f"ckpt_name",ckpt_name)
ns=name_split_choice(ckpt_name)
print(f"ns",ns)
ckpt_path =get_full_path("checkpoints",ns)
print(f"ckpt_path",ckpt_path)
if ckpt_path is None:
print(f"{ckpt_name} is none")
return
(name,fullpath)=filenameget(os.path.join(models_dir, "checkpoints")+"/**/"+ckpt_name+"*.safetensors")
if fullpath is None:
print(f"{name} is none")
return
ckpt_path=fullpath
try:
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