Skip to content

Commit 1df7387

Browse files
authored
Merge pull request #318 from modelscope/hunyuanvideo-seed
fix rand device
2 parents 9db2687 + 75d62a0 commit 1df7387

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

diffsynth/pipelines/hunyuan_video.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def __call__(
8989
input_video=None,
9090
denoising_strength=1.0,
9191
seed=None,
92+
rand_device=None,
9293
height=720,
9394
width=1280,
9495
num_frames=129,
@@ -109,7 +110,8 @@ def __call__(
109110
self.scheduler.set_timesteps(num_inference_steps, denoising_strength)
110111

111112
# Initialize noise
112-
noise = self.generate_noise((1, 16, (num_frames - 1) // 4 + 1, height//8, width//8), seed=seed, device=self.device, dtype=self.torch_dtype)
113+
rand_device = self.device if rand_device is None else rand_device
114+
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)
113115
if input_video is not None:
114116
self.load_models_to_device(['vae_encoder'])
115117
input_video = self.preprocess_images(input_video)

0 commit comments

Comments
 (0)