better sigmas for sd1.5 as refiner

This commit is contained in:
lllyasviel
2023-10-12 18:31:42 -07:00
committed by GitHub
parent 26fe88d8a6
commit 3b9266e848
4 changed files with 49 additions and 33 deletions
+8 -6
View File
@@ -204,17 +204,19 @@ def get_previewer(model):
def ksampler(model, positive, negative, latent, seed=None, steps=30, cfg=7.0, sampler_name='dpmpp_fooocus_2m_sde_inpaint_seamless',
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):
previewer_start=None, previewer_end=None, sigmas=None, noise=None):
if sigmas is not None:
sigmas = sigmas.clone().to(fcbh.model_management.get_torch_device())
latent_image = latent["samples"]
if disable_noise:
noise = torch.zeros(latent_image.size(), dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
else:
batch_inds = latent["batch_index"] if "batch_index" in latent else None
noise = fcbh.sample.prepare_noise(latent_image, seed, batch_inds)
if noise is None:
if disable_noise:
noise = torch.zeros(latent_image.size(), dtype=latent_image.dtype, layout=latent_image.layout, device="cpu")
else:
batch_inds = latent["batch_index"] if "batch_index" in latent else None
noise = fcbh.sample.prepare_noise(latent_image, seed, batch_inds)
noise_mask = None
if "noise_mask" in latent: