mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Correct timestep for img2img initial noise addition (#1946)
* Correct timestep for img2img initial noise addition * apply fix to inpaint and txt2img2img as well Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
This commit is contained in:
parent
7a4e647287
commit
2a2f38a016
@ -45,7 +45,7 @@ class Img2Img(Generator):
|
||||
# encode (scaled latent)
|
||||
z_enc = sampler.stochastic_encode(
|
||||
self.init_latent,
|
||||
torch.tensor([t_enc]).to(self.model.device),
|
||||
torch.tensor([t_enc - 1]).to(self.model.device),
|
||||
noise=x_T
|
||||
)
|
||||
|
||||
|
@ -279,7 +279,7 @@ class Inpaint(Img2Img):
|
||||
# encode (scaled latent)
|
||||
z_enc = sampler.stochastic_encode(
|
||||
self.init_latent,
|
||||
torch.tensor([t_enc]).to(self.model.device),
|
||||
torch.tensor([t_enc - 1]).to(self.model.device),
|
||||
noise=x_T
|
||||
)
|
||||
|
||||
|
@ -84,7 +84,7 @@ class Txt2Img2Img(Generator):
|
||||
|
||||
z_enc = ddim_sampler.stochastic_encode(
|
||||
samples,
|
||||
torch.tensor([t_enc]).to(self.model.device),
|
||||
torch.tensor([t_enc-1]).to(self.model.device),
|
||||
noise=self.get_noise(width,height,False)
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user