Add: advanced->model->ModelSamplingDiscrete node.

This allows changing the sampling parameters of the model (eps or vpred)
or set the model to use zsnr.
This commit is contained in:
comfyanonymous
2023-11-07 03:28:53 -05:00
parent d07cd44272
commit 844dbf97a7
4 changed files with 77 additions and 0 deletions

View File

@@ -48,7 +48,9 @@ class ModelSamplingDiscrete(torch.nn.Module):
# self.register_buffer('alphas_cumprod_prev', torch.tensor(alphas_cumprod_prev, dtype=torch.float32))
sigmas = ((1 - alphas_cumprod) / alphas_cumprod) ** 0.5
self.set_sigmas(sigmas)
def set_sigmas(self, sigmas):
self.register_buffer('sigmas', sigmas)
self.register_buffer('log_sigmas', sigmas.log())