From f03dade5ab8f17a165d63efc205eb34a2330b7d8 Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 17 Apr 2023 18:19:57 -0400 Subject: [PATCH] Fix bug. --- nodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodes.py b/nodes.py index c745ce28..06b69f45 100644 --- a/nodes.py +++ b/nodes.py @@ -708,8 +708,9 @@ def common_ksampler(model, seed, steps, cfg, sampler_name, scheduler, positive, batch_index = latent["batch_index"] generator = torch.manual_seed(seed) - for i in range(batch_index + 1): + for i in range(batch_index): noise = torch.randn([1] + list(latent_image.size())[1:], dtype=latent_image.dtype, layout=latent_image.layout, generator=generator, device="cpu") + noise = torch.randn(latent_image.size(), dtype=latent_image.dtype, layout=latent_image.layout, generator=generator, device="cpu") if "noise_mask" in latent: noise_mask = latent['noise_mask']