Update train_network.py

This commit is contained in:
DKnight54
2025-02-07 01:28:26 +08:00
committed by GitHub
parent c1e387f9f9
commit 8d14893598

View File

@@ -1086,7 +1086,7 @@ class NetworkTrainer:
if args.save_state:
train_util.save_and_remove_state_on_epoch_end(args, accelerator, epoch + 1)
if args.sample_every_n_epochs is not None and (epoch + 1)% args.sample_every_n_epochs != 0:
if args.sample_every_n_epochs is not None and (epoch + 1)% args.sample_every_n_epochs == 0:
example_tuple = (latents, batch["captions"])
self.sample_images(accelerator, args, epoch + 1, global_step, accelerator.device, vae, tokenizer, text_encoder, unet, example_tuple)