MCPcopy Create free account
hub / github.com/Extraltodeus/DistanceSampler / get_ancestral_step_ext

Function get_ancestral_step_ext

custom_samplers.py:75–86  ·  view source on GitHub ↗
(sigma, sigma_next, eta=1.0, is_rf=False)

Source from the content-addressed store, hash-verified

73 return a
74
75def get_ancestral_step_ext(sigma, sigma_next, eta=1.0, is_rf=False):
76 if sigma_next == 0 or eta == 0:
77 return sigma_next, sigma_next * 0.0, 1.0
78 if not is_rf:
79 return (*sampling.get_ancestral_step(sigma, sigma_next, eta=eta), 1.0)
80 # Referenced from ComfyUI.
81 downstep_ratio = 1.0 + (sigma_next / sigma - 1.0) * eta
82 sigma_down = sigma_next * downstep_ratio
83 alpha_ip1, alpha_down = 1.0 - sigma_next, 1.0 - sigma_down
84 sigma_up = (sigma_next**2 - sigma_down**2 * alpha_ip1**2 / alpha_down**2)**0.5
85 x_coeff = alpha_ip1 / alpha_down
86 return sigma_down, sigma_up, x_coeff
87
88def internal_step(x, d, dt, sigma, sigma_next, sigma_up, x_coeff, noise_sampler):
89 x = x + d * dt

Callers 1

sample_distance_advancedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected