Skip to content

Commit 88823b7

Browse files
committed
Allow using custom noise
1 parent ea8ff71 commit 88823b7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hyvideo/diffusion/pipelines/pipeline_hunyuan_video.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def prepare_latents(
288288
noise[:, :, place_idx:place_idx + delta, :, :] = noise[:, :, list_idx, :, :]
289289
if latents is None:
290290
latents = noise
291-
else:
291+
elif denoise_strength < 1.0:
292292
latents = latents.to(device)
293293
timesteps, num_inference_steps = self.get_timesteps(num_inference_steps, denoise_strength, device)
294294
latent_timestep = timesteps[:1]
@@ -302,9 +302,9 @@ def prepare_latents(
302302
self.additional_frames = repeat_factor
303303
elif frames_needed < current_frames:
304304
latents = latents[:, :frames_needed, :, :, :]
305-
print(timesteps)
306-
307305
latents = latents * (1 - latent_timestep / 1000) + latent_timestep / 1000 * noise
306+
else:
307+
latents = latents.to(device)
308308

309309
# Check existence to make it compatible with FlowMatchEulerDiscreteScheduler
310310
if hasattr(self.scheduler, "init_noise_sigma"):

0 commit comments

Comments
 (0)