Instructions to use fusing/ddim-celeba-hq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fusing/ddim-celeba-hq with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("fusing/ddim-celeba-hq", dtype="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
45fbffb
1
Parent(s): 6b2f29a
upload with clip
Browse files- 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
|