Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Fix bug.

comfyanonymousf03dade5ab8f
diff --git a/nodes.py b/nodes.py
index c745ce280..06b69f453 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']