Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,11 +11,13 @@ LORA_PATH = "fofr/sdxl-emoji"
|
|
11 |
# --- Load the base pipeline ---
|
12 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
13 |
BASE_MODEL,
|
14 |
-
torch_dtype=torch.
|
15 |
-
variant="fp16",
|
16 |
-
safety_checker=None,
|
17 |
)
|
18 |
-
|
|
|
|
|
19 |
|
20 |
# --- Enable fast attention if available ---
|
21 |
try:
|
|
|
11 |
# --- Load the base pipeline ---
|
12 |
pipe = StableDiffusionXLPipeline.from_pretrained(
|
13 |
BASE_MODEL,
|
14 |
+
torch_dtype=torch.float32, # Use FP32 for CPU
|
15 |
+
variant="fp16", # You may also need to adjust this if not using GPU
|
16 |
+
safety_checker=None,
|
17 |
)
|
18 |
+
|
19 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
20 |
+
pipe.to(device)
|
21 |
|
22 |
# --- Enable fast attention if available ---
|
23 |
try:
|