"git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "e7b2327cdb265b4aabfa1925c6c0a66e1a01f7ee"
Commit 7f0fd99b authored by comfyanonymous's avatar comfyanonymous
Browse files

Make ddim work with --cpu

parent dd095efc
...@@ -450,7 +450,7 @@ class KSampler: ...@@ -450,7 +450,7 @@ class KSampler:
noise_mask = None noise_mask = None
if denoise_mask is not None: if denoise_mask is not None:
noise_mask = 1.0 - denoise_mask noise_mask = 1.0 - denoise_mask
sampler = DDIMSampler(self.model) sampler = DDIMSampler(self.model, device=self.device)
sampler.make_schedule_timesteps(ddim_timesteps=timesteps, verbose=False) sampler.make_schedule_timesteps(ddim_timesteps=timesteps, verbose=False)
z_enc = sampler.stochastic_encode(latent_image, torch.tensor([len(timesteps) - 1] * noise.shape[0]).to(self.device), noise=noise, max_denoise=max_denoise) z_enc = sampler.stochastic_encode(latent_image, torch.tensor([len(timesteps) - 1] * noise.shape[0]).to(self.device), noise=noise, max_denoise=max_denoise)
samples, _ = sampler.sample_custom(ddim_timesteps=timesteps, samples, _ = sampler.sample_custom(ddim_timesteps=timesteps,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment