revise math
This commit is contained in:
parent
6f3fa4b670
commit
43bc2df328
@ -1 +1 @@
|
||||
version = '2.1.730'
|
||||
version = '2.1.731'
|
||||
|
@ -218,7 +218,7 @@ def get_previewer(model):
|
||||
def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=7.0, sampler_name='dpmpp_2m_sde_gpu',
|
||||
scheduler='karras', denoise=1.0, disable_noise=False, start_step=None, last_step=None,
|
||||
force_full_denoise=False, callback_function=None, refiner=None, refiner_switch=-1,
|
||||
previewer_start=None, previewer_end=None, sigmas=None, noise_offset=None):
|
||||
previewer_start=None, previewer_end=None, sigmas=None, noise_mean=None):
|
||||
|
||||
if sigmas is not None:
|
||||
sigmas = sigmas.clone().to(fcbh.model_management.get_torch_device())
|
||||
@ -231,8 +231,8 @@ def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=7.0, sa
|
||||
batch_inds = latent["batch_index"] if "batch_index" in latent else None
|
||||
noise = fcbh.sample.prepare_noise(latent_image, seed, batch_inds)
|
||||
|
||||
if isinstance(noise_offset, torch.Tensor):
|
||||
noise = noise + noise_offset
|
||||
if isinstance(noise_mean, torch.Tensor):
|
||||
noise = noise + noise_mean - torch.mean(noise, dim=1, keepdim=True)
|
||||
|
||||
noise_mask = None
|
||||
if "noise_mask" in latent:
|
||||
|
@ -468,7 +468,7 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
|
||||
denoise=denoise)[switch:] * k_sigmas
|
||||
len_sigmas = len(sigmas) - 1
|
||||
|
||||
noise_offset = torch.mean(modules.patch.eps_record, dim=1, keepdim=True) * 0.9
|
||||
noise_mean = torch.mean(modules.patch.eps_record, dim=1, keepdim=True)
|
||||
|
||||
if modules.inpaint_worker.current_task is not None:
|
||||
modules.inpaint_worker.current_task.swap()
|
||||
@ -488,7 +488,7 @@ def process_diffusion(positive_cond, negative_cond, steps, switch, width, height
|
||||
previewer_start=switch,
|
||||
previewer_end=steps,
|
||||
sigmas=sigmas,
|
||||
noise_offset=noise_offset
|
||||
noise_mean=noise_mean
|
||||
)
|
||||
|
||||
target_model = final_refiner_vae
|
||||
|
Loading…
Reference in New Issue
Block a user