diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2024-01-01 11:45:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-01 11:45:12 +0000 |
commit | 267fd5d76b00b0c22edffa83c1a078680ba8b42f (patch) | |
tree | c4092b8ec7430f15aaac7d9f8a0fa2199de28140 /modules/sd_samplers_timesteps.py | |
parent | d613cd17c72c753bd1e314dff74dc22d9a949374 (diff) | |
parent | 5381405eaa1e809e5cfb97522bd4c19d3c946079 (diff) | |
download | stable-diffusion-webui-gfx803-267fd5d76b00b0c22edffa83c1a078680ba8b42f.tar.gz stable-diffusion-webui-gfx803-267fd5d76b00b0c22edffa83c1a078680ba8b42f.tar.bz2 stable-diffusion-webui-gfx803-267fd5d76b00b0c22edffa83c1a078680ba8b42f.zip |
Merge pull request #14145 from drhead/zero-terminal-snr
Implement zero terminal SNR noise schedule option
Diffstat (limited to 'modules/sd_samplers_timesteps.py')
-rw-r--r-- | modules/sd_samplers_timesteps.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/sd_samplers_timesteps.py b/modules/sd_samplers_timesteps.py index f8afa8bd..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)
|