add examples and fix bugs

This commit is contained in:
chuxij
2025-05-12 14:13:39 +00:00
parent bdddf1512f
commit 92dc15663b
7 changed files with 231 additions and 4 deletions
+4 -2
View File
@@ -1547,17 +1547,19 @@ class ACEStepPipeline:
return latents
def load_lora(self, lora_name_or_path):
if lora_name_or_path != "none" and self.lora_path == "none":
if lora_name_or_path != self.lora_path and lora_name_or_path != "none":
if not os.path.exists(lora_name_or_path):
lora_download_path = snapshot_download(lora_name_or_path, cache_dir=self.checkpoint_dir)
else:
lora_download_path = lora_name_or_path
if self.lora_path != "none":
self.ace_step_transformer.unload_lora()
self.ace_step_transformer.load_lora_adapter(os.path.join(lora_download_path, "pytorch_lora_weights.safetensors"), adapter_name="zh_rap_lora", with_alpha=True)
logger.info(f"Loading lora weights from: {lora_name_or_path} download path is: {lora_download_path}")
self.lora_path = lora_name_or_path
elif self.lora_path != "none" and lora_name_or_path == "none":
logger.info("No lora weights to load.")
self.ace_step_transformer.unload_lora_weights()
self.ace_step_transformer.unload_lora()
def __call__(
self,