"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "af28ae2d5ba0ef80d99fff7859ebea730e1cf3f8"
Unverified Commit 5cda8ea5 authored by Muyang Li's avatar Muyang Li Committed by GitHub
Browse files

Use `randn_tensor` to replace `torch.randn` (#10535)

`torch.randn` requires `generator` and `latents` on the same device, while the wrapped function `randn_tensor` does not have this issue.
parent 36acdd75
...@@ -769,7 +769,7 @@ class LTXPipeline(DiffusionPipeline, FromSingleFileMixin, LTXVideoLoraLoaderMixi ...@@ -769,7 +769,7 @@ class LTXPipeline(DiffusionPipeline, FromSingleFileMixin, LTXVideoLoraLoaderMixi
if not self.vae.config.timestep_conditioning: if not self.vae.config.timestep_conditioning:
timestep = None timestep = None
else: else:
noise = torch.randn(latents.shape, generator=generator, device=device, dtype=latents.dtype) noise = randn_tensor(latents.shape, generator=generator, device=device, dtype=latents.dtype)
if not isinstance(decode_timestep, list): if not isinstance(decode_timestep, list):
decode_timestep = [decode_timestep] * batch_size decode_timestep = [decode_timestep] * batch_size
if decode_noise_scale is None: if decode_noise_scale is None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment