Update sdxl_train_util.py

This commit is contained in:
DKnight54
2025-01-24 00:19:09 +08:00
committed by GitHub
parent 68c65e0ae5
commit 8daa8b3283

View File

@@ -107,10 +107,10 @@ def _load_target_model(
text_encoder2 = pipe.text_encoder_2
# convert to fp32 for cache text_encoders outputs
#if text_encoder1.dtype != torch.float32:
# text_encoder1 = text_encoder1.to(dtype=torch.float32)
#if text_encoder2.dtype != torch.float32:
# text_encoder2 = text_encoder2.to(dtype=torch.float32)
if text_encoder1.dtype != torch.float32:
text_encoder1 = text_encoder1.to(dtype=torch.float32)
if text_encoder2.dtype != torch.float32:
text_encoder2 = text_encoder2.to(dtype=torch.float32)
vae = pipe.vae
unet = pipe.unet