Spaces:
Sleeping
Sleeping
Use fp32
Browse files
model.py
CHANGED
@@ -11,17 +11,11 @@ class Model:
|
|
11 |
self.device = torch.device(
|
12 |
'cuda:0' if torch.cuda.is_available() else 'cpu')
|
13 |
model_id = 'CompVis/stable-diffusion-v1-4'
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
model_id, torch_dtype=torch.float16)
|
20 |
-
self.sd_pipe.to(self.device)
|
21 |
-
else:
|
22 |
-
self.ax_pipe = StableDiffusionAttendAndExcitePipeline.from_pretrained(
|
23 |
-
model_id)
|
24 |
-
self.sd_pipe = StableDiffusionPipeline.from_pretrained(model_id)
|
25 |
|
26 |
def get_token_table(self, prompt: str):
|
27 |
tokens = [
|
|
|
11 |
self.device = torch.device(
|
12 |
'cuda:0' if torch.cuda.is_available() else 'cpu')
|
13 |
model_id = 'CompVis/stable-diffusion-v1-4'
|
14 |
+
self.ax_pipe = StableDiffusionAttendAndExcitePipeline.from_pretrained(
|
15 |
+
model_id)
|
16 |
+
self.ax_pipe.to(self.device)
|
17 |
+
self.sd_pipe = StableDiffusionPipeline.from_pretrained(model_id)
|
18 |
+
self.sd_pipe.to(self.device)
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
def get_token_table(self, prompt: str):
|
21 |
tokens = [
|