mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-08 14:34:23 +00:00
Merge pull request #907 from shirayu/add_option_sample_at_first
Add option --sample_at_first
This commit is contained in:
@@ -534,6 +534,20 @@ class TextualInversionTrainer:
|
||||
accelerator.print(f"\nepoch {epoch+1}/{num_train_epochs}")
|
||||
current_epoch.value = epoch + 1
|
||||
|
||||
# For --sample_at_first
|
||||
self.sample_images(
|
||||
accelerator,
|
||||
args,
|
||||
epoch,
|
||||
global_step,
|
||||
accelerator.device,
|
||||
vae,
|
||||
tokenizer_or_list,
|
||||
text_encoder_or_list,
|
||||
unet,
|
||||
prompt_replacement,
|
||||
)
|
||||
|
||||
for text_encoder in text_encoders:
|
||||
text_encoder.train()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user