From 75d62a02d1985d60bc41481f834edc8bcabd0d6c Mon Sep 17 00:00:00 2001 From: Artiprocher Date: Wed, 15 Jan 2025 19:30:38 +0800 Subject: [PATCH] fix rand device --- diffsynth/pipelines/hunyuan_video.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/diffsynth/pipelines/hunyuan_video.py b/diffsynth/pipelines/hunyuan_video.py index 3cf2d8e..6fbbae9 100644 --- a/diffsynth/pipelines/hunyuan_video.py +++ b/diffsynth/pipelines/hunyuan_video.py @@ -89,6 +89,7 @@ class HunyuanVideoPipeline(BasePipeline): input_video=None, denoising_strength=1.0, seed=None, + rand_device=None, height=720, width=1280, num_frames=129, @@ -109,7 +110,8 @@ class HunyuanVideoPipeline(BasePipeline): self.scheduler.set_timesteps(num_inference_steps, denoising_strength) # Initialize noise - noise = self.generate_noise((1, 16, (num_frames - 1) // 4 + 1, height//8, width//8), seed=seed, device=self.device, dtype=self.torch_dtype) + rand_device = self.device if rand_device is None else rand_device + noise = self.generate_noise((1, 16, (num_frames - 1) // 4 + 1, height//8, width//8), seed=seed, device=rand_device, dtype=self.torch_dtype).to(self.device) if input_video is not None: self.load_models_to_device(['vae_encoder']) input_video = self.preprocess_images(input_video)