mirror of
https://git.datalinker.icu/kijai/ComfyUI-CogVideoXWrapper.git
synced 2025-12-08 20:34:23 +08:00
Allow using precalculated noise
only when denoise is 1.0 for now
This commit is contained in:
parent
8c5e4f812d
commit
3a38d01414
@ -196,7 +196,7 @@ class CogVideoXPipeline(DiffusionPipeline, CogVideoXLoraLoaderMixin):
|
|||||||
noise[:, place_idx:place_idx + delta, :, :, :] = noise[:, list_idx, :, :, :]
|
noise[:, place_idx:place_idx + delta, :, :, :] = noise[:, list_idx, :, :, :]
|
||||||
if latents is None:
|
if latents is None:
|
||||||
latents = noise.to(device)
|
latents = noise.to(device)
|
||||||
else:
|
elif denoise_strength < 1.0:
|
||||||
latents = latents.to(device)
|
latents = latents.to(device)
|
||||||
timesteps, num_inference_steps = self.get_timesteps(num_inference_steps, denoise_strength, device)
|
timesteps, num_inference_steps = self.get_timesteps(num_inference_steps, denoise_strength, device)
|
||||||
latent_timestep = timesteps[:1]
|
latent_timestep = timesteps[:1]
|
||||||
@ -213,6 +213,8 @@ class CogVideoXPipeline(DiffusionPipeline, CogVideoXLoraLoaderMixin):
|
|||||||
latents = latents[:, :frames_needed, :, :, :]
|
latents = latents[:, :frames_needed, :, :, :]
|
||||||
|
|
||||||
latents = self.scheduler.add_noise(latents, noise.to(device), latent_timestep)
|
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
|
latents = latents * self.scheduler.init_noise_sigma # scale the initial noise by the standard deviation required by the scheduler
|
||||||
return latents, timesteps
|
return latents, timesteps
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user