mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-10 23:01:22 +00:00
Update train_network.py
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user