Skip to content

Commit d6365ec

Browse files
committed
upd
Signed-off-by: Lancer <maruixiang6688@gmail.com>
1 parent c1f00a2 commit d6365ec

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/diffusers/pipelines/joyai_image/pipeline_joyai_image.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def __init__(
191191
self.text_token_max_length = int(getattr(self.args, "text_token_max_length", 2048))
192192
self.prompt_template_encode = PROMPT_TEMPLATE_ENCODE
193193
self.prompt_template_encode_start_idx = PROMPT_TEMPLATE_START_IDX
194+
self._joyai_force_vae_fp32 = True
194195

195196
@staticmethod
196197
def _dtype_to_precision(torch_dtype: Optional[torch.dtype]) -> Optional[str]:
@@ -449,6 +450,8 @@ def check_inputs(
449450
)
450451

451452
def _vae_compute_dtype(self) -> torch.dtype:
453+
if getattr(self, "_joyai_force_vae_fp32", False):
454+
return torch.float32
452455
if hasattr(self.vae, "model"):
453456
return next(self.vae.model.parameters()).dtype
454457
return next(self.vae.parameters()).dtype

0 commit comments

Comments
 (0)