Omnibus commited on
Commit
16aba50
·
1 Parent(s): 9dc7e52

Update video_diffusion/inpaint_zoom/zoom_in_app.py

Browse files
video_diffusion/inpaint_zoom/zoom_in_app.py CHANGED
@@ -10,8 +10,10 @@ from video_diffusion.inpaint_zoom.utils.zoom_in_utils import dummy, image_grid,
10
 
11
  if torch.cuda.is_available():
12
  device = torch.device("cuda")
 
13
  else:
14
  device = torch.device("cpu")
 
15
 
16
  os.environ["CUDA_VISIBLE_DEVICES"] = "0"
17
 
@@ -34,7 +36,7 @@ class StableDiffusionZoomIn:
34
 
35
  def load_model(self, model_id):
36
  if self.pipe is None:
37
- self.pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16, revision="fp16")
38
  self.pipe.scheduler = DPMSolverMultistepScheduler.from_config(self.pipe.scheduler.config)
39
  self.pipe = self.pipe.to(device)
40
  self.pipe.safety_checker = dummy
 
10
 
11
  if torch.cuda.is_available():
12
  device = torch.device("cuda")
13
+ dtype = torch.float16
14
  else:
15
  device = torch.device("cpu")
16
+ dtype= torch.HalfTensor
17
 
18
  os.environ["CUDA_VISIBLE_DEVICES"] = "0"
19
 
 
36
 
37
  def load_model(self, model_id):
38
  if self.pipe is None:
39
+ self.pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=dtype, revision="fp16")
40
  self.pipe.scheduler = DPMSolverMultistepScheduler.from_config(self.pipe.scheduler.config)
41
  self.pipe = self.pipe.to(device)
42
  self.pipe.safety_checker = dummy