fix Text Encoder only LoRA training

This commit is contained in:
Kohya S
2025-01-27 22:03:42 +09:00
parent 59b3b94faf
commit 0778dd9b1d
3 changed files with 3 additions and 3 deletions

View File

@@ -233,7 +233,7 @@ class NetworkTrainer:
t.requires_grad_(True)
# Predict the noise residual
with torch.set_grad_enabled(is_train and train_unet), accelerator.autocast():
with torch.set_grad_enabled(is_train), accelerator.autocast():
noise_pred = self.call_unet(
args,
accelerator,