@@ -56,6 +56,9 @@ class CFGDenoiser(torch.nn.Module):
self.sampler=sampler
self.model_wrap=None
self.p=None
# NOTE: masking before denoising can cause the original latents to be oversmoothed
# as the original latents do not have noise
self.mask_before_denoising=False
@property
...
...
@@ -105,8 +108,21 @@ class CFGDenoiser(torch.nn.Module):
assertnotis_edit_modelorall(len(conds)==1forcondsinconds_list),"AND is not supported for InstructPix2Pix checkpoint (unless using Image CFG scale = 1.0)"
# If we use masks, blending between the denoised and original latent images occurs here.