TiankaiHang commited on
Commit
93ec9cf
1 Parent(s): 106e80b
app.py CHANGED
@@ -291,7 +291,6 @@ def main(ckpt="checkpoints/v1-5-pruned-emaonly-adaption-task-humanalign.ckpt", a
291
  model.eval().cuda()
292
  else:
293
  model.eval()
294
- model = model.float()
295
 
296
  model_wrap = K.external.CompVisDenoiser(model)
297
  model_wrap_cfg = CFGDenoiser(model_wrap)
 
291
  model.eval().cuda()
292
  else:
293
  model.eval()
 
294
 
295
  model_wrap = K.external.CompVisDenoiser(model)
296
  model_wrap_cfg = CFGDenoiser(model_wrap)
stable_diffusion/ldm/modules/attention.py CHANGED
@@ -379,7 +379,8 @@ class SpatialTransformer(nn.Module):
379
  x_in = x
380
  if self.force_type_convert:
381
  x = self.norm.float()(x.float())
382
- x = x.half()
 
383
  else:
384
  x = self.norm(x)
385
  if not self.use_linear:
 
379
  x_in = x
380
  if self.force_type_convert:
381
  x = self.norm.float()(x.float())
382
+ if torch.cuda.is_available():
383
+ x = x.half()
384
  else:
385
  x = self.norm(x)
386
  if not self.use_linear: