Skip to content

Commit

Permalink
added proper noising of init_latent as reccommened by jackloomen (#24…
Browse files Browse the repository at this point in the history
  • Loading branch information
nagolinc committed Aug 24, 2022
1 parent 78101f4 commit 721d55d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/inference/inpainting.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ def __call__(
latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs)["prev_sample"]

#masking
latents=init_latents_orig*mask+latents*(1-mask)
init_latents_proper = self.scheduler.add_noise(init_latents_orig, noise, t)
latents = ( init_latents_proper * mask ) + ( latents * (1-mask) )

# scale and decode the image latents with vae
latents = 1 / 0.18215 * latents
Expand Down

0 comments on commit 721d55d

Please sign in to comment.