Skip to content

Commit aa6eefc

Browse files
committed
bug fix
1 parent 81f8a38 commit aa6eefc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

diffsynth_engine/pipelines/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ def prepare_latents(
196196
# if you have any questions about this, please ask @dizhipeng.dzp for more details
197197
latents = latents * sigmas[0] / ((sigmas[0] ** 2 + 1) ** 0.5)
198198
init_latents = latents.clone()
199-
sigmas, timesteps = sigmas.to(device=self.device), timesteps.to(self.device)
199+
sigmas, timesteps = sigmas.to(device=self.device, dtype=self.dtype), timesteps.to(device=self.device, dtype=self.dtype)
200+
init_latents, latents = init_latents.to(device=self.device, dtype=self.dtype), latents.to(device=self.device, dtype=self.dtype)
200201
return init_latents, latents, sigmas, timesteps
201202

202203
def eval(self):

diffsynth_engine/pipelines/flux_image.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,8 @@ def prepare_latents(
676676
num_inference_steps, mu=mu, sigma_min=1 / num_inference_steps, sigma_max=1.0
677677
)
678678
init_latents = latents.clone()
679-
sigmas, timesteps = sigmas.to(device=self.device), timesteps.to(self.device)
679+
sigmas, timesteps = sigmas.to(device=self.device, dtype=self.dtype), timesteps.to(device=self.device, dtype=self.dtype)
680+
init_latents, latents = init_latents.to(device=self.device, dtype=self.dtype), latents.to(device=self.device, dtype=self.dtype)
680681
return init_latents, latents, sigmas, timesteps
681682

682683
def prepare_masked_latent(self, image: Image.Image, mask: Image.Image | None, height: int, width: int):

0 commit comments

Comments
 (0)