smzerbe commited on
Commit
8547b46
·
verified ·
1 Parent(s): 0693744

Update modules/sd_models.py

Browse files
Files changed (1) hide show
  1. modules/sd_models.py +4 -0
modules/sd_models.py CHANGED
@@ -872,6 +872,10 @@ def load_model(checkpoint_info=None, already_loaded_state_dict=None):
872
 
873
  timer.record("scripts callbacks")
874
 
 
 
 
 
875
  with torch.no_grad():
876
  sd_model.cond_stage_model_empty_prompt = get_empty_cond(sd_model)
877
 
 
872
 
873
  timer.record("scripts callbacks")
874
 
875
+ if not torch.cuda.is_available():
876
+ print("Running on CPU: forcing model to float32")
877
+ sd_model.to(torch.float32)
878
+
879
  with torch.no_grad():
880
  sd_model.cond_stage_model_empty_prompt = get_empty_cond(sd_model)
881