|
|
@ -624,6 +624,9 @@ class CFGGuider: |
|
|
|
return self.inner_model.process_latent_out(samples.to(torch.float32)) |
|
|
|
return self.inner_model.process_latent_out(samples.to(torch.float32)) |
|
|
|
|
|
|
|
|
|
|
|
def sample(self, noise, latent_image, sampler, sigmas, denoise_mask=None, callback=None, disable_pbar=False, seed=None): |
|
|
|
def sample(self, noise, latent_image, sampler, sigmas, denoise_mask=None, callback=None, disable_pbar=False, seed=None): |
|
|
|
|
|
|
|
if sigmas.shape[-1] == 0: |
|
|
|
|
|
|
|
return latent_image |
|
|
|
|
|
|
|
|
|
|
|
self.conds = {} |
|
|
|
self.conds = {} |
|
|
|
for k in self.original_conds: |
|
|
|
for k in self.original_conds: |
|
|
|
self.conds[k] = list(map(lambda a: a.copy(), self.original_conds[k])) |
|
|
|
self.conds[k] = list(map(lambda a: a.copy(), self.original_conds[k])) |
|
|
@ -721,6 +724,9 @@ class KSampler: |
|
|
|
self.steps = steps |
|
|
|
self.steps = steps |
|
|
|
if denoise is None or denoise > 0.9999: |
|
|
|
if denoise is None or denoise > 0.9999: |
|
|
|
self.sigmas = self.calculate_sigmas(steps).to(self.device) |
|
|
|
self.sigmas = self.calculate_sigmas(steps).to(self.device) |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
if denoise <= 0.0: |
|
|
|
|
|
|
|
self.sigmas = torch.FloatTensor([]) |
|
|
|
else: |
|
|
|
else: |
|
|
|
new_steps = int(steps/denoise) |
|
|
|
new_steps = int(steps/denoise) |
|
|
|
sigmas = self.calculate_sigmas(new_steps).to(self.device) |
|
|
|
sigmas = self.calculate_sigmas(new_steps).to(self.device) |
|
|
|