1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-29 07:22:12 +03:00

use correct lora scaling for final test pipeline

This commit is contained in:
Aryan
2024-09-09 23:45:47 +02:00
parent b1ca3dbadf
commit f35c36c16d

View File

@@ -1151,7 +1151,6 @@ def main(args):
)
def encode_video(video):
print(video.shape)
video = video.to(accelerator.device, dtype=vae.dtype).unsqueeze(0)
video = video.permute(0, 2, 1, 3, 4) # [B, C, F, H, W]
latent_dist = vae.encode(video).latent_dist
@@ -1475,7 +1474,9 @@ def main(args):
pipe.scheduler = CogVideoXDPMScheduler.from_config(pipe.scheduler.config)
# Load LoRA weights
pipe.load_lora_weights(args.output_dir)
lora_scaling = args.lora_alpha / args.rank
pipe.load_lora_weights(args.output_dir, adapter_name="cogvideox-lora")
pipe.set_adapters(["cogvideox-lora"], [lora_scaling])
# Run inference
validation_outputs = []