Skip to content

Commit

Permalink
fix: correct sampling when gamma is 0 (lllyasviel#3093)
Browse files Browse the repository at this point in the history
  • Loading branch information
mashb1t authored and csokun committed Jun 16, 2024
1 parent 4b3aff0 commit 318d3d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ldm_patched/k_diffusion/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,5 +832,7 @@ def sample_tcd(model, x, sigmas, extra_args=None, callback=None, disable=None, n
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 318d3d0

Please sign in to comment.