Spaces:
Running
Running
Update diffusion_webui/diffusion_models/inpaint_app.py
Browse files
diffusion_webui/diffusion_models/inpaint_app.py
CHANGED
@@ -10,14 +10,13 @@ class StableDiffusionInpaintGenerator:
|
|
10 |
self.pipe = None
|
11 |
|
12 |
def load_model(self, model_path):
|
13 |
-
if self.pipe is None:
|
14 |
self.pipe = DiffusionPipeline.from_pretrained(
|
15 |
model_path, revision="fp16", torch_dtype=torch.float16
|
16 |
)
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
return self.pipe
|
22 |
|
23 |
def generate_image(
|
|
|
10 |
self.pipe = None
|
11 |
|
12 |
def load_model(self, model_path):
|
13 |
+
if self.pipe is None or self.pipe.model_name != stable_model_path:
|
14 |
self.pipe = DiffusionPipeline.from_pretrained(
|
15 |
model_path, revision="fp16", torch_dtype=torch.float16
|
16 |
)
|
17 |
+
self.pipe.to("cuda")
|
18 |
+
self.pipe.enable_xformers_memory_efficient_attention()
|
19 |
+
|
|
|
20 |
return self.pipe
|
21 |
|
22 |
def generate_image(
|