Spaces:
Runtime error
Runtime error
Update video_diffusion/inpaint_zoom/zoom_in_app.py
Browse files
video_diffusion/inpaint_zoom/zoom_in_app.py
CHANGED
@@ -13,7 +13,7 @@ if torch.cuda.is_available():
|
|
13 |
dtype = torch.float16
|
14 |
else:
|
15 |
device = torch.device("cpu")
|
16 |
-
dtype=
|
17 |
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
18 |
|
19 |
|
@@ -36,14 +36,14 @@ class StableDiffusionZoomIn:
|
|
36 |
def load_model(self, model_id):
|
37 |
if self.pipe is None:
|
38 |
#self.pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=dtype, revision="fp16")
|
39 |
-
self.pipe = DiffusionPipeline.from_pretrained(model_id
|
40 |
|
41 |
self.pipe.scheduler = DPMSolverMultistepScheduler.from_config(self.pipe.scheduler.config)
|
42 |
self.pipe = self.pipe.to(device)
|
43 |
self.pipe.safety_checker = dummy
|
44 |
self.pipe.enable_attention_slicing()
|
45 |
-
self.pipe.enable_xformers_memory_efficient_attention()
|
46 |
-
self.
|
47 |
|
48 |
return self.pipe
|
49 |
|
|
|
13 |
dtype = torch.float16
|
14 |
else:
|
15 |
device = torch.device("cpu")
|
16 |
+
dtype= None
|
17 |
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
18 |
|
19 |
|
|
|
36 |
def load_model(self, model_id):
|
37 |
if self.pipe is None:
|
38 |
#self.pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=dtype, revision="fp16")
|
39 |
+
self.pipe = DiffusionPipeline.from_pretrained(model_id)
|
40 |
|
41 |
self.pipe.scheduler = DPMSolverMultistepScheduler.from_config(self.pipe.scheduler.config)
|
42 |
self.pipe = self.pipe.to(device)
|
43 |
self.pipe.safety_checker = dummy
|
44 |
self.pipe.enable_attention_slicing()
|
45 |
+
#self.pipe.enable_xformers_memory_efficient_attention()
|
46 |
+
self.g_cpu = torch.Generator(device=device)
|
47 |
|
48 |
return self.pipe
|
49 |
|