mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2025-02-05 05:02:55 +08:00
fix floating error
This commit is contained in:
parent
15a94d6cf7
commit
37e048a7e2
@ -89,6 +89,7 @@ def restart_sampler(model, x, sigmas, extra_args=None, callback=None, disable=No
|
||||
restart_steps, restart_times, restart_max = restart_list[i + 1]
|
||||
min_idx = i + 1
|
||||
max_idx = int(torch.argmin(abs(sigmas - restart_max), dim=0))
|
||||
if max_idx < min_idx:
|
||||
sigma_restart = get_sigmas_karras(restart_steps, sigmas[min_idx], sigmas[max_idx], device=sigmas.device)[:-1] # remove the zero at the end
|
||||
for times in range(restart_times):
|
||||
x = x + torch.randn_like(x) * s_noise * (sigmas[max_idx] ** 2 - sigmas[min_idx] ** 2) ** 0.5
|
||||
|
Loading…
Reference in New Issue
Block a user