aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_samplers_timesteps.py
diff options
context:
space:
mode:
authorRobert Barron <rubberbaron@robustspread.com>2023-08-14 07:35:17 +0000
committerRobert Barron <rubberbaron@robustspread.com>2023-08-14 07:35:17 +0000
commitd61e31bae620632c026c927cf6538180447c6918 (patch)
tree0397dcc8e741ed391164fb6b7e8e374a46f0f4ce /modules/sd_samplers_timesteps.py
parent54f926b11d29910df9f813e2e0ea6d35c6f4a50d (diff)
parentf3b96d4998d8ca376d33efa7a4454e8c28e24255 (diff)
downloadstable-diffusion-webui-gfx803-d61e31bae620632c026c927cf6538180447c6918.tar.gz
stable-diffusion-webui-gfx803-d61e31bae620632c026c927cf6538180447c6918.tar.bz2
stable-diffusion-webui-gfx803-d61e31bae620632c026c927cf6538180447c6918.zip
Merge remote-tracking branch 'auto1111/dev' into shared-hires-prompt-test
Diffstat (limited to 'modules/sd_samplers_timesteps.py')
-rw-r--r--modules/sd_samplers_timesteps.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/sd_samplers_timesteps.py b/modules/sd_samplers_timesteps.py
index 16572c7e..c1f534ed 100644
--- a/modules/sd_samplers_timesteps.py
+++ b/modules/sd_samplers_timesteps.py
@@ -49,12 +49,12 @@ class CFGDenoiserTimesteps(CFGDenoiser):
super().__init__(sampler)
self.alphas = shared.sd_model.alphas_cumprod
+ self.mask_before_denoising = True
def get_pred_x0(self, x_in, x_out, sigma):
- ts = int(sigma.item())
+ ts = sigma.to(dtype=int)
- s_in = x_in.new_ones([x_in.shape[0]])
- a_t = self.alphas[ts].item() * s_in
+ a_t = self.alphas[ts][:, None, None, None]
sqrt_one_minus_at = (1 - a_t).sqrt()
pred_x0 = (x_in - sqrt_one_minus_at * x_out) / a_t.sqrt()