This commit is contained in:
lvmin 2023-08-10 10:48:08 -07:00
parent 669314dff1
commit c4f798221d
2 changed files with 8 additions and 2 deletions

View File

@ -185,13 +185,18 @@ def ksampler_with_refiner(model, positive, negative, refiner, refiner_positive,
positive_copy = broadcast_cond(positive, noise.shape[0], device)
negative_copy = broadcast_cond(negative, noise.shape[0], device)
refiner_positive_copy = broadcast_cond(refiner_positive, noise.shape[0], device)
refiner_negative_copy = broadcast_cond(refiner_negative, noise.shape[0], device)
models = load_additional_models(positive, negative, model.model_dtype())
sampler = KSamplerWithRefiner(model=model.model, refiner_model=refiner.model, steps=steps, device=device,
sampler=sampler_name, scheduler=scheduler,
denoise=denoise, model_options=model.model_options)
samples = sampler.sample(noise, positive_copy, negative_copy, cfg=cfg, latent_image=latent_image,
samples = sampler.sample(noise, positive_copy, negative_copy, refiner_positive=refiner_positive_copy,
refiner_negative=refiner_negative_copy, refiner_switch_step=refiner_switch_step,
cfg=cfg, latent_image=latent_image,
start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise,
denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar,
seed=seed)

View File

@ -75,7 +75,8 @@ class KSamplerWithRefiner:
sigmas = self.calculate_sigmas(new_steps).to(self.device)
self.sigmas = sigmas[-(steps + 1):]
def sample(self, noise, positive, negative, cfg, latent_image=None, start_step=None, last_step=None,
def sample(self, noise, positive, negative, refiner_positive, refiner_negative, cfg, latent_image=None,
start_step=None, last_step=None, refiner_switch_step=None,
force_full_denoise=False, denoise_mask=None, sigmas=None, callback=None, disable_pbar=False, seed=None):
if sigmas is None:
sigmas = self.sigmas