improve anime

Improve Fooocus Anime a bit by using better SD1.5 refining formulation.
This commit is contained in:
lllyasviel
2023-10-21 17:11:55 -07:00
parent 60c05342b2
commit 736a5aa3ac
6 changed files with 36 additions and 59 deletions
+9 -7
View File
@@ -218,19 +218,21 @@ 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=None):
previewer_start=None, previewer_end=None, sigmas=None, extra_noise=0.0):
if sigmas is not None:
sigmas = sigmas.clone().to(fcbh.model_management.get_torch_device())
latent_image = latent["samples"]
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)
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 extra_noise > 0.0:
noise = noise * (1.0 + extra_noise)
noise_mask = None
if "noise_mask" in latent: