mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-09-13 13:05:07 +00:00
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:
@@ -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))
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user