Merge pull request #221 from aigc-apps/fix_merge_lora_multi_gpus

Fix merge_lora in multi gpus
This commit is contained in:
Bubbliiiing
2025-06-06 17:04:49 +08:00
committed by GitHub
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -246,7 +246,7 @@ if cfg_skip_ratio is not None:
generator = torch.Generator(device=device).manual_seed(seed)
if lora_path is not None:
pipeline = merge_lora(pipeline, lora_path, lora_weight)
pipeline = merge_lora(pipeline, lora_path, lora_weight, device=device)
with torch.no_grad():
video_length = int((video_length - 1) // vae.config.temporal_compression_ratio * vae.config.temporal_compression_ratio) + 1 if video_length != 1 else 1
@@ -274,7 +274,7 @@ with torch.no_grad():
).videos
if lora_path is not None:
pipeline = unmerge_lora(pipeline, lora_path, lora_weight)
pipeline = unmerge_lora(pipeline, lora_path, lora_weight, device=device)
def save_results():
if not os.path.exists(save_path):
+2 -2
View File
@@ -253,7 +253,7 @@ if cfg_skip_ratio is not None:
generator = torch.Generator(device=device).manual_seed(seed)
if lora_path is not None:
pipeline = merge_lora(pipeline, lora_path, lora_weight)
pipeline = merge_lora(pipeline, lora_path, lora_weight, device=device)
with torch.no_grad():
video_length = int((video_length - 1) // vae.config.temporal_compression_ratio * vae.config.temporal_compression_ratio) + 1 if video_length != 1 else 1
@@ -293,7 +293,7 @@ with torch.no_grad():
).videos
if lora_path is not None:
pipeline = unmerge_lora(pipeline, lora_path, lora_weight)
pipeline = unmerge_lora(pipeline, lora_path, lora_weight, device=device)
def save_results():
if not os.path.exists(save_path):