Skip to content

Commit

Permalink
Cleanup some useless lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
comfyanonymous committed Oct 15, 2024
1 parent 95b7cf9 commit f584758
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions comfy/k_diffusion/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,6 @@ def post_cfg_function(args):
d = to_d(x, sigma_hat, temp[0])
if callback is not None:
callback({'x': x, 'i': i, 'sigma': sigmas[i], 'sigma_hat': sigma_hat, 'denoised': denoised})
dt = sigmas[i + 1] - sigma_hat
# Euler method
x = denoised + d * sigmas[i + 1]
return x
Expand All @@ -1107,7 +1106,6 @@ def post_cfg_function(args):
callback({'x': x, 'i': i, 'sigma': sigmas[i], 'sigma_hat': sigmas[i], 'denoised': denoised})
d = to_d(x, sigmas[i], temp[0])
# Euler method
dt = sigma_down - sigmas[i]
x = denoised + d * sigma_down
if sigmas[i + 1] > 0:
x = x + noise_sampler(sigmas[i], sigmas[i + 1]) * s_noise * sigma_up
Expand Down Expand Up @@ -1138,7 +1136,6 @@ def post_cfg_function(args):
if sigma_down == 0:
# Euler method
d = to_d(x, sigmas[i], temp[0])
dt = sigma_down - sigmas[i]
x = denoised + d * sigma_down
else:
# DPM-Solver++(2S)
Expand Down Expand Up @@ -1186,4 +1183,4 @@ def post_cfg_function(args):
denoised_mix = -torch.exp(-h) * uncond_denoised - torch.expm1(-h) * (1 / (2 * r)) * (denoised - old_uncond_denoised)
x = denoised + denoised_mix + torch.exp(-h) * x
old_uncond_denoised = uncond_denoised
return x
return x

0 comments on commit f584758

Please sign in to comment.