ford442 commited on
Commit
8c67aee
·
verified ·
1 Parent(s): 3ef7513

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -146,6 +146,15 @@ def load_and_prepare_model():
146
  print(f'init noise scale: {pipe.scheduler.init_noise_sigma}')
147
  pipe.watermark=None
148
  pipe.safety_checker=None
 
 
 
 
 
 
 
 
 
149
  return pipe
150
 
151
  # Preload and compile both models
 
146
  print(f'init noise scale: {pipe.scheduler.init_noise_sigma}')
147
  pipe.watermark=None
148
  pipe.safety_checker=None
149
+
150
+ # Freeze vae and unet
151
+ pipe.vae.requires_grad_(False)
152
+ pipe.unet.requires_grad_(False)
153
+ pipe.text_encoder.requires_grad_(False)
154
+ pipe.unet.eval()
155
+ pipe.vae.eval()
156
+ pipe.text_encoder.eval()
157
+
158
  return pipe
159
 
160
  # Preload and compile both models