Skip to content

Commit

Permalink
fix(pipeline): k sampler sigmas device (huggingface#9189)
Browse files Browse the repository at this point in the history
If Karras is not enabled, a device inconsistency error will occur. This is due to the fact that sigmas were not moved to the specified device.
  • Loading branch information
Jannchie authored Aug 17, 2024
1 parent db829a4 commit cba548d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,9 @@ def __call__(
sigma_min: float = self.k_diffusion_model.sigmas[0].item()
sigma_max: float = self.k_diffusion_model.sigmas[-1].item()
sigmas = get_sigmas_karras(n=num_inference_steps, sigma_min=sigma_min, sigma_max=sigma_max)
sigmas = sigmas.to(device)
else:
sigmas = self.scheduler.sigmas
sigmas = sigmas.to(device)
sigmas = sigmas.to(prompt_embeds.dtype)

# 6. Prepare latent variables
Expand Down

0 comments on commit cba548d

Please sign in to comment.