Skip to content

Commit

Permalink
fix: correct sampling when gamma is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
JettHu committed Jun 3, 2024
1 parent 9b8f97c commit 6fd91a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions comfy/k_diffusion/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,5 +841,7 @@ def sample_tcd(
if eta > 0 and sigmas[i + 1] > 0:
noise = noise_sampler(sigmas[i], sigmas[i + 1])
x = x / alpha_prod_s[i+1].sqrt() + noise * (sigmas[i+1]**2 + 1 - 1/alpha_prod_s[i+1]).sqrt()
else:
x *= torch.sqrt(1.0 + sigmas[i + 1] ** 2)

return x

0 comments on commit 6fd91a8

Please sign in to comment.