mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-31 00:30:21 +08:00
Fix Noise_EmptyNoise when using nested latents (#12089)
This commit is contained in:
parent
29011ba87e
commit
ad53e78f11
@ -701,7 +701,14 @@ class Noise_EmptyNoise:
|
|||||||
|
|
||||||
def generate_noise(self, input_latent):
|
def generate_noise(self, input_latent):
|
||||||
latent_image = input_latent["samples"]
|
latent_image = input_latent["samples"]
|
||||||
return torch.zeros(latent_image.shape, dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
|
if latent_image.is_nested:
|
||||||
|
tensors = latent_image.unbind()
|
||||||
|
zeros = []
|
||||||
|
for t in tensors:
|
||||||
|
zeros.append(torch.zeros(t.shape, dtype=t.dtype, layout=t.layout, device="cpu"))
|
||||||
|
return comfy.nested_tensor.NestedTensor(zeros)
|
||||||
|
else:
|
||||||
|
return torch.zeros(latent_image.shape, dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
|
||||||
|
|
||||||
|
|
||||||
class Noise_RandomNoise:
|
class Noise_RandomNoise:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user