Spaces:
Paused
Paused
lllyasviel
commited on
Commit
·
c1f84af
1
Parent(s):
16e8fe9
- modules/core.py +6 -1
- modules/samplers_advanced.py +2 -1
modules/core.py
CHANGED
@@ -185,13 +185,18 @@ def ksampler_with_refiner(model, positive, negative, refiner, refiner_positive,
|
|
185 |
positive_copy = broadcast_cond(positive, noise.shape[0], device)
|
186 |
negative_copy = broadcast_cond(negative, noise.shape[0], device)
|
187 |
|
|
|
|
|
|
|
188 |
models = load_additional_models(positive, negative, model.model_dtype())
|
189 |
|
190 |
sampler = KSamplerWithRefiner(model=model.model, refiner_model=refiner.model, steps=steps, device=device,
|
191 |
sampler=sampler_name, scheduler=scheduler,
|
192 |
denoise=denoise, model_options=model.model_options)
|
193 |
|
194 |
-
samples = sampler.sample(noise, positive_copy, negative_copy,
|
|
|
|
|
195 |
start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise,
|
196 |
denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar,
|
197 |
seed=seed)
|
|
|
185 |
positive_copy = broadcast_cond(positive, noise.shape[0], device)
|
186 |
negative_copy = broadcast_cond(negative, noise.shape[0], device)
|
187 |
|
188 |
+
refiner_positive_copy = broadcast_cond(refiner_positive, noise.shape[0], device)
|
189 |
+
refiner_negative_copy = broadcast_cond(refiner_negative, noise.shape[0], device)
|
190 |
+
|
191 |
models = load_additional_models(positive, negative, model.model_dtype())
|
192 |
|
193 |
sampler = KSamplerWithRefiner(model=model.model, refiner_model=refiner.model, steps=steps, device=device,
|
194 |
sampler=sampler_name, scheduler=scheduler,
|
195 |
denoise=denoise, model_options=model.model_options)
|
196 |
|
197 |
+
samples = sampler.sample(noise, positive_copy, negative_copy, refiner_positive=refiner_positive_copy,
|
198 |
+
refiner_negative=refiner_negative_copy, refiner_switch_step=refiner_switch_step,
|
199 |
+
cfg=cfg, latent_image=latent_image,
|
200 |
start_step=start_step, last_step=last_step, force_full_denoise=force_full_denoise,
|
201 |
denoise_mask=noise_mask, sigmas=sigmas, callback=callback, disable_pbar=disable_pbar,
|
202 |
seed=seed)
|
modules/samplers_advanced.py
CHANGED
@@ -75,7 +75,8 @@ class KSamplerWithRefiner:
|
|
75 |
sigmas = self.calculate_sigmas(new_steps).to(self.device)
|
76 |
self.sigmas = sigmas[-(steps + 1):]
|
77 |
|
78 |
-
def sample(self, noise, positive, negative,
|
|
|
79 |
force_full_denoise=False, denoise_mask=None, sigmas=None, callback=None, disable_pbar=False, seed=None):
|
80 |
if sigmas is None:
|
81 |
sigmas = self.sigmas
|
|
|
75 |
sigmas = self.calculate_sigmas(new_steps).to(self.device)
|
76 |
self.sigmas = sigmas[-(steps + 1):]
|
77 |
|
78 |
+
def sample(self, noise, positive, negative, refiner_positive, refiner_negative, cfg, latent_image=None,
|
79 |
+
start_step=None, last_step=None, refiner_switch_step=None,
|
80 |
force_full_denoise=False, denoise_mask=None, sigmas=None, callback=None, disable_pbar=False, seed=None):
|
81 |
if sigmas is None:
|
82 |
sigmas = self.sigmas
|