Fix merge
Browse files- pipeline_glide.py +6 -2
pipeline_glide.py
CHANGED
@@ -895,13 +895,17 @@ class GLIDE(DiffusionPipeline):
|
|
895 |
noise_residual, pred_variance = torch.split(model_output, 3, dim=1)
|
896 |
|
897 |
# 2. predict previous mean of image x_t-1
|
898 |
-
pred_prev_image = self.upscale_noise_scheduler.step(
|
|
|
|
|
899 |
|
900 |
# 3. optionally sample variance
|
901 |
variance = 0
|
902 |
if eta > 0:
|
903 |
noise = torch.randn(image.shape, generator=generator).to(image.device)
|
904 |
-
variance =
|
|
|
|
|
905 |
|
906 |
# 4. set current image to prev_image: x_t -> x_t-1
|
907 |
image = pred_prev_image + variance
|
|
|
895 |
noise_residual, pred_variance = torch.split(model_output, 3, dim=1)
|
896 |
|
897 |
# 2. predict previous mean of image x_t-1
|
898 |
+
pred_prev_image = self.upscale_noise_scheduler.step(
|
899 |
+
noise_residual, image, t, num_inference_steps_upscale, eta
|
900 |
+
)
|
901 |
|
902 |
# 3. optionally sample variance
|
903 |
variance = 0
|
904 |
if eta > 0:
|
905 |
noise = torch.randn(image.shape, generator=generator).to(image.device)
|
906 |
+
variance = (
|
907 |
+
self.upscale_noise_scheduler.get_variance(t, num_inference_steps_upscale).sqrt() * eta * noise
|
908 |
+
)
|
909 |
|
910 |
# 4. set current image to prev_image: x_t -> x_t-1
|
911 |
image = pred_prev_image + variance
|