SpyC0der77 commited on
Commit
20bbc42
·
verified ·
1 Parent(s): 3fe3a3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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.float16,
15
- variant="fp16", # Use FP16 variant if available for speed
16
- safety_checker=None, # (Optional) disable safety checker to speed things up
17
  )
18
- pipe.to("cuda")
 
 
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: