We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29011ba commit ad53e78Copy full SHA for ad53e78
comfy_extras/nodes_custom_sampler.py
@@ -701,7 +701,14 @@ def __init__(self):
701
702
def generate_noise(self, input_latent):
703
latent_image = input_latent["samples"]
704
- return torch.zeros(latent_image.shape, dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
+ if latent_image.is_nested:
705
+ tensors = latent_image.unbind()
706
+ zeros = []
707
+ for t in tensors:
708
+ zeros.append(torch.zeros(t.shape, dtype=t.dtype, layout=t.layout, device="cpu"))
709
+ return comfy.nested_tensor.NestedTensor(zeros)
710
+ else:
711
+ return torch.zeros(latent_image.shape, dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
712
713
714
class Noise_RandomNoise:
0 commit comments