Include PLMS in adjust steps as it also can fail in the same way

This commit is contained in:
Martin Cairns 2022-10-30 11:04:27 +00:00
parent de1dc0d279
commit 34c86c12b0

View File

@ -208,7 +208,7 @@ class VanillaStableDiffusionSampler:
def adjust_steps_if_invalid(self, p, num_steps): def adjust_steps_if_invalid(self, p, num_steps):
if self.config.name == 'DDIM' and p.ddim_discretize == 'uniform': if (self.config.name == 'DDIM' and p.ddim_discretize == 'uniform') or (self.config.name == 'PLMS'):
valid_step = 999 / (1000 // num_steps) valid_step = 999 / (1000 // num_steps)
if valid_step == floor(valid_step): if valid_step == floor(valid_step):
return int(valid_step) + 1 return int(valid_step) + 1