From 59ba9fc0f6c8582d80baa7ba1f913893ae0775d3 Mon Sep 17 00:00:00 2001 From: Sergey Borisov Date: Sun, 13 Aug 2023 19:50:16 +0300 Subject: [PATCH] Flip bits in seed for sde/ancestral schedulers to have different noise from initial --- invokeai/app/invocations/latent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/invokeai/app/invocations/latent.py b/invokeai/app/invocations/latent.py index de9d8b37c8..7451213860 100644 --- a/invokeai/app/invocations/latent.py +++ b/invokeai/app/invocations/latent.py @@ -205,7 +205,8 @@ class DenoiseLatentsInvocation(BaseInvocation): # for ddim scheduler eta=0.0, # ddim_eta # for ancestral and sde schedulers - generator=torch.Generator(device=unet.device).manual_seed(seed), + # flip all bits to have noise different from initial + generator=torch.Generator(device=unet.device).manual_seed(seed ^ 0xFFFFFFFF), ) return conditioning_data