From c6d986e86897b56f3a599a070ad55e00f47e6977 Mon Sep 17 00:00:00 2001 From: DKnight54 <126916963+DKnight54@users.noreply.github.com> Date: Fri, 28 Mar 2025 19:46:23 +0800 Subject: [PATCH] Update train_network.py --- train_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/train_network.py b/train_network.py index a4e7565e..dec081ca 100644 --- a/train_network.py +++ b/train_network.py @@ -913,7 +913,7 @@ class NetworkTrainer: if "latents" in batch and batch["latents"] is not None: latents = batch["latents"].to(accelerator.device).to(dtype=weight_dtype) else: - if args.train_vae_batch is None or len(batch["latents"]) <= args.train_vae_batch + if args.train_vae_batch is None or len(batch["latents"]) <= args.train_vae_batch: with torch.no_grad(): # latentに変換 latents = vae.encode(batch["images"].to(dtype=vae_dtype)).latent_dist.sample().to(dtype=weight_dtype)