summaryrefslogtreecommitdiffstats
path: root/training/strategy/dreambooth.py
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2023-03-23 11:07:57 +0100
committerVolpeon <git@volpeon.ink>2023-03-23 11:07:57 +0100
commit0767c7bc82645186159965c2a6be4278e33c6721 (patch)
treea136470ab85dbb99ab51d9be4a7831fe21612ab3 /training/strategy/dreambooth.py
parentFix (diff)
downloadtextual-inversion-diff-0767c7bc82645186159965c2a6be4278e33c6721.tar.gz
textual-inversion-diff-0767c7bc82645186159965c2a6be4278e33c6721.tar.bz2
textual-inversion-diff-0767c7bc82645186159965c2a6be4278e33c6721.zip
Update
Diffstat (limited to 'training/strategy/dreambooth.py')
-rw-r--r--training/strategy/dreambooth.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/training/strategy/dreambooth.py b/training/strategy/dreambooth.py
index e5e84c8..28fccff 100644
--- a/training/strategy/dreambooth.py
+++ b/training/strategy/dreambooth.py
@@ -137,8 +137,8 @@ def dreambooth_strategy_callbacks(
137 137
138 print("Saving model...") 138 print("Saving model...")
139 139
140 unet_ = accelerator.unwrap_model(unet, False) 140 unet_ = accelerator.unwrap_model(unet, keep_fp32_wrapper=False)
141 text_encoder_ = accelerator.unwrap_model(text_encoder, False) 141 text_encoder_ = accelerator.unwrap_model(text_encoder, keep_fp32_wrapper=False)
142 142
143 with ema_context(): 143 with ema_context():
144 pipeline = VlpnStableDiffusion( 144 pipeline = VlpnStableDiffusion(
@@ -160,8 +160,8 @@ def dreambooth_strategy_callbacks(
160 @torch.no_grad() 160 @torch.no_grad()
161 def on_sample(step): 161 def on_sample(step):
162 with ema_context(): 162 with ema_context():
163 unet_ = accelerator.unwrap_model(unet, False) 163 unet_ = accelerator.unwrap_model(unet, keep_fp32_wrapper=True)
164 text_encoder_ = accelerator.unwrap_model(text_encoder, False) 164 text_encoder_ = accelerator.unwrap_model(text_encoder, keep_fp32_wrapper=True)
165 165
166 orig_unet_dtype = unet_.dtype 166 orig_unet_dtype = unet_.dtype
167 orig_text_encoder_dtype = text_encoder_.dtype 167 orig_text_encoder_dtype = text_encoder_.dtype