Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,14 +11,14 @@ Path("tmp").mkdir(exist_ok=True)
|
|
11 |
|
12 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
13 |
print(f"Device is {device}")
|
14 |
-
device = "cpu"
|
15 |
pipe = StableDiffusionLDM3DPipeline.from_pretrained(
|
16 |
"Intel/ldm3d-4c",
|
17 |
torch_dtype=torch.float16
|
18 |
# , safety_checker=None
|
19 |
)
|
20 |
pipe.to(device)
|
21 |
-
|
|
|
22 |
pipe.enable_model_cpu_offload()
|
23 |
|
24 |
|
|
|
11 |
|
12 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
13 |
print(f"Device is {device}")
|
|
|
14 |
pipe = StableDiffusionLDM3DPipeline.from_pretrained(
|
15 |
"Intel/ldm3d-4c",
|
16 |
torch_dtype=torch.float16
|
17 |
# , safety_checker=None
|
18 |
)
|
19 |
pipe.to(device)
|
20 |
+
if device == "cuda":
|
21 |
+
pipe.enable_xformers_memory_efficient_attention()
|
22 |
pipe.enable_model_cpu_offload()
|
23 |
|
24 |
|