Fix duplicate sigmas on beta scheduler.

This commit is contained in:
comfyanonymous 2024-10-21 20:19:45 -04:00
parent 0075c6d096
commit f82314fcfc

View File

@ -358,8 +358,11 @@ def beta_scheduler(model_sampling, steps, alpha=0.6, beta=0.6):
ts = numpy.rint(scipy.stats.beta.ppf(ts, alpha, beta) * total_timesteps) ts = numpy.rint(scipy.stats.beta.ppf(ts, alpha, beta) * total_timesteps)
sigs = [] sigs = []
last_t = -1
for t in ts: for t in ts:
sigs += [float(model_sampling.sigmas[int(t)])] if t != last_t:
sigs += [float(model_sampling.sigmas[int(t)])]
last_t = t
sigs += [0.0] sigs += [0.0]
return torch.FloatTensor(sigs) return torch.FloatTensor(sigs)