From c1073832cf79b82284485da1bcb2991bfd257cdb Mon Sep 17 00:00:00 2001 From: smthemex <138738845+smthemex@users.noreply.github.com> Date: Thu, 27 Jun 2024 09:48:59 +0800 Subject: [PATCH] Update Storydiffusion_node.py a'd'd --- Storydiffusion_node.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Storydiffusion_node.py b/Storydiffusion_node.py index eadca13..899c84f 100644 --- a/Storydiffusion_node.py +++ b/Storydiffusion_node.py @@ -1060,17 +1060,19 @@ class Storydiffusion_Model_Loader: scheduler_choice = get_scheduler(scheduler) photomaker_dir = os.path.join(dir_path, "weights") - photomaker_local_path = get_instance_path(os.path.join(photomaker_dir, "photomaker-v1.bin")) + photomaker_local_path = os.path.join(photomaker_dir, "photomaker-v1.bin") - if not os.path.exists(photomaker_local_path): - photomaker_path = hf_hub_download( - repo_id="TencentARC/PhotoMaker", - filename="photomaker-v1.bin", - repo_type="model", - local_dir=photomaker_dir, - ) - else: - photomaker_path = photomaker_local_path + if model_type == "img2img": + if not os.path.exists(photomaker_local_path): + photomaker_path = hf_hub_download( + repo_id="TencentARC/PhotoMaker", + filename="photomaker-v1.bin", + repo_type="model", + local_dir=photomaker_dir, + ) + else: + photomaker_path = photomaker_local_path + photomaker_path=get_instance_path(photomaker_path) if lora != "none": lora_path = folder_paths.get_full_path("loras", lora)