Spaces:
Sleeping
Sleeping
Update pk_workflow.py
Browse files370 unmodified lines37137237337437537637737837937538038138238364 unmodified lines448449450451452453454455456447457458459460370 unmodified lines # `cpu=True` runs the Brownian-bridge recursion on CPU rather than the GPU — negligible cost next to # the transformer forward pass, but noticeably more numerically stable than `cpu=False`, which is what # ComfyUI's own non-`_gpu`-suffixed variants default to for exactly this reason. # Padded a hair beyond the real [min, max] span, not built exactly at it: querying a BrownianTree # exactly on its own construction bound is a known torchsde precision edge (`tb<=t1`-style warnings). # The pad only widens the tree's internal span — every query below still uses the real, un-padded sigma. sigma_min, sigma_max = sigmas[sigmas > 0].min(), sigmas.max() pad = (sigma_max - sigma_min).clamp_min(1e-6) * 1e-4 scheduler._dpmpp_sde_noise_sampler = _BrownianTreeNoiseSampler( x, sigmas[sigmas > 0].min(), sigmas.max(), seed=scheduler._dpmpp_sde_seed, cpu=True x, sigma_min - pad, sigma_max + pad, seed=scheduler._dpmpp_sde_seed, cpu=True )
def half_log_snr(s):64 unmodified lines # `cpu=True` runs the Brownian-bridge recursion on CPU rather than the GPU — negligible cost next to # the transformer forward pass, but noticeably more numerically stable than `cpu=False`, which is what # ComfyUI's own non-`_gpu`-suffixed variants default to for exactly this reason. # Padded a hair beyond the real [min, max] span, not built exactly at it: querying a BrownianTree # exactly on its own construction bound is a known torchsde precision edge (`tb<=t1`-style warnings). # The pad only widens the tree's internal span — every query below still uses the real, un-padded sigma. sigma_min, sigma_max = sigmas[sigmas > 0].min(), sigmas.max() pad = (sigma_max - sigma_min).clamp_min(1e-6) * 1e-4 scheduler._dpmpp_sde_noise_sampler = _BrownianTreeNoiseSampler( x, sigmas[sigmas > 0].min(), sigmas.max(), seed=scheduler._dpmpp_sde_seed, cpu=True x, sigma_min - pad, sigma_max + pad, seed=scheduler._dpmpp_sde_seed, cpu=True )
def half_log_snr(s):pk_workflow.py+12-2