"git@developer.sourcefind.cn:OpenDAS/lmdeploy.git" did not exist on "0d21f366adeea29ef816ff137f4febc71c2416a7"
Unverified Commit cba548d8 authored by Jianqi Pan's avatar Jianqi Pan Committed by GitHub
Browse files

fix(pipeline): k sampler sigmas device (#9189)

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.
parent db829a4b
......@@ -602,9 +602,9 @@ class StableDiffusionKDiffusionPipeline(
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
......
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