diff --git a/pipeline_cogvideox.py b/pipeline_cogvideox.py index 235fe2f..e8512cb 100644 --- a/pipeline_cogvideox.py +++ b/pipeline_cogvideox.py @@ -196,7 +196,7 @@ class CogVideoXPipeline(DiffusionPipeline, CogVideoXLoraLoaderMixin): noise[:, place_idx:place_idx + delta, :, :, :] = noise[:, list_idx, :, :, :] if latents is None: latents = noise.to(device) - else: + elif denoise_strength < 1.0: latents = latents.to(device) timesteps, num_inference_steps = self.get_timesteps(num_inference_steps, denoise_strength, device) latent_timestep = timesteps[:1] @@ -213,6 +213,8 @@ class CogVideoXPipeline(DiffusionPipeline, CogVideoXLoraLoaderMixin): latents = latents[:, :frames_needed, :, :, :] latents = self.scheduler.add_noise(latents, noise.to(device), latent_timestep) + else: + latents = latents.to(device) latents = latents * self.scheduler.init_noise_sigma # scale the initial noise by the standard deviation required by the scheduler return latents, timesteps