patrickvonplaten commited on
Commit
45fbffb
1 Parent(s): 6b2f29a

upload with clip

Browse files
Files changed (1) hide show
  1. modeling_ddim.py +1 -0
modeling_ddim.py CHANGED
@@ -59,6 +59,7 @@ class DDIM(DiffusionPipeline):
59
 
60
  # predict mean of prev image
61
  pred_mean = alpha_prod_t_rsqrt * (image - beta_prod_t_sqrt * noise_residual)
 
62
  pred_mean = (1 / alpha_prod_t_prev_rsqrt) * pred_mean + coeff_2 * noise_residual
63
 
64
  # if eta > 0.0 add noise. Note eta = 1.0 essentially corresponds to DDPM
 
59
 
60
  # predict mean of prev image
61
  pred_mean = alpha_prod_t_rsqrt * (image - beta_prod_t_sqrt * noise_residual)
62
+ pred_mean = torch.clamp(pred_mean, -1, 1)
63
  pred_mean = (1 / alpha_prod_t_prev_rsqrt) * pred_mean + coeff_2 * noise_residual
64
 
65
  # if eta > 0.0 add noise. Note eta = 1.0 essentially corresponds to DDPM