aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sd_samplers_timesteps.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2024-01-01 14:01:06 +0000
committerGitHub <noreply@github.com>2024-01-01 14:01:06 +0000
commit7ba02e0b7cfc85d5d237eba71ab4d66564857d55 (patch)
treeb317227a0e63c42aa8c4b06147761dfd37ae24fc /modules/sd_samplers_timesteps.py
parentbe31e7e71a08dc27543d31aa6e6532463ccbf20f (diff)
parent15156cde18844f459ba101b1356d162aa7f39c47 (diff)
downloadstable-diffusion-webui-gfx803-7ba02e0b7cfc85d5d237eba71ab4d66564857d55.tar.gz
stable-diffusion-webui-gfx803-7ba02e0b7cfc85d5d237eba71ab4d66564857d55.tar.bz2
stable-diffusion-webui-gfx803-7ba02e0b7cfc85d5d237eba71ab4d66564857d55.zip
Merge branch 'dev' into finer-settings-freezing-control
Diffstat (limited to 'modules/sd_samplers_timesteps.py')
-rw-r--r--modules/sd_samplers_timesteps.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/sd_samplers_timesteps.py b/modules/sd_samplers_timesteps.py
index b17a8f93..777dd8d0 100644
--- a/modules/sd_samplers_timesteps.py
+++ b/modules/sd_samplers_timesteps.py
@@ -36,7 +36,7 @@ class CompVisTimestepsVDenoiser(torch.nn.Module):
self.inner_model = model
def predict_eps_from_z_and_v(self, x_t, t, v):
- return self.inner_model.sqrt_alphas_cumprod[t.to(torch.int), None, None, None] * v + self.inner_model.sqrt_one_minus_alphas_cumprod[t.to(torch.int), None, None, None] * x_t
+ return torch.sqrt(self.inner_model.alphas_cumprod)[t.to(torch.int), None, None, None] * v + torch.sqrt(1 - self.inner_model.alphas_cumprod)[t.to(torch.int), None, None, None] * x_t
def forward(self, input, timesteps, **kwargs):
model_output = self.inner_model.apply_model(input, timesteps, **kwargs)
@@ -80,6 +80,7 @@ class CompVisSampler(sd_samplers_common.Sampler):
self.eta_default = 0.0
self.model_wrap_cfg = CFGDenoiserTimesteps(self)
+ self.model_wrap = self.model_wrap_cfg.inner_model
def get_timesteps(self, p, steps):
discard_next_to_last_sigma = self.config is not None and self.config.options.get('discard_next_to_last_sigma', False)