Invert the start and end percentages in the code.

This doesn't affect how percentages behave in the frontend but breaks
things if you relied on them in the backend.

percent_to_sigma goes from 0 to 1.0 instead of 1.0 to 0 for less confusion.

Make percent 0 return an extremely large sigma and percent 1.0 return a
zero one to fix imprecision.
This commit is contained in:
comfyanonymous
2023-11-16 04:07:35 -05:00
parent 7114cfec0e
commit dcec1047e6
5 changed files with 17 additions and 5 deletions

View File

@@ -66,6 +66,11 @@ class ModelSamplingDiscreteLCM(torch.nn.Module):
return log_sigma.exp()
def percent_to_sigma(self, percent):
if percent <= 0.0:
return torch.tensor(999999999.9)
if percent >= 1.0:
return torch.tensor(0.0)
percent = 1.0 - percent
return self.sigma(torch.tensor(percent * 999.0))