Skip to content

Commit

Permalink
Update Zho_Standard__new_EN.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ZHO-ZHO-ZHO authored Sep 10, 2023
1 parent b5df3da commit 14888fd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Zho_Standard__new_EN.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ def load_checkpoint(ckpt_name, output_vae=True, output_clip=True):
return model, clip, vae

#------------------------------------------------------------------------------
def load_lora(lora_name, model, clip, strength_model, strength_clip):
def load_lora(model, clip, lora_name, strength_model, strength_clip):

lora_path = folder_paths.get_full_path("loras", lora_name)
model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora_path, strength_model, strength_clip)

return model, clip
lora = None
if lora is None:
lora = comfy.utils.load_torch_file(lora_path, safe_load=True)
model_lora, clip_lora = comfy.sd.load_lora_for_models(model, clip, lora, strength_model, strength_clip)
return (model_lora, clip_lora)

#------------------------------------------------------------------------------
# 添加一个辅助函数,用于交换宽度和高度
Expand Down Expand Up @@ -100,7 +102,7 @@ def Zho_co_model_loader(self, ckpt_name, clip_skip, vae_name, lora_name, strengt

#Lora模型
if lora_name != "None":
model, clip = load_lora(lora_name, model, clip, strength_model, strength_clip)
model, clip = load_lora(model, clip, lora_name, strength_model, strength_clip)

#Clip跳过层
clip = clip.clone()
Expand Down

0 comments on commit 14888fd

Please sign in to comment.