mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
take extra sampler properties from StableDiffusionProcessing
This commit is contained in:
parent
4ea36a37d6
commit
a860839f1f
@ -125,9 +125,9 @@ class VanillaStableDiffusionSampler:
|
||||
|
||||
# existing code fails with cetain step counts, like 9
|
||||
try:
|
||||
self.sampler.make_schedule(ddim_num_steps=steps, ddim_eta=opts.ddim_eta, ddim_discretize=opts.ddim_discretize, verbose=False)
|
||||
self.sampler.make_schedule(ddim_num_steps=steps, ddim_eta=p.ddim_eta, ddim_discretize=p.ddim_discretize, verbose=False)
|
||||
except Exception:
|
||||
self.sampler.make_schedule(ddim_num_steps=steps+1,ddim_eta=opts.ddim_eta, ddim_discretize=opts.ddim_discretize, verbose=False)
|
||||
self.sampler.make_schedule(ddim_num_steps=steps+1,ddim_eta=p.ddim_eta, ddim_discretize=p.ddim_discretize, verbose=False)
|
||||
|
||||
x1 = self.sampler.stochastic_encode(x, torch.tensor([t_enc] * int(x.shape[0])).to(shared.device), noise=noise)
|
||||
|
||||
@ -277,8 +277,8 @@ class KDiffusionSampler:
|
||||
|
||||
extra_params_kwargs = {}
|
||||
for val in self.extra_params:
|
||||
if hasattr(opts,val):
|
||||
extra_params_kwargs[val] = getattr(opts,val)
|
||||
if hasattr(p,val):
|
||||
extra_params_kwargs[val] = getattr(p,val)
|
||||
|
||||
return self.func(self.model_wrap_cfg, xi, sigma_sched, extra_args={'cond': conditioning, 'uncond': unconditional_conditioning, 'cond_scale': p.cfg_scale}, disable=False, callback=self.callback_state, **extra_params_kwargs)
|
||||
|
||||
@ -299,8 +299,8 @@ class KDiffusionSampler:
|
||||
|
||||
extra_params_kwargs = {}
|
||||
for val in self.extra_params:
|
||||
if hasattr(opts,val):
|
||||
extra_params_kwargs[val] = getattr(opts,val)
|
||||
if hasattr(p,val):
|
||||
extra_params_kwargs[val] = getattr(p,val)
|
||||
|
||||
samples = self.func(self.model_wrap_cfg, x, sigmas, extra_args={'cond': conditioning, 'uncond': unconditional_conditioning, 'cond_scale': p.cfg_scale}, disable=False, callback=self.callback_state, **extra_params_kwargs)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user